Lines Matching refs:pkey
49 #define pkeyshift(pkey) (PKEY_REG_BITS - ((pkey+1) * AMR_BITS_PER_PKEY)) argument
314 static inline void init_amr(int pkey, u8 init_bits) in init_amr() argument
316 u64 new_amr_bits = (((u64)init_bits & 0x3UL) << pkeyshift(pkey)); in init_amr()
317 u64 old_amr = current_thread_amr() & ~((u64)(0x3ul) << pkeyshift(pkey)); in init_amr()
322 static inline void init_iamr(int pkey, u8 init_bits) in init_iamr() argument
324 u64 new_iamr_bits = (((u64)init_bits & 0x1UL) << pkeyshift(pkey)); in init_iamr()
325 u64 old_iamr = current_thread_iamr() & ~((u64)(0x1ul) << pkeyshift(pkey)); in init_iamr()
337 int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, in __arch_set_user_pkey_access() argument
347 pkey_bits = 0x3ul << pkeyshift(pkey); in __arch_set_user_pkey_access()
361 init_iamr(pkey, new_iamr_bits); in __arch_set_user_pkey_access()
369 init_amr(pkey, new_amr_bits); in __arch_set_user_pkey_access()
391 int pkey) in __arch_override_mprotect_pkey() argument
405 pkey = execute_only_pkey(vma->vm_mm); in __arch_override_mprotect_pkey()
406 if (pkey > 0) in __arch_override_mprotect_pkey()
407 return pkey; in __arch_override_mprotect_pkey()
414 static bool pkey_access_permitted(int pkey, bool write, bool execute) in pkey_access_permitted() argument
419 pkey_shift = pkeyshift(pkey); in pkey_access_permitted()