Lines Matching refs:mm
24 extern int __execute_only_pkey(struct mm_struct *mm);
25 static inline int execute_only_pkey(struct mm_struct *mm)
30 return __execute_only_pkey(mm);
46 #define mm_pkey_allocation_map(mm) (mm->context.pkey_allocation_map)
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)
60 * implicitly when the mm is created.
71 if (pkey == mm->context.execute_only_pkey)
74 return mm_pkey_allocation_map(mm) & (1U << pkey);
81 int mm_pkey_alloc(struct mm_struct *mm)
97 if (mm_pkey_allocation_map(mm) == all_pkeys_mask)
100 ret = ffz(mm_pkey_allocation_map(mm));
102 mm_set_pkey_allocated(mm, ret);
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);