powerpc: define an additional vma bit for protection keys.
RFC v7 1/25 powerpc: define an additional vma bit for protection keys.
powerpc needs an additional vma bit to support 32 keys. Till the additional vma bit lands in include/linux/mm.h we have to define it in powerpc specific header file. This is needed to get pkeys working on power.
Signed-off-by Ram Pai <[email protected]>
--- arch/powerpc/include/asm/pkeys.h | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-)
arch/powerpc/include/asm/pkeys.h +18 -0
@@ -2,6 +2,24 @@#define _ASM_PPC64_PKEYS_Hextern bool pkey_inited; + +/* +* powerpc needs an additional vma bit to support 32 keys. +* Till the additional vma bit lands in include/linux/mm.h +* we have to carry the hunk below. This is needed to get +* pkeys working on power. -- Ram +*/ +#ifndef VM_HIGH_ARCH_BIT_4 +#define VM_HIGH_ARCH_BIT_4 36 +#define VM_HIGH_ARCH_4 BIT(VM_HIGH_ARCH_BIT_4) +#define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0 +#define VM_PKEY_BIT0 VM_HIGH_ARCH_0 +#define VM_PKEY_BIT1 VM_HIGH_ARCH_1 +#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 +#define ARCH_VM_PKEY_FLAGS 0static inline bool mm_pkey_is_allocated (struct mm_struct *mm,int pkey)
Signature · 1 line
1.7.1