aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/pgtable_64.h13
-rw-r--r--arch/x86/include/asm/pgtable_types.h2
-rw-r--r--include/asm-generic/pgtable.h11
3 files changed, 26 insertions, 0 deletions
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index f86da20347f2..6dffd4c551cc 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -168,6 +168,19 @@ extern void cleanup_highmap(void);
168#define kc_offset_to_vaddr(o) ((o) | ~__VIRTUAL_MASK) 168#define kc_offset_to_vaddr(o) ((o) | ~__VIRTUAL_MASK)
169 169
170#define __HAVE_ARCH_PTE_SAME 170#define __HAVE_ARCH_PTE_SAME
171
172#ifdef CONFIG_TRANSPARENT_HUGEPAGE
173static inline int pmd_trans_splitting(pmd_t pmd)
174{
175 return pmd_val(pmd) & _PAGE_SPLITTING;
176}
177
178static inline int pmd_trans_huge(pmd_t pmd)
179{
180 return pmd_val(pmd) & _PAGE_PSE;
181}
182#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
183
171#endif /* !__ASSEMBLY__ */ 184#endif /* !__ASSEMBLY__ */
172 185
173#endif /* _ASM_X86_PGTABLE_64_H */ 186#endif /* _ASM_X86_PGTABLE_64_H */
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index d1f4a760be23..a81a6bfc1437 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -22,6 +22,7 @@
22#define _PAGE_BIT_PAT_LARGE 12 /* On 2MB or 1GB pages */ 22#define _PAGE_BIT_PAT_LARGE 12 /* On 2MB or 1GB pages */
23#define _PAGE_BIT_SPECIAL _PAGE_BIT_UNUSED1 23#define _PAGE_BIT_SPECIAL _PAGE_BIT_UNUSED1
24#define _PAGE_BIT_CPA_TEST _PAGE_BIT_UNUSED1 24#define _PAGE_BIT_CPA_TEST _PAGE_BIT_UNUSED1
25#define _PAGE_BIT_SPLITTING _PAGE_BIT_UNUSED1 /* only valid on a PSE pmd */
25#define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */ 26#define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */
26 27
27/* If _PAGE_BIT_PRESENT is clear, we use these: */ 28/* If _PAGE_BIT_PRESENT is clear, we use these: */
@@ -45,6 +46,7 @@
45#define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE) 46#define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE)
46#define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL) 47#define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL)
47#define _PAGE_CPA_TEST (_AT(pteval_t, 1) << _PAGE_BIT_CPA_TEST) 48#define _PAGE_CPA_TEST (_AT(pteval_t, 1) << _PAGE_BIT_CPA_TEST)
49#define _PAGE_SPLITTING (_AT(pteval_t, 1) << _PAGE_BIT_SPLITTING)
48#define __HAVE_ARCH_PTE_SPECIAL 50#define __HAVE_ARCH_PTE_SPECIAL
49 51
50#ifdef CONFIG_KMEMCHECK 52#ifdef CONFIG_KMEMCHECK
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 6f3c6ae4fe03..0ab2cd27c60f 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -348,6 +348,17 @@ extern void untrack_pfn_vma(struct vm_area_struct *vma, unsigned long pfn,
348 unsigned long size); 348 unsigned long size);
349#endif 349#endif
350 350
351#ifndef CONFIG_TRANSPARENT_HUGEPAGE
352static inline int pmd_trans_huge(pmd_t pmd)
353{
354 return 0;
355}
356static inline int pmd_trans_splitting(pmd_t pmd)
357{
358 return 0;
359}
360#endif
361
351#endif /* !__ASSEMBLY__ */ 362#endif /* !__ASSEMBLY__ */
352 363
353#endif /* _ASM_GENERIC_PGTABLE_H */ 364#endif /* _ASM_GENERIC_PGTABLE_H */