Thread (134 messages) 134 messages, 5 authors, 2017-10-30

Re: [PATCH 03/25] powerpc: track allocation status of all pkeys

From: Ram Pai <hidden>
Date: 2017-10-24 07:23:40

On Tue, Oct 24, 2017 at 11:58:29AM +0530, Aneesh Kumar K.V wrote:
Ram Pai [off-list ref] writes:
 +
quoted
+#define mm_set_pkey_is_allocated(mm, pkey)	\
+	(mm_pkey_allocation_map(mm) & pkey_alloc_mask(pkey))
+
quoted
 static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey)
 {
-	return (pkey == 0);
+	/* a reserved key is never considered as 'explicitly allocated' */
+	return ((pkey < arch_max_pkey()) &&
+		!mm_set_pkey_is_reserved(mm, pkey) &&
+		mm_set_pkey_is_allocated(mm, pkey));
 }
that is confusing naming. what is mm_set_pkey_is_allocated()? . 'set' in
that name is confusing.
will change it by removing the 'set' in the names.

thanks,
RP
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help