Lines Matching refs:pkey
48 #define pkeyshift(pkey) (PKEY_REG_BITS - ((pkey+1) * AMR_BITS_PER_PKEY)) argument
313 static inline void init_amr(int pkey, u8 init_bits) in init_amr() argument
315 u64 new_amr_bits = (((u64)init_bits & 0x3UL) << pkeyshift(pkey)); in init_amr()
316 u64 old_amr = current_thread_amr() & ~((u64)(0x3ul) << pkeyshift(pkey)); in init_amr()
321 static inline void init_iamr(int pkey, u8 init_bits) in init_iamr() argument
323 u64 new_iamr_bits = (((u64)init_bits & 0x1UL) << pkeyshift(pkey)); in init_iamr()
324 u64 old_iamr = current_thread_iamr() & ~((u64)(0x1ul) << pkeyshift(pkey)); in init_iamr()
336 int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, in __arch_set_user_pkey_access() argument
346 pkey_bits = 0x3ul << pkeyshift(pkey); in __arch_set_user_pkey_access()
360 init_iamr(pkey, new_iamr_bits); in __arch_set_user_pkey_access()
368 init_amr(pkey, new_amr_bits); in __arch_set_user_pkey_access()
390 int pkey) in __arch_override_mprotect_pkey() argument
404 pkey = execute_only_pkey(vma->vm_mm); in __arch_override_mprotect_pkey()
405 if (pkey > 0) in __arch_override_mprotect_pkey()
406 return pkey; in __arch_override_mprotect_pkey()
413 static bool pkey_access_permitted(int pkey, bool write, bool execute) in pkey_access_permitted() argument
418 pkey_shift = pkeyshift(pkey); in pkey_access_permitted()