diff --git a/arch/x86/include/asm/pkeys.h b/arch/x86/include/asm/pkeys.h index 0e5f749158e457702f6f62363fd281939ef3cf4e..c1957f8f7c1be2fb593fa37559575344e0fa8b9b 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.