From: Ma Wupeng mawupeng1@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I96IZH
--------------------------------
Use subsequent bits to improve future compatibility which avoid conflicts during backport.
Fixes: 5c5063ac8584 ("arm64: mm: Introduce VM_PBHA_BIT0 to enable pbha bit0 for single vma") Signed-off-by: Ma Wupeng mawupeng1@huawei.com --- arch/arm64/include/uapi/asm/mman.h | 2 +- include/linux/mm.h | 4 +++- include/uapi/asm-generic/mman-common.h | 2 +- tools/include/uapi/asm-generic/mman-common.h | 1 + 4 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/include/uapi/asm/mman.h b/arch/arm64/include/uapi/asm/mman.h index af6ffde748f2..07e6f340a2f3 100644 --- a/arch/arm64/include/uapi/asm/mman.h +++ b/arch/arm64/include/uapi/asm/mman.h @@ -6,6 +6,6 @@
#define PROT_BTI 0x10 /* BTI guarded page */ #define PROT_MTE 0x20 /* Normal Tagged mapping */ -#define PROT_PBHA_BIT0 0x40 /* PBHA 59 bit */ +#define PROT_PBHA_BIT0 0x1000 /* PBHA 59 bit */
#endif /* ! _UAPI__ASM_MMAN_H */ diff --git a/include/linux/mm.h b/include/linux/mm.h index 2ad509486cad..096ee3c57da3 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -340,11 +340,13 @@ extern unsigned int kobjsize(const void *objp); #define VM_HIGH_ARCH_BIT_2 34 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_BIT_3 35 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_BIT_4 36 /* bit only usable on 64-bit architectures */ +#define VM_HIGH_ARCH_BIT_7 39 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_0 BIT(VM_HIGH_ARCH_BIT_0) #define VM_HIGH_ARCH_1 BIT(VM_HIGH_ARCH_BIT_1) #define VM_HIGH_ARCH_2 BIT(VM_HIGH_ARCH_BIT_2) #define VM_HIGH_ARCH_3 BIT(VM_HIGH_ARCH_BIT_3) #define VM_HIGH_ARCH_4 BIT(VM_HIGH_ARCH_BIT_4) +#define VM_HIGH_ARCH_7 BIT(VM_HIGH_ARCH_BIT_7) #endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */
#ifdef CONFIG_ARCH_HAS_PKEYS @@ -393,7 +395,7 @@ extern unsigned int kobjsize(const void *objp); #endif
#if defined(CONFIG_ARM64_PBHA) -# define VM_PBHA_BIT0 VM_HIGH_ARCH_2 /* Page Base Hardware Attributes 4 bit*/ +# define VM_PBHA_BIT0 VM_HIGH_ARCH_7 /* Page Base Hardware Attributes 4 bit*/ #else # define VM_PBHA_BIT0 VM_NONE #endif diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h index 4d23e72a2603..f32e6b3775ea 100644 --- a/include/uapi/asm-generic/mman-common.h +++ b/include/uapi/asm-generic/mman-common.h @@ -13,7 +13,7 @@ #define PROT_SEM 0x8 /* page may be used for atomic ops */ /* 0x10 reserved for arch-specific use */ /* 0x20 reserved for arch-specific use */ -/* 0x40 reserved for arch-specific use */ +/* 0x1000 reserved for arch-specific use */ #define PROT_NONE 0x0 /* page can not be accessed */ #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ diff --git a/tools/include/uapi/asm-generic/mman-common.h b/tools/include/uapi/asm-generic/mman-common.h index f94f65d429be..46f6dd362b53 100644 --- a/tools/include/uapi/asm-generic/mman-common.h +++ b/tools/include/uapi/asm-generic/mman-common.h @@ -13,6 +13,7 @@ #define PROT_SEM 0x8 /* page may be used for atomic ops */ /* 0x10 reserved for arch-specific use */ /* 0x20 reserved for arch-specific use */ +/* 0x1000 reserved for arch-specific use */ #define PROT_NONE 0x0 /* page can not be accessed */ #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */