aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-01-15 19:56:37 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-15 20:56:32 -0500
commit69660fd797c3e52f7f20478a27687f293d1a41be (patch)
tree10dd8c4c32b756c4bf694f463fddaa226f0c466d /arch/x86/include
parent6d8113c75a72f80164cc68b1af45f1608f9a36c6 (diff)
x86, mm: introduce _PAGE_DEVMAP
_PAGE_DEVMAP is a hardware-unused pte bit that will later be used in the get_user_pages() path to identify pfns backed by the dynamic allocation established by devm_memremap_pages. Upon seeing that bit the gup path will lookup and pin the allocation while the pages are in use. Since the _PAGE_DEVMAP bit is > 32 it must be cast to u64 instead of a pteval_t to allow pmd_flags() usage in the realmode boot code to build. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/pgtable_types.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index d1b76f88ccd1..04c27a013165 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -24,7 +24,9 @@
24#define _PAGE_BIT_CPA_TEST _PAGE_BIT_SOFTW1 24#define _PAGE_BIT_CPA_TEST _PAGE_BIT_SOFTW1
25#define _PAGE_BIT_HIDDEN _PAGE_BIT_SOFTW3 /* hidden by kmemcheck */ 25#define _PAGE_BIT_HIDDEN _PAGE_BIT_SOFTW3 /* hidden by kmemcheck */
26#define _PAGE_BIT_SOFT_DIRTY _PAGE_BIT_SOFTW3 /* software dirty tracking */ 26#define _PAGE_BIT_SOFT_DIRTY _PAGE_BIT_SOFTW3 /* software dirty tracking */
27#define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */ 27#define _PAGE_BIT_SOFTW4 58 /* available for programmer */
28#define _PAGE_BIT_DEVMAP _PAGE_BIT_SOFTW4
29#define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */
28 30
29/* If _PAGE_BIT_PRESENT is clear, we use these: */ 31/* If _PAGE_BIT_PRESENT is clear, we use these: */
30/* - if the user mapped it with PROT_NONE; pte_present gives true */ 32/* - if the user mapped it with PROT_NONE; pte_present gives true */
@@ -83,8 +85,11 @@
83 85
84#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) 86#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
85#define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_NX) 87#define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_NX)
88#define _PAGE_DEVMAP (_AT(u64, 1) << _PAGE_BIT_DEVMAP)
89#define __HAVE_ARCH_PTE_DEVMAP
86#else 90#else
87#define _PAGE_NX (_AT(pteval_t, 0)) 91#define _PAGE_NX (_AT(pteval_t, 0))
92#define _PAGE_DEVMAP (_AT(pteval_t, 0))
88#endif 93#endif
89 94
90#define _PAGE_PROTNONE (_AT(pteval_t, 1) << _PAGE_BIT_PROTNONE) 95#define _PAGE_PROTNONE (_AT(pteval_t, 1) << _PAGE_BIT_PROTNONE)