From: Ma Wupeng mawupeng1@huawei.com
Use corrent pte val in arch_vm_get_page_prot. Use subsequent bits to improve future compatibility for pbha.
Ma Wupeng (2): arm64: mm: Use corrent pte val in arch_vm_get_page_prot arm64: mm: Use subsequent bits to improve future compatibility for pbha
arch/arm64/include/asm/mman.h | 2 +- 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 + 5 files changed, 7 insertions(+), 4 deletions(-)
From: Ma Wupeng mawupeng1@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I96IZH
--------------------------------
During arch_vm_get_page_prot, vm_page_prot is init based on vma flags, pte bit not vm_prot should be used here. Fix this problem by replacing vm_prot with pte bit.
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/asm/mman.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/mman.h b/arch/arm64/include/asm/mman.h index 3c96193953e9..40317da36ced 100644 --- a/arch/arm64/include/asm/mman.h +++ b/arch/arm64/include/asm/mman.h @@ -60,7 +60,7 @@ static inline pgprot_t arch_vm_get_page_prot(unsigned long vm_flags) prot |= PTE_ATTRINDX(MT_NORMAL_TAGGED);
if (vm_flags & VM_PBHA_BIT0) - prot |= PROT_PBHA_BIT0; /* select PBHA BIT 0 for pbha */ + prot |= PTE_PBHA0;
return __pgprot(prot); }
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 */
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/5044 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/G...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/5044 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/G...