]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - arch/x86/include/asm/pkeys.h
1 #ifndef _ASM_X86_PKEYS_H
2 #define _ASM_X86_PKEYS_H
4 #define PKEY_DEDICATED_EXECUTE_ONLY 15
6 * Consider the PKEY_DEDICATED_EXECUTE_ONLY key unavailable.
8 #define arch_max_pkey() (boot_cpu_has(X86_FEATURE_OSPKE) ? \
9 PKEY_DEDICATED_EXECUTE_ONLY : 1)
11 extern int arch_set_user_pkey_access(struct task_struct
*tsk
, int pkey
,
12 unsigned long init_val
);
15 * Try to dedicate one of the protection keys to be used as an
16 * execute-only protection key.
18 extern int __execute_only_pkey(struct mm_struct
*mm
);
19 static inline int execute_only_pkey(struct mm_struct
*mm
)
21 if (!boot_cpu_has(X86_FEATURE_OSPKE
))
24 return __execute_only_pkey(mm
);
27 extern int __arch_override_mprotect_pkey(struct vm_area_struct
*vma
,
29 static inline int arch_override_mprotect_pkey(struct vm_area_struct
*vma
,
32 if (!boot_cpu_has(X86_FEATURE_OSPKE
))
35 return __arch_override_mprotect_pkey(vma
, prot
, pkey
);
38 extern int __arch_set_user_pkey_access(struct task_struct
*tsk
, int pkey
,
39 unsigned long init_val
);
41 #define ARCH_VM_PKEY_FLAGS (VM_PKEY_BIT0 | VM_PKEY_BIT1 | VM_PKEY_BIT2 | VM_PKEY_BIT3)
43 #endif /*_ASM_X86_PKEYS_H */