Skip to content

Commit 69660fd

Browse files
djbwtorvalds
authored andcommitted
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 <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 6d8113c commit 69660fd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

arch/x86/include/asm/pgtable_types.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
#define _PAGE_BIT_CPA_TEST _PAGE_BIT_SOFTW1
2525
#define _PAGE_BIT_HIDDEN _PAGE_BIT_SOFTW3 /* hidden by kmemcheck */
2626
#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 */
2830

2931
/* If _PAGE_BIT_PRESENT is clear, we use these: */
3032
/* - if the user mapped it with PROT_NONE; pte_present gives true */
@@ -83,8 +85,11 @@
8385

8486
#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
8587
#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
8690
#else
8791
#define _PAGE_NX (_AT(pteval_t, 0))
92+
#define _PAGE_DEVMAP (_AT(pteval_t, 0))
8893
#endif
8994

9095
#define _PAGE_PROTNONE (_AT(pteval_t, 1) << _PAGE_BIT_PROTNONE)

0 commit comments

Comments
 (0)