summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2018-04-13 15:54:36 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2018-05-09 03:51:28 +0200
commit3f36c94239658a79a4deeb84a2e0ebf005f083fc (patch)
tree937ffb0918f11333454e4f9f2e9458580275fa52 /arch/x86/include/asm
parentx86/pkeys: Move vma_pkey() into asm/pkeys.h (diff)
downloadlinux-3f36c94239658a79a4deeb84a2e0ebf005f083fc.tar.xz
linux-3f36c94239658a79a4deeb84a2e0ebf005f083fc.zip
x86/pkeys: Add arch_pkeys_enabled()
This will be used in future patches to check for arch support for pkeys in generic code. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Reviewed-by: Dave Hansen <dave.hansen@intel.com>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r--arch/x86/include/asm/pkeys.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/include/asm/pkeys.h b/arch/x86/include/asm/pkeys.h
index 0e5f749158e4..c1957f8f7c1b 100644
--- a/arch/x86/include/asm/pkeys.h
+++ b/arch/x86/include/asm/pkeys.h
@@ -7,6 +7,11 @@
extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
unsigned long init_val);
+static inline bool arch_pkeys_enabled(void)
+{
+ return boot_cpu_has(X86_FEATURE_OSPKE);
+}
+
/*
* Try to dedicate one of the protection keys to be used as an
* execute-only protection key.