Lines Matching defs:pkey
12 extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
34 int prot, int pkey);
36 int prot, int pkey)
41 return __arch_override_mprotect_pkey(vma, prot, pkey);
47 #define mm_set_pkey_allocated(mm, pkey) do { \
48 mm_pkey_allocation_map(mm) |= (1U << pkey); \
50 #define mm_set_pkey_free(mm, pkey) do { \
51 mm_pkey_allocation_map(mm) &= ~(1U << pkey); \
55 bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey)
59 * from pkey_alloc() or pkey 0 which is allocated
62 if (pkey < 0)
64 if (pkey >= arch_max_pkey())
67 * The exec-only pkey is set in the allocation map, but
71 if (pkey == mm->context.execute_only_pkey)
74 return mm_pkey_allocation_map(mm) & (1U << pkey);
85 * that the pkey is valid as far as the hardware is
108 int mm_pkey_free(struct mm_struct *mm, int pkey)
110 if (!mm_pkey_is_allocated(mm, pkey))
113 mm_set_pkey_free(mm, pkey);