Lines Matching full:pmd
18 #error CONFIG_PGTABLE_LEVELS is not consistent with __PAGETABLE_{P4D,PUD,PMD}_FOLDED
71 static inline pte_t *pte_offset_kernel(pmd_t *pmd, unsigned long address) in pte_offset_kernel() argument
73 return (pte_t *)pmd_page_vaddr(*pmd) + pte_index(address); in pte_offset_kernel()
126 * In many cases it is known that a virtual address is mapped at PMD or PTE
128 * pointer to the PMD entry in user or kernel page table or translate a virtual
144 pmd_t *pmd = pmd_off_k(vaddr); in virt_to_kpte() local
146 return pmd_none(*pmd) ? NULL : pte_offset_kernel(pmd, vaddr); in virt_to_kpte()
202 pmd_t pmd = *pmdp; in pmdp_test_and_clear_young() local
204 if (!pmd_young(pmd)) in pmdp_test_and_clear_young()
207 set_pmd_at(vma->vm_mm, address, pmdp, pmd_mkold(pmd)); in pmdp_test_and_clear_young()
268 pmd_t pmd = *pmdp; in pmdp_huge_get_and_clear() local
270 return pmd; in pmdp_huge_get_and_clear()
479 unsigned long address, pmd_t *pmdp, pmd_t pmd) in generic_pmdp_establish() argument
482 set_pmd_at(vma->vm_mm, address, pmdp, pmd); in generic_pmdp_establish()
518 #define pmd_access_permitted(pmd, write) \ argument
519 (pmd_present(pmd) && (!(write) || pmd_write(pmd)))
577 #define set_pmd_safe(pmdp, pmd) \ argument
579 WARN_ON_ONCE(pmd_present(*pmdp) && !pmd_same(*pmdp, pmd)); \
580 set_pmd(pmdp, pmd); \
767 static inline int pmd_none_or_clear_bad(pmd_t *pmd) in pmd_none_or_clear_bad() argument
769 if (pmd_none(*pmd)) in pmd_none_or_clear_bad()
771 if (unlikely(pmd_bad(*pmd))) { in pmd_none_or_clear_bad()
772 pmd_clear_bad(pmd); in pmd_none_or_clear_bad()
927 static inline pmd_t pmd_swp_mksoft_dirty(pmd_t pmd) in pmd_swp_mksoft_dirty() argument
929 return pmd; in pmd_swp_mksoft_dirty()
932 static inline int pmd_swp_soft_dirty(pmd_t pmd) in pmd_swp_soft_dirty() argument
937 static inline pmd_t pmd_swp_clear_soft_dirty(pmd_t pmd) in pmd_swp_clear_soft_dirty() argument
939 return pmd; in pmd_swp_clear_soft_dirty()
948 static inline int pmd_soft_dirty(pmd_t pmd) in pmd_soft_dirty() argument
958 static inline pmd_t pmd_mksoft_dirty(pmd_t pmd) in pmd_mksoft_dirty() argument
960 return pmd; in pmd_mksoft_dirty()
968 static inline pmd_t pmd_clear_soft_dirty(pmd_t pmd) in pmd_clear_soft_dirty() argument
970 return pmd; in pmd_clear_soft_dirty()
988 static inline pmd_t pmd_swp_mksoft_dirty(pmd_t pmd) in pmd_swp_mksoft_dirty() argument
990 return pmd; in pmd_swp_mksoft_dirty()
993 static inline int pmd_swp_soft_dirty(pmd_t pmd) in pmd_swp_soft_dirty() argument
998 static inline pmd_t pmd_swp_clear_soft_dirty(pmd_t pmd) in pmd_swp_clear_soft_dirty() argument
1000 return pmd; in pmd_swp_clear_soft_dirty()
1095 static inline int pmd_trans_huge(pmd_t pmd) in pmd_trans_huge() argument
1100 static inline int pmd_write(pmd_t pmd) in pmd_write() argument
1117 static inline int pmd_devmap(pmd_t pmd) in pmd_devmap() argument
1169 * Depend on compiler for an atomic pmd read. NOTE: this is in pmd_read_atomic()
1183 * transhuge page faults. MADV_DONTNEED can convert a transhuge pmd
1184 * into a null pmd and the transhuge page fault can convert a null pmd
1185 * into an hugepmd or into a regular pmd (if the hugepage allocation
1186 * fails). While holding the mmap_lock in read mode the pmd becomes
1188 * transhuge pmd. When those races occurs and this function makes a
1190 * undefined so behaving like if the pmd was none is safe (because it
1195 * care of reading the pmd atomically to avoid SMP race conditions
1199 * fault can populate the pmd from under us).
1201 static inline int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd) in pmd_none_or_trans_huge_or_clear_bad() argument
1203 pmd_t pmdval = pmd_read_atomic(pmd); in pmd_none_or_trans_huge_or_clear_bad()
1211 * mapped in the pmd). The below checks will only care about in pmd_none_or_trans_huge_or_clear_bad()
1212 * the low part of the pmd with 32bit PAE x86 anyway, with the in pmd_none_or_trans_huge_or_clear_bad()
1214 * the low part of the pmd is found null, the high part will in pmd_none_or_trans_huge_or_clear_bad()
1222 * !pmd_present() checks for pmd migration entries in pmd_none_or_trans_huge_or_clear_bad()
1232 * pmd_none() is preseved for future condition checks on pmd migration in pmd_none_or_trans_huge_or_clear_bad()
1240 pmd_clear_bad(pmd); in pmd_none_or_trans_huge_or_clear_bad()
1250 * places that already verified the pmd is not none and they want to
1252 * need this). If THP is not enabled, the pmd can't go away under the
1255 * split_huge_pmd returns (because it may have run when the pmd become
1258 static inline int pmd_trans_unstable(pmd_t *pmd) in pmd_trans_unstable() argument
1261 return pmd_none_or_trans_huge_or_clear_bad(pmd); in pmd_trans_unstable()
1273 static inline int pmd_devmap_trans_unstable(pmd_t *pmd) in pmd_devmap_trans_unstable() argument
1275 return pmd_devmap(*pmd) || pmd_trans_unstable(pmd); in pmd_devmap_trans_unstable()
1292 static inline int pmd_protnone(pmd_t pmd) in pmd_protnone() argument
1317 int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot);
1319 int pmd_clear_huge(pmd_t *pmd);
1322 int pmd_free_pte_page(pmd_t *pmd, unsigned long addr);
1332 static inline int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot) in pmd_set_huge() argument
1344 static inline int pmd_clear_huge(pmd_t *pmd) in pmd_clear_huge() argument
1356 static inline int pmd_free_pte_page(pmd_t *pmd, unsigned long addr) in pmd_free_pte_page() argument
1468 * On some architectures it depends on the mm if the p4d/pud or pmd