1 #ifndef _ASM_X86_PKEYS_H
2 #define _ASM_X86_PKEYS_H
4 #define arch_max_pkey() (boot_cpu_has(X86_FEATURE_OSPKE) ? 16 : 1)
6 extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
7 unsigned long init_val);
10 * Try to dedicate one of the protection keys to be used as an
11 * execute-only protection key.
13 #define PKEY_DEDICATED_EXECUTE_ONLY 15
14 extern int __execute_only_pkey(struct mm_struct *mm);
15 static inline int execute_only_pkey(struct mm_struct *mm)
17 if (!boot_cpu_has(X86_FEATURE_OSPKE))
20 return __execute_only_pkey(mm);
23 extern int __arch_override_mprotect_pkey(struct vm_area_struct *vma,
25 static inline int arch_override_mprotect_pkey(struct vm_area_struct *vma,
28 if (!boot_cpu_has(X86_FEATURE_OSPKE))
31 return __arch_override_mprotect_pkey(vma, prot, pkey);
34 #endif /*_ASM_X86_PKEYS_H */