projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
555934a
)
x86/pkeys: Add arch_pkeys_enabled()
author
Michael Ellerman
<mpe@ellerman.id.au>
Fri, 13 Apr 2018 13:54:36 +0000
(23:54 +1000)
committer
Michael Ellerman
<mpe@ellerman.id.au>
Wed, 9 May 2018 01:51:28 +0000
(11:51 +1000)
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>
arch/x86/include/asm/pkeys.h
patch
|
blob
|
blame
|
history
diff --git
a/arch/x86/include/asm/pkeys.h
b/arch/x86/include/asm/pkeys.h
index 0e5f749158e457702f6f62363fd281939ef3cf4e..c1957f8f7c1be2fb593fa37559575344e0fa8b9b 100644
(file)
--- 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.