提交 3f36c942 编写于 作者: M Michael Ellerman

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: NMichael Ellerman <mpe@ellerman.id.au>
Reviewed-by: NDave Hansen <dave.hansen@intel.com>
上级 555934a7
...@@ -7,6 +7,11 @@ ...@@ -7,6 +7,11 @@
extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
unsigned long init_val); 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 * Try to dedicate one of the protection keys to be used as an
* execute-only protection key. * execute-only protection key.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册