Lines Matching refs:pkey
33 static inline u64 pkey_to_vmflag_bits(u16 pkey) in pkey_to_vmflag_bits() argument
35 return (((u64)pkey << VM_PKEY_SHIFT) & ARCH_VM_PKEY_FLAGS); in pkey_to_vmflag_bits()
50 #define pkey_alloc_mask(pkey) (0x1 << pkey) argument
54 #define __mm_pkey_allocated(mm, pkey) { \ argument
55 mm_pkey_allocation_map(mm) |= pkey_alloc_mask(pkey); \
58 #define __mm_pkey_free(mm, pkey) { \ argument
59 mm_pkey_allocation_map(mm) &= ~pkey_alloc_mask(pkey); \
62 #define __mm_pkey_is_allocated(mm, pkey) \ argument
63 (mm_pkey_allocation_map(mm) & pkey_alloc_mask(pkey))
65 #define __mm_pkey_is_reserved(pkey) (reserved_allocation_mask & \ argument
66 pkey_alloc_mask(pkey))
68 static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) in mm_pkey_is_allocated() argument
70 if (pkey < 0 || pkey >= arch_max_pkey()) in mm_pkey_is_allocated()
74 if (__mm_pkey_is_reserved(pkey)) in mm_pkey_is_allocated()
77 return __mm_pkey_is_allocated(mm, pkey); in mm_pkey_is_allocated()
110 static inline int mm_pkey_free(struct mm_struct *mm, int pkey) in mm_pkey_free() argument
115 if (!mm_pkey_is_allocated(mm, pkey)) in mm_pkey_free()
118 __mm_pkey_free(mm, pkey); in mm_pkey_free()
129 int prot, int pkey);
131 int prot, int pkey) in arch_override_mprotect_pkey() argument
140 if (pkey != -1) in arch_override_mprotect_pkey()
141 return pkey; in arch_override_mprotect_pkey()
143 return __arch_override_mprotect_pkey(vma, prot, pkey); in arch_override_mprotect_pkey()
146 extern int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
148 static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, in arch_set_user_pkey_access() argument
160 if (pkey == 0) in arch_set_user_pkey_access()
163 return __arch_set_user_pkey_access(tsk, pkey, init_val); in arch_set_user_pkey_access()