Lines Matching full:pmd
46 * We need to mark a pmd pte invalid while splitting. We can do that by clearing
178 /* pmd table use page table fragments */
239 /* Bits to mask out from a PMD to get to the PTE page */
241 /* Bits to mask out from a PUD to get to the PMD page */
643 * This is potentially called with a pmd as the argument, in which case it's not
688 #define __pmd_to_swp_entry(pmd) (__pte_to_swp_entry(pmd_pte(pmd))) argument
844 static inline int pmd_none(pmd_t pmd) in pmd_none() argument
846 return !pmd_raw(pmd); in pmd_none()
849 static inline int pmd_present(pmd_t pmd) in pmd_present() argument
852 * A pmd is considerent present if _PAGE_PRESENT is set. in pmd_present()
853 * We also need to consider the pmd present which is marked in pmd_present()
857 if (pmd_raw(pmd) & cpu_to_be64(_PAGE_PRESENT | _PAGE_INVALID)) in pmd_present()
863 static inline int pmd_is_serializing(pmd_t pmd) in pmd_is_serializing() argument
866 * If the pmd is undergoing a split, the _PAGE_PRESENT bit is clear in pmd_is_serializing()
869 * This condition may also occur when flushing a pmd while flushing in pmd_is_serializing()
873 if ((pmd_raw(pmd) & cpu_to_be64(_PAGE_PRESENT | _PAGE_INVALID)) == in pmd_is_serializing()
880 static inline int pmd_bad(pmd_t pmd) in pmd_bad() argument
883 return radix__pmd_bad(pmd); in pmd_bad()
884 return hash__pmd_bad(pmd); in pmd_bad()
910 extern struct page *pmd_page(pmd_t pmd);
938 #define pud_soft_dirty(pmd) pte_soft_dirty(pud_pte(pud)) argument
939 #define pud_mksoft_dirty(pmd) pte_pud(pte_mksoft_dirty(pud_pte(pud))) argument
940 #define pud_clear_soft_dirty(pmd) pte_pud(pte_clear_soft_dirty(pud_pte(pud))) argument
1020 pr_err("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
1069 static inline pte_t pmd_pte(pmd_t pmd) in pmd_pte() argument
1071 return __pte_raw(pmd_raw(pmd)); in pmd_pte()
1079 static inline pte_t *pmdp_ptep(pmd_t *pmd) in pmdp_ptep() argument
1081 return (pte_t *)pmd; in pmdp_ptep()
1083 #define pmd_pfn(pmd) pte_pfn(pmd_pte(pmd)) argument
1084 #define pmd_dirty(pmd) pte_dirty(pmd_pte(pmd)) argument
1085 #define pmd_young(pmd) pte_young(pmd_pte(pmd)) argument
1086 #define pmd_mkold(pmd) pte_pmd(pte_mkold(pmd_pte(pmd))) argument
1087 #define pmd_wrprotect(pmd) pte_pmd(pte_wrprotect(pmd_pte(pmd))) argument
1088 #define pmd_mkdirty(pmd) pte_pmd(pte_mkdirty(pmd_pte(pmd))) argument
1089 #define pmd_mkclean(pmd) pte_pmd(pte_mkclean(pmd_pte(pmd))) argument
1090 #define pmd_mkyoung(pmd) pte_pmd(pte_mkyoung(pmd_pte(pmd))) argument
1091 #define pmd_mkwrite_novma(pmd) pte_pmd(pte_mkwrite_novma(pmd_pte(pmd))) argument
1094 #define pmd_soft_dirty(pmd) pte_soft_dirty(pmd_pte(pmd)) argument
1095 #define pmd_mksoft_dirty(pmd) pte_pmd(pte_mksoft_dirty(pmd_pte(pmd))) argument
1096 #define pmd_clear_soft_dirty(pmd) pte_pmd(pte_clear_soft_dirty(pmd_pte(pmd))) argument
1099 #define pmd_swp_mksoft_dirty(pmd) pte_pmd(pte_swp_mksoft_dirty(pmd_pte(pmd))) argument
1100 #define pmd_swp_soft_dirty(pmd) pte_swp_soft_dirty(pmd_pte(pmd)) argument
1101 #define pmd_swp_clear_soft_dirty(pmd) pte_pmd(pte_swp_clear_soft_dirty(pmd_pte(pmd))) argument
1106 static inline int pmd_protnone(pmd_t pmd) in pmd_protnone() argument
1108 return pte_protnone(pmd_pte(pmd)); in pmd_protnone()
1112 #define pmd_write(pmd) pte_write(pmd_pte(pmd)) argument
1115 static inline bool pmd_access_permitted(pmd_t pmd, bool write) in pmd_access_permitted() argument
1127 if (pmd_is_serializing(pmd)) in pmd_access_permitted()
1130 return pte_access_permitted(pmd_pte(pmd), write); in pmd_access_permitted()
1137 extern pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot);
1139 pmd_t *pmdp, pmd_t pmd);
1144 unsigned long addr, pmd_t *pmd) in update_mmu_cache_pmd() argument
1190 * returns true for pmd migration entries, THP, devmap, hugetlb
1193 static inline int pmd_large(pmd_t pmd) in pmd_large() argument
1195 return !!(pmd_raw(pmd) & cpu_to_be64(_PAGE_PTE)); in pmd_large()
1246 * Only returns true for a THP. False for pmd migration entry.
1248 * in between a thp split. While splitting THP, we mark the pmd
1250 * address. A pmd_trans_huge() check against a pmd entry during that time
1256 static inline int pmd_trans_huge(pmd_t pmd) in pmd_trans_huge() argument
1258 if (!pmd_present(pmd)) in pmd_trans_huge()
1262 return radix__pmd_trans_huge(pmd); in pmd_trans_huge()
1263 return hash__pmd_trans_huge(pmd); in pmd_trans_huge()
1294 static inline pmd_t __pmd_mkhuge(pmd_t pmd) in __pmd_mkhuge() argument
1297 return radix__pmd_mkhuge(pmd); in __pmd_mkhuge()
1298 return hash__pmd_mkhuge(pmd); in __pmd_mkhuge()
1310 * pfn_pmd return a pmd_t that can be used as pmd pte entry.
1312 static inline pmd_t pmd_mkhuge(pmd_t pmd) in pmd_mkhuge() argument
1316 WARN_ON((pmd_raw(pmd) & cpu_to_be64(_PAGE_PTE)) == 0); in pmd_mkhuge()
1318 WARN_ON((pmd_raw(pmd) & cpu_to_be64(_PAGE_PTE | H_PAGE_THP_HUGE)) != in pmd_mkhuge()
1321 return pmd; in pmd_mkhuge()
1432 static inline pmd_t pmd_mkdevmap(pmd_t pmd) in pmd_mkdevmap() argument
1435 return radix__pmd_mkdevmap(pmd); in pmd_mkdevmap()
1436 return hash__pmd_mkdevmap(pmd); in pmd_mkdevmap()
1447 static inline int pmd_devmap(pmd_t pmd) in pmd_devmap() argument
1449 return pte_devmap(pmd_pte(pmd)); in pmd_devmap()
1487 static inline bool pmd_is_leaf(pmd_t pmd) in pmd_is_leaf() argument
1489 return !!(pmd_raw(pmd) & cpu_to_be64(_PAGE_PTE)); in pmd_is_leaf()