summaryrefslogtreecommitdiff
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorRam Pai <linuxram@us.ibm.com>2018-03-27 12:09:27 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2018-05-09 04:50:27 +0300
commit2c9e0a6fa2bb75697981825153128f43b32f6d08 (patch)
tree663f1f94021b3c9bd6638a8ff6f83ad2d47c6868 /include/linux/mm.h
parent5212213aa5a2359dd0474c9dab22b6220b591fe1 (diff)
downloadlinux-2c9e0a6fa2bb75697981825153128f43b32f6d08.tar.xz
mm, powerpc, x86: introduce an additional vma bit for powerpc pkey
Currently 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. Reviewed-by: Ingo Molnar <mingo@kernel.org> Acked-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Ram Pai <linuxram@us.ibm.com> [mpe: Fold in #if VM_PKEY_BIT4 as noticed by Dave Hansen] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c6a6f2492c1b..fc25929031c0 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -231,9 +231,14 @@ extern unsigned int kobjsize(const void *objp);
#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
+#ifdef CONFIG_PPC
+# define VM_PKEY_BIT4 VM_HIGH_ARCH_4
+#else
+# define VM_PKEY_BIT4 0
+#endif
#endif /* CONFIG_ARCH_HAS_PKEYS */
#if defined(CONFIG_X86)