mm: introduce mm_[p4d|pud|pmd]_folded
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 15 Oct 2018 08:25:57 +0000 (10:25 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 2 Nov 2018 07:31:53 +0000 (08:31 +0100)
Add three architecture overrideable functions to test if the
p4d, pud, or pmd layer of a page table is folded or not.

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
include/asm-generic/pgtable.h

index 88ebc6102c7cc4a2e8c8380d483192b2272e6efe..15fd0277ffa69f025fbfa3509ff4b0b1db737113 100644 (file)
@@ -1127,4 +1127,20 @@ static inline bool arch_has_pfn_modify_check(void)
 #endif
 #endif
 
+/*
+ * On some architectures it depends on the mm if the p4d/pud or pmd
+ * layer of the page table hierarchy is folded or not.
+ */
+#ifndef mm_p4d_folded
+#define mm_p4d_folded(mm)      __is_defined(__PAGETABLE_P4D_FOLDED)
+#endif
+
+#ifndef mm_pud_folded
+#define mm_pud_folded(mm)      __is_defined(__PAGETABLE_PUD_FOLDED)
+#endif
+
+#ifndef mm_pmd_folded
+#define mm_pmd_folded(mm)      __is_defined(__PAGETABLE_PMD_FOLDED)
+#endif
+
 #endif /* _ASM_GENERIC_PGTABLE_H */