Lines Matching full:pmd

46  * We need to mark a pmd pte invalid while splitting. We can do that by clearing
177 /* pmd table use page table fragments */
238 /* Bits to mask out from a PMD to get to the PTE page */
240 /* Bits to mask out from a PUD to get to the PMD page */
713 * This is potentially called with a pmd as the argument, in which case it's not
758 #define __pmd_to_swp_entry(pmd) (__pte_to_swp_entry(pmd_pte(pmd))) argument
915 static inline int pmd_none(pmd_t pmd) in pmd_none() argument
917 return !pmd_raw(pmd); in pmd_none()
920 static inline int pmd_present(pmd_t pmd) in pmd_present() argument
923 * A pmd is considerent present if _PAGE_PRESENT is set. in pmd_present()
924 * We also need to consider the pmd present which is marked in pmd_present()
928 if (pmd_raw(pmd) & cpu_to_be64(_PAGE_PRESENT | _PAGE_INVALID)) in pmd_present()
934 static inline int pmd_is_serializing(pmd_t pmd) in pmd_is_serializing() argument
937 * If the pmd is undergoing a split, the _PAGE_PRESENT bit is clear in pmd_is_serializing()
940 * This condition may also occur when flushing a pmd while flushing in pmd_is_serializing()
944 if ((pmd_raw(pmd) & cpu_to_be64(_PAGE_PRESENT | _PAGE_INVALID)) == in pmd_is_serializing()
951 static inline int pmd_bad(pmd_t pmd) in pmd_bad() argument
954 return radix__pmd_bad(pmd); in pmd_bad()
955 return hash__pmd_bad(pmd); in pmd_bad()
981 extern struct page *pmd_page(pmd_t pmd);
1070 pr_err("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
1119 static inline pte_t pmd_pte(pmd_t pmd) in pmd_pte() argument
1121 return __pte_raw(pmd_raw(pmd)); in pmd_pte()
1129 static inline pte_t *pmdp_ptep(pmd_t *pmd) in pmdp_ptep() argument
1131 return (pte_t *)pmd; in pmdp_ptep()
1133 #define pmd_pfn(pmd) pte_pfn(pmd_pte(pmd)) argument
1134 #define pmd_dirty(pmd) pte_dirty(pmd_pte(pmd)) argument
1135 #define pmd_young(pmd) pte_young(pmd_pte(pmd)) argument
1136 #define pmd_mkold(pmd) pte_pmd(pte_mkold(pmd_pte(pmd))) argument
1137 #define pmd_wrprotect(pmd) pte_pmd(pte_wrprotect(pmd_pte(pmd))) argument
1138 #define pmd_mkdirty(pmd) pte_pmd(pte_mkdirty(pmd_pte(pmd))) argument
1139 #define pmd_mkclean(pmd) pte_pmd(pte_mkclean(pmd_pte(pmd))) argument
1140 #define pmd_mkyoung(pmd) pte_pmd(pte_mkyoung(pmd_pte(pmd))) argument
1141 #define pmd_mkwrite(pmd) pte_pmd(pte_mkwrite(pmd_pte(pmd))) argument
1142 #define pmd_mk_savedwrite(pmd) pte_pmd(pte_mk_savedwrite(pmd_pte(pmd))) argument
1143 #define pmd_clear_savedwrite(pmd) pte_pmd(pte_clear_savedwrite(pmd_pte(pmd))) argument
1146 #define pmd_soft_dirty(pmd) pte_soft_dirty(pmd_pte(pmd)) argument
1147 #define pmd_mksoft_dirty(pmd) pte_pmd(pte_mksoft_dirty(pmd_pte(pmd))) argument
1148 #define pmd_clear_soft_dirty(pmd) pte_pmd(pte_clear_soft_dirty(pmd_pte(pmd))) argument
1151 #define pmd_swp_mksoft_dirty(pmd) pte_pmd(pte_swp_mksoft_dirty(pmd_pte(pmd))) argument
1152 #define pmd_swp_soft_dirty(pmd) pte_swp_soft_dirty(pmd_pte(pmd)) argument
1153 #define pmd_swp_clear_soft_dirty(pmd) pte_pmd(pte_swp_clear_soft_dirty(pmd_pte(pmd))) argument
1158 static inline int pmd_protnone(pmd_t pmd) in pmd_protnone() argument
1160 return pte_protnone(pmd_pte(pmd)); in pmd_protnone()
1164 #define pmd_write(pmd) pte_write(pmd_pte(pmd)) argument
1165 #define __pmd_write(pmd) __pte_write(pmd_pte(pmd)) argument
1166 #define pmd_savedwrite(pmd) pte_savedwrite(pmd_pte(pmd)) argument
1169 static inline bool pmd_access_permitted(pmd_t pmd, bool write) in pmd_access_permitted() argument
1181 if (pmd_is_serializing(pmd)) in pmd_access_permitted()
1184 return pte_access_permitted(pmd_pte(pmd), write); in pmd_access_permitted()
1190 extern pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot);
1192 pmd_t *pmdp, pmd_t pmd);
1194 unsigned long addr, pmd_t *pmd) in update_mmu_cache_pmd() argument
1217 * returns true for pmd migration entries, THP, devmap, hugetlb
1220 static inline int pmd_large(pmd_t pmd) in pmd_large() argument
1222 return !!(pmd_raw(pmd) & cpu_to_be64(_PAGE_PTE)); in pmd_large()
1251 * Only returns true for a THP. False for pmd migration entry.
1253 * in between a thp split. While splitting THP, we mark the pmd
1255 * address. A pmd_trans_huge() check against a pmd entry during that time
1261 static inline int pmd_trans_huge(pmd_t pmd) in pmd_trans_huge() argument
1263 if (!pmd_present(pmd)) in pmd_trans_huge()
1267 return radix__pmd_trans_huge(pmd); in pmd_trans_huge()
1268 return hash__pmd_trans_huge(pmd); in pmd_trans_huge()
1279 static inline pmd_t __pmd_mkhuge(pmd_t pmd) in __pmd_mkhuge() argument
1282 return radix__pmd_mkhuge(pmd); in __pmd_mkhuge()
1283 return hash__pmd_mkhuge(pmd); in __pmd_mkhuge()
1287 * pfn_pmd return a pmd_t that can be used as pmd pte entry.
1289 static inline pmd_t pmd_mkhuge(pmd_t pmd) in pmd_mkhuge() argument
1293 WARN_ON((pmd_raw(pmd) & cpu_to_be64(_PAGE_PTE)) == 0); in pmd_mkhuge()
1295 WARN_ON((pmd_raw(pmd) & cpu_to_be64(_PAGE_PTE | H_PAGE_THP_HUGE)) != in pmd_mkhuge()
1298 return pmd; in pmd_mkhuge()
1374 static inline pmd_t pmd_mkdevmap(pmd_t pmd) in pmd_mkdevmap() argument
1377 return radix__pmd_mkdevmap(pmd); in pmd_mkdevmap()
1378 return hash__pmd_mkdevmap(pmd); in pmd_mkdevmap()
1381 static inline int pmd_devmap(pmd_t pmd) in pmd_devmap() argument
1383 return pte_devmap(pmd_pte(pmd)); in pmd_devmap()
1431 static inline bool pmd_is_leaf(pmd_t pmd) in pmd_is_leaf() argument
1433 return !!(pmd_raw(pmd) & cpu_to_be64(_PAGE_PTE)); in pmd_is_leaf()