Lines Matching refs:pkey
44 #define pkeyshift(pkey) (PKEY_REG_BITS - ((pkey+1) * AMR_BITS_PER_PKEY))
114 * pkey_to_vmflag_bits() assumes that the pkey bits are contiguous
127 /* scan the device tree for pkey feature */
260 static inline void init_amr(int pkey, u8 init_bits)
262 u64 new_amr_bits = (((u64)init_bits & 0x3UL) << pkeyshift(pkey));
263 u64 old_amr = read_amr() & ~((u64)(0x3ul) << pkeyshift(pkey));
268 static inline void init_iamr(int pkey, u8 init_bits)
270 u64 new_iamr_bits = (((u64)init_bits & 0x1UL) << pkeyshift(pkey));
271 u64 old_iamr = read_iamr() & ~((u64)(0x1ul) << pkeyshift(pkey));
277 * Set the access rights in AMR IAMR and UAMOR registers for @pkey to that
280 int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
290 pkey_bits = 0x3ul << pkeyshift(pkey);
304 init_iamr(pkey, new_iamr_bits);
312 init_amr(pkey, new_amr_bits);
370 int pkey)
373 * If the currently associated pkey is execute-only, but the requested
374 * protection is not execute-only, move it back to the default pkey.
381 * execute-only pkey.
384 pkey = execute_only_pkey(vma->vm_mm);
385 if (pkey > 0)
386 return pkey;
393 static bool pkey_access_permitted(int pkey, bool write, bool execute)
398 pkey_shift = pkeyshift(pkey);
444 /* Duplicate the oldmm pkey state in mm: */