Skip to content

Commit

Permalink
x86/pkeys: Add arch_pkeys_enabled()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Ellerman committed May 9, 2018
1 parent 555934a commit 3f36c94
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/x86/include/asm/pkeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3f36c94

Please sign in to comment.