mm, x86, powerpc: Enhancements to Memory Protection Keys.
Subsystems (6)
v11 cover mm, x86, powerpc: Enhancements to Memory Protection Keys.
This patch series provides arch-neutral enhancements to enable memory-keys on new architecutes, and the corresponding changes in x86 and powerpc specific code to support that.
a) Provides ability to support upto 32 keys. PowerPC can handle 32 keys and hence needs this.
b) Arch-neutral code; and not the arch-specific code, determines the format of the string, that displays the key for each vma in smaps.
PowerPC implementation of memory-keys is now in powerpc/next tree.
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?h=next&id=92e3da3cf193fd27996909956c12a23c0333da44
History:
-------
version v11:
(1) code that displays key in smaps is not any more defined under CONFIG_ARCH_HAS_PKEYS.
- Comment by Eric W. Biederman and Michal Hocko
(2) merged two patches that implemented (1).
- comment by Michal Hocko
version prior to v11:
(1) used one additional bit from VM_HIGH_ARCH_* to support 32 keys.
- Suggestion by Dave Hansen.
(2) powerpc specific changes to support memory keys.
Ram Pai (3):
mm, powerpc, x86: define VM_PKEY_BITx bits if CONFIG_ARCH_HAS_PKEYS
is enabled
mm, powerpc, x86: introduce an additional vma bit for powerpc pkey mm, x86: display pkey in smaps only if arch supports pkeys
arch/x86/include/asm/pkeys.h | 1 + arch/x86/kernel/fpu/xstate.c | 5 +++++ arch/x86/kernel/setup.c | 8 -------- fs/proc/task_mmu.c | 14 +++++++------- include/linux/mm.h | 12 +++++++----- include/linux/pkeys.h | 6 ++++++ 6 files changed, 26 insertions(+), 20 deletions(-)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH v11 1/3 mm, powerpc, x86: define VM_PKEY_BITx bits if CONFIG_ARCH_HAS_PKEYS is enabled
VM_PKEY_BITx are defined only if CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS is enabled. Powerpc also needs these bits. Hence lets define the VM_PKEY_BITx bits for any architecture that enables CONFIG_ARCH_HAS_PKEYS.
--- fs/proc/task_mmu.c | 4 ++-- include/linux/mm.h | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-)
fs/proc/task_mmu.c +2 -2
@@ -674,13 +674,13 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) [ilog2(VM_MERGEABLE)] = "mg", [ilog2(VM_UFFD_MISSING)]= "um", [ilog2 (VM_UFFD_WP )] ="uw" , -#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS +#ifdef CONFIG_ARCH_HAS_PKEYS/* These come out via ProtectionKey: */ [ilog2(VM_PKEY_BIT0)] = "", [ilog2(VM_PKEY_BIT1)] = "", [ilog2(VM_PKEY_BIT2)] = "", [ilog2(VM_PKEY_BIT3)] = "", -#endif +#endif /* CONFIG_ARCH_HAS_PKEYS */ };size_t i;
include/linux/mm.h +5 -4
@@ -228,15 +228,16 @@ extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *,#define VM_HIGH_ARCH_4 BIT(VM_HIGH_ARCH_BIT_4)#endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */ -#if defined(CONFIG_X86 ) -# define VM_PAT VM_ARCH_1/* PAT reserves whole VMA at once (x86) */ -#if defined (CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS ) +#ifdef CONFIG_ARCH_HAS_PKEYS # define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0# define VM_PKEY_BIT0 VM_HIGH_ARCH_0/* A protection key is a 4-bit value */ # define VM_PKEY_BIT1 VM_HIGH_ARCH_1# define VM_PKEY_BIT2 VM_HIGH_ARCH_2# define VM_PKEY_BIT3 VM_HIGH_ARCH_3 -#endif +#endif /* CONFIG_ARCH_HAS_PKEYS */ + +#if defined(CONFIG_X86 ) +# define VM_PAT VM_ARCH_1/* PAT reserves whole VMA at once (x86) */ #elif defined(CONFIG_PPC )# define VM_SAO VM_ARCH_1/* Strong Access Ordering (powerpc) */ #elif defined(CONFIG_PARISC )
Signature · 1 line
1.7.1
PATCH v11 2/3 mm, powerpc, x86: introduce an additional vma bit for powerpc pkey
In reply to Ram PaiCurrently only 4bits are allocated in the vma flags to hold 16 keys. This is sufficient for x86. PowerPC supports 32 keys, which needs 5bits. This patch allocates an additional bit.
--- fs/proc/task_mmu.c | 1 + include/linux/mm.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletions(-)
fs/proc/task_mmu.c +1 -0
@@ -680,6 +680,7 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) [ilog2(VM_PKEY_BIT1)] = "", [ilog2(VM_PKEY_BIT2)] = "", [ilog2(VM_PKEY_BIT3)] = "", + [ilog2(VM_PKEY_BIT4)] = "",#endif /* CONFIG_ARCH_HAS_PKEYS */ };size_t i;
include/linux/mm.h +2 -1
@@ -231,9 +231,10 @@ extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *,#ifdef CONFIG_ARCH_HAS_PKEYS # define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0# define VM_PKEY_BIT0 VM_HIGH_ARCH_0/* A protection key is a 4-bit value */ -# define VM_PKEY_BIT1 VM_HIGH_ARCH_1 +# define VM_PKEY_BIT1 VM_HIGH_ARCH_1/* on x86 and 5-bit value on ppc64 */ # define VM_PKEY_BIT2 VM_HIGH_ARCH_2# define VM_PKEY_BIT3 VM_HIGH_ARCH_3 +# define VM_PKEY_BIT4 VM_HIGH_ARCH_4#endif /* CONFIG_ARCH_HAS_PKEYS */ #if defined(CONFIG_X86 )
Signature · 7 lines
1.7.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH v11 3/3 mm, x86: display pkey in smaps only if arch supports pkeys
In reply to Ram PaiCurrently the architecture specific code is expected to display the protection keys in smap for a given vma. This can lead to redundant code and possibly to divergent formats in which the key gets displayed.
This patch changes the implementation. It displays the pkey only if the architecture support pkeys, i.e arch_pkeys_enabled() returns true. This patch provides x86 implementation for arch_pkeys_enabled().
x86 arch_show_smap() function is not needed anymore. Deleting it.
--- arch/x86/include/asm/pkeys.h | 1 + arch/x86/kernel/fpu/xstate.c | 5 +++++ arch/x86/kernel/setup.c | 8 -------- fs/proc/task_mmu.c | 9 ++++----- include/linux/pkeys.h | 6 ++++++ 5 files changed, 16 insertions(+), 13 deletions(-)
arch/x86/include/asm/pkeys.h +1 -0
@@ -6,6 +6,7 @@extern int arch_set_user_pkey_access (struct task_struct *tsk,int pkey,unsigned long init_val); +extern bool arch_pkeys_enabled (void );/* * Try to dedicate one of the protection keys to be used as an
arch/x86/kernel/fpu/xstate.c +5 -0
@@ -945,6 +945,11 @@ int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, return 0; } + +bool arch_pkeys_enabled (void ) +{ +return boot_cpu_has (X86_FEATURE_OSPKE ); +}#endif /* ! CONFIG_ARCH_HAS_PKEYS */ /*
arch/x86/kernel/setup.c +0 -8
@@ -1326,11 +1326,3 @@ static int __init register_kernel_offset_dumper(void)return 0 ; }__initcall (register_kernel_offset_dumper); - -void arch_show_smap (struct seq_file *m,struct vm_area_struct *vma) -{ -if (!boot_cpu_has (X86_FEATURE_OSPKE )) -return ; - -seq_printf (m,"ProtectionKey: %8u\n" ,vma_pkey (vma)); -}
fs/proc/task_mmu.c +4 -5
@@ -18,6 +18,7 @@#include <linux/page_idle.h> #include <linux/shmem_fs.h> #include <linux/uaccess.h> +#include <linux/pkeys.h> #include <asm/elf.h> #include <asm/tlb.h>
@@ -728,10 +729,6 @@ static int smaps_hugetlb_range(pte_t *pte, unsigned long hmask, }#endif /* HUGETLB_PAGE */ -void __weak arch_show_smap (struct seq_file *m,struct vm_area_struct *vma) -{ -} -static int show_smap (struct seq_file *m,void *v,int is_pid) {struct proc_maps_private *priv = m->private;
@@ -851,9 +848,11 @@ static int show_smap(struct seq_file *m, void *v, int is_pid) (unsigned long)(mss->pss >> (10 + PSS_SHIFT)));if (!rollup_mode) { -arch_show_smap (m, vma); +if (arch_pkeys_enabled ()) +seq_printf (m,"ProtectionKey: %8u\n" ,vma_pkey (vma));show_smap_vma_flags (m, vma); } +m_cache_vma (m, vma);return ret; }
include/linux/pkeys.h +6 -0
@@ -13,6 +13,7 @@#define arch_override_mprotect_pkey (vma, prot, pkey) (0)#define PKEY_DEDICATED_EXECUTE_ONLY 0#define ARCH_VM_PKEY_FLAGS 0 +#define vma_pkey (vma) 0static inline bool mm_pkey_is_allocated (struct mm_struct *mm,int pkey) {
@@ -35,6 +36,11 @@ static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,return 0 ; } +static inline bool arch_pkeys_enabled (void ) +{ +return false; +} +static inline void copy_init_pkru_to_fpregs (void ) { }
Signature · 7 lines
1.7.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH v11 3/3] mm, x86: display pkey in smaps only if arch supports pkeys
Quoted 5 lines · Ram Pai
Currently the architecture specific code is expected to display the protection keys in smap for a given vma. This can lead to redundant code and possibly to divergent formats in which the key gets displayed.
Quoted 7 lines
This patch changes the implementation. It displays the pkey only if the architecture support pkeys, i.e
arch_pkeys_enabled()returns true. This patch provides x86 implementation forarch_pkeys_enabled().x86
arch_show_smap()function is not needed anymore. Deleting it.
Thanks for reworking this patch. Looks good to me.
Quoted 1 line
Signed-off-by Ram Pai <[email protected]>
Quoted 114 lines
--- arch/x86/include/asm/pkeys.h | 1 + arch/x86/kernel/fpu/xstate.c | 5 +++++ arch/x86/kernel/setup.c | 8 -------- fs/proc/task_mmu.c | 9 ++++----- include/linux/pkeys.h | 6 ++++++ 5 files changed, 16 insertions(+), 13 deletions(-)arch/x86/include/asm/pkeys.h +1
-0@@ -6,6 +6,7 @@extern int arch_set_user_pkey_access (struct task_struct *tsk,int pkey,unsigned long init_val); +extern bool arch_pkeys_enabled (void );/* * Try to dedicate one of the protection keys to be used as an arch/x86/kernel/fpu/xstate.c +5
-0@@ -945,6 +945,11 @@ int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, return 0; } + +bool arch_pkeys_enabled (void ) +{ +return boot_cpu_has (X86_FEATURE_OSPKE ); +}#endif /* ! CONFIG_ARCH_HAS_PKEYS */ /* arch/x86/kernel/setup.c +0
-8@@ -1326,11 +1326,3 @@ static int __init register_kernel_offset_dumper(void)return 0 ; }__initcall (register_kernel_offset_dumper); - -void arch_show_smap (struct seq_file *m,struct vm_area_struct *vma) -{ -if (!boot_cpu_has (X86_FEATURE_OSPKE )) -return ; - -seq_printf (m,"ProtectionKey: %8u\n" ,vma_pkey (vma)); -}fs/proc/task_mmu.c +4
-5@@ -18,6 +18,7 @@#include <linux/page_idle.h> #include <linux/shmem_fs.h> #include <linux/uaccess.h> +#include <linux/pkeys.h> #include <asm/elf.h> #include <asm/tlb.h> @@ -728,10 +729,6 @@ static int smaps_hugetlb_range(pte_t *pte, unsigned long hmask, }#endif /* HUGETLB_PAGE */ -void __weak arch_show_smap (struct seq_file *m,struct vm_area_struct *vma) -{ -} -static int show_smap (struct seq_file *m,void *v,int is_pid) {struct proc_maps_private *priv = m->private;@@ -851,9 +848,11 @@ static int show_smap(struct seq_file *m, void *v, int is_pid) (unsigned long)(mss->pss >> (10 + PSS_SHIFT)));if (!rollup_mode) { -arch_show_smap (m, vma); +if (arch_pkeys_enabled ()) +seq_printf (m,"ProtectionKey: %8u\n" ,vma_pkey (vma));show_smap_vma_flags (m, vma); } +m_cache_vma (m, vma);return ret; }include/linux/pkeys.h +6
-0@@ -13,6 +13,7 @@#define arch_override_mprotect_pkey (vma, prot, pkey) (0)#define PKEY_DEDICATED_EXECUTE_ONLY 0#define ARCH_VM_PKEY_FLAGS 0 +#define vma_pkey (vma) 0static inline bool mm_pkey_is_allocated (struct mm_struct *mm,int pkey) {@@ -35,6 +36,11 @@ static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,return 0 ; } +static inline bool arch_pkeys_enabled (void ) +{ +return false; +} +static inline void copy_init_pkru_to_fpregs (void ) { }Signature · 1 line
1.7.1
Signature · 2 lines
Michal Hocko SUSE Labs
kbuild test robot
build botRe: [PATCH v11 3/3] mm, x86: display pkey in smaps only if arch supports pkeys
In reply to Ram PaiThank you for the patch! Yet something to improve:
Hi Ram,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v4.15 next-20180201]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Ram-Pai/mm-x86-powerpc-Enhancements-to-Memory-Protection-Keys/20180202-120004
config: x86_64-randconfig-x005-201804 (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025 reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 All error/warnings (new ones prefixed by >>):
In file included from arch/x86/include/asm/mmu_context.h:8:0,
from arch/x86/events/core.c:36:
>> include/linux/pkeys.h:16:23: error: expected identifier or '(' before numeric constant
#define vma_pkey(vma) 0
^
>> arch/x86/include/asm/mmu_context.h:298:19: note: in expansion of macro 'vma_pkey' static inline int vma_pkey(struct vm_area_struct *vma)
^~~~~~~~
vim +16 include/linux/pkeys.h
7
8 #ifdef CONFIG_ARCH_HAS_PKEYS
9 #include <asm/pkeys.h>
10 #else /* ! CONFIG_ARCH_HAS_PKEYS */
11 #define arch_max_pkey() (1)
12 #define execute_only_pkey(mm) (0)
13 #define arch_override_mprotect_pkey(vma, prot, pkey) (0)
14 #define PKEY_DEDICATED_EXECUTE_ONLY 0
15 #define ARCH_VM_PKEY_FLAGS 0
> 16 #define vma_pkey(vma) 0
17 ---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Re: [PATCH v11 3/3] mm, x86: display pkey in smaps only if arch supports pkeys
Quoted 28 lines · kbuild test robot
Hi Ram,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v4.15 next-20180201]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]url: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_0day-2Dci_linux_commits_Ram-2DPai_mm-2Dx86-2Dpowerpc-2DEnhancements-2Dto-2DMemory-2DProtection-2DKeys_20180202-2D120004&d=DwIBAg&c=jf_iaSHvJObTbx-siA1ZOg&r=m-UrKChQVkZtnPpjbF6YY99NbT8FBByQ-E-ygV8luxw&m=Fv3tEHet1bTUrDjOnzEhXvGM_4tGlkYhJHPBnWNWgVA&s=Z1W6CV2tfPmLYU8lVv1oDRl2cAyQA76KE2P064A2CQY&e=
config: x86_64-randconfig-x005-201804 (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025 reproduce:# save the attached .config to linux build tree make ARCH=x86_64All error/warnings (new ones prefixed by >>):
In file included from
arch/x86/include/asm/mmu_context.h:8:0,from arch/x86/events/core.c:36:Quoted 1 line
Quoted 1 line
include/linux/pkeys.h:16:23: error: expected identifier or '(' before numeric constant#define vma_pkey(vma) 0 ^Quoted 1 line
Quoted 1 line
arch/x86/include/asm/mmu_context.h:298:19: note: in expansion of macro 'vma_pkey'static inline int
vma_pkey(struct vm_area_struct *vma)
^~~~~~~~vim +16
include/linux/pkeys.h
Quoted 10 lines
7 8 #ifdef CONFIG_ARCH_HAS_PKEYS 9 #include <asm/pkeys.h> 10 #else /* ! CONFIG_ARCH_HAS_PKEYS */ 11 #define arch_max_pkey() (1) 12 #define execute_only_pkey(mm) (0) 13 #define arch_override_mprotect_pkey(vma, prot, pkey) (0) 14 #define PKEY_DEDICATED_EXECUTE_ONLY 0 15 #define ARCH_VM_PKEY_FLAGS 0Quoted 1 line
16 #define
vma_pkey(vma)0
Oops. Thanks for catching the issue. The following fix will resolve the error.
(quoted diff) +0 -0
b/arch/x86/include/asm/mmu_context.h
index 6d16d15..c1aeb19 100644
arch/x86/include/asm/mmu_context.h +0 -0
@@ -238,11 +238,6 @@ static inline int vma_pkey(struct vm_area_struct
*vma)
return (vma->vm_flags & vma_pkey_mask) >> VM_PKEY_SHIFT;
}-#else
-static inline int vma_pkey(struct vm_area_struct *vma) -{
- return 0;
-}
#endif
RP
Re: [PATCH v11 3/3] mm, x86: display pkey in smaps only if arch supports pkeys
Quoted 48 lines · Ram Pai
Quoted 28 lines · kbuild test robot
Hi Ram,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v4.15 next-20180201]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]url: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_0day-2Dci_linux_commits_Ram-2DPai_mm-2Dx86-2Dpowerpc-2DEnhancements-2Dto-2DMemory-2DProtection-2DKeys_20180202-2D120004&d=DwIBAg&c=jf_iaSHvJObTbx-siA1ZOg&r=m-UrKChQVkZtnPpjbF6YY99NbT8FBByQ-E-ygV8luxw&m=Fv3tEHet1bTUrDjOnzEhXvGM_4tGlkYhJHPBnWNWgVA&s=Z1W6CV2tfPmLYU8lVv1oDRl2cAyQA76KE2P064A2CQY&e=
config: x86_64-randconfig-x005-201804 (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025 reproduce:# save the attached .config to linux build tree make ARCH=x86_64All error/warnings (new ones prefixed by >>):
In file included from
arch/x86/include/asm/mmu_context.h:8:0,from arch/x86/events/core.c:36:Quoted 1 line
Quoted 1 line
include/linux/pkeys.h:16:23: error: expected identifier or '(' before numeric constant#define vma_pkey(vma) 0 ^Quoted 1 line
Quoted 1 line
arch/x86/include/asm/mmu_context.h:298:19: note: in expansion of macro 'vma_pkey'static inline int
vma_pkey(struct vm_area_struct *vma)
^~~~~~~~vim +16
include/linux/pkeys.hQuoted 10 lines
7 8 #ifdef CONFIG_ARCH_HAS_PKEYS 9 #include <asm/pkeys.h> 10 #else /* ! CONFIG_ARCH_HAS_PKEYS */ 11 #define arch_max_pkey() (1) 12 #define execute_only_pkey(mm) (0) 13 #define arch_override_mprotect_pkey(vma, prot, pkey) (0) 14 #define PKEY_DEDICATED_EXECUTE_ONLY 0 15 #define ARCH_VM_PKEY_FLAGS 0Quoted 1 line
16 #define
vma_pkey(vma)0Oops. Thanks for catching the issue. The following fix will resolve the error.
arch/x86/include/asm/mmu_context.h +0
-0
arch/x86/include/asm/mmu_context.h static inline int vma_pkey(struct vm_area_struct · line 242
Quoted 10 lines
arch/x86/include/asm/mmu_context.h +0
-5@@ -238,11 +238,6 @@ static inline int vma_pkey(struct vm_area_struct *vma) return (vma->vm_flags & vma_pkey_mask) >> VM_PKEY_SHIFT; } -#else -static inline int vma_pkey (struct vm_area_struct *vma) -{ -return 0 ; -}#endif
That's not working for me (i386_defconfig):
In file included from ../include/linux/pkeys.h:6:0,
from ../arch/x86/kernel/fpu/xstate.c:9:
../arch/x86/include/asm/mmu_context.h: In function ‘arch_vma_access_permitted’:
../arch/x86/include/asm/mmu_context.h:276:28: error: implicit declaration of function ‘vma_pkey’ [-Werror=implicit-function-declaration]
return __pkru_allows_pkey(vma_pkey(vma), write);
^~~~~~~~
In file included from ../include/linux/pkeys.h:6:0,
from ../fs/proc/task_mmu.c:21:
../arch/x86/include/asm/mmu_context.h: In function ‘arch_vma_access_permitted’:
../arch/x86/include/asm/mmu_context.h:276:28: error: implicit declaration of function ‘vma_pkey’ [-Werror=implicit-function-declaration]
return __pkru_allows_pkey(vma_pkey(vma), write);
^~~~~~~~
In file included from ../include/linux/pkeys.h:6:0,
from ../mm/mmap.c:46:
../arch/x86/include/asm/mmu_context.h: In function ‘arch_vma_access_permitted’:
../arch/x86/include/asm/mmu_context.h:276:28: error: implicit declaration of function ‘vma_pkey’ [-Werror=implicit-function-declaration]
return __pkru_allows_pkey(vma_pkey(vma), write);
^~~~~~~~
In file included from ../include/linux/pkeys.h:6:0,
from ../mm/mprotect.c:27:
../arch/x86/include/asm/mmu_context.h: In function ‘arch_vma_access_permitted’:
../arch/x86/include/asm/mmu_context.h:276:28: error: implicit declaration of function ‘vma_pkey’ [-Werror=implicit-function-declaration]
return __pkru_allows_pkey(vma_pkey(vma), write);
^~~~~~~~
In file included from ../include/linux/pkeys.h:6:0,
from ../arch/x86/kernel/fpu/core.c:15:
../arch/x86/include/asm/mmu_context.h: In function ‘arch_vma_access_permitted’:
../arch/x86/include/asm/mmu_context.h:276:28: error: implicit declaration of function ‘vma_pkey’ [-Werror=implicit-function-declaration]
return __pkru_allows_pkey(vma_pkey(vma), write);
^~~~~~~~cheers
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines · Ram Pai
This patch series provides arch-neutral enhancements to enable memory-keys on new architecutes, and the corresponding changes in x86 and powerpc specific code to support that.
a) Provides ability to support upto 32 keys. PowerPC can handle 32 keys and hence needs this.
Quoted 6 lines
b) Arch-neutral code; and not the arch-specific code, determines the format of the string, that displays the key for each vma in smaps.
PowerPC implementation of memory-keys is now in powerpc/next tree.
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?h=next&id=92e3da3cf193fd27996909956c12a23c0333da44
All three patches look sane to me. If you would like to carry these generic bits in the PowerPC tree as well then:
Thanks,
Ingo
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 13 lines · Ingo Molnar
Quoted 11 lines · Ram Pai
This patch series provides arch-neutral enhancements to enable memory-keys on new architecutes, and the corresponding changes in x86 and powerpc specific code to support that.
a) Provides ability to support upto 32 keys. PowerPC can handle 32 keys and hence needs this.
b) Arch-neutral code; and not the arch-specific code, determines the format of the string, that displays the key for each vma in smaps.
Quoted 7 lines
Quoted 2 lines
PowerPC implementation of memory-keys is now in powerpc/next tree.
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?h=next&id=92e3da3cf193fd27996909956c12a23c0333da44All three patches look sane to me. If you would like to carry these generic bits in the PowerPC tree as well then:
Reviewed-by Ingo Molnar <[email protected]>
Thanks.
I'll put them in powerpc next and probably send to Linus next week in a 2nd pull request for 4.16.
cheers