Re: [PATCH 1/3] mm: change vm_get_page_prot() to accept vm_flags_t argument

From
Lorenzo Stoakes <hidden>
Date
2025-06-19 12:20:10
Also in
kvm, linux-fsdevel, linux-mm, linuxppc-dev, lkml, nvdimm, sparclinux
Reply to
Vlastimil Babka, 2025-06-19
On Thu, Jun 19, 2025 at 01:31:50PM +0200, Vlastimil Babka wrote:
On 6/18/25 21:42, Lorenzo Stoakes wrote:
quoted
We abstract the type of the VMA flags to vm_flags_t, however in may places
it is simply assumed this is unsigned long, which is simply incorrect.

At the moment this is simply an incongruity, however in future we plan to
change this type and therefore this change is a critical requirement for
doing so.

Overall, this patch does not introduce any functional change.

Signed-off-by: Lorenzo Stoakes <redacted>
quoted
diff --git a/arch/powerpc/include/asm/book3s/64/pkeys.h b/arch/powerpc/include/asm/book3s/64/pkeys.h
index 5b178139f3c0..6f2075636591 100644
--- a/arch/powerpc/include/asm/book3s/64/pkeys.h
+++ b/arch/powerpc/include/asm/book3s/64/pkeys.h
@@ -4,8 +4,9 @@
 #define _ASM_POWERPC_BOOK3S_64_PKEYS_H

 #include <asm/book3s/64/hash-pkey.h>
+#include <linux/mm_types.h>
Hopefully not causing a circular header include.
Well bots should say if so :) these headers would surely be broken if that were
the case.

However, since the only caller is arch/powerpc/mm/book3s64/pgtable.c and that
already imports mm_types.h I will drop this to be safe.
quoted
-static inline u64 vmflag_to_pte_pkey_bits(u64 vm_flags)
+static inline u64 vmflag_to_pte_pkey_bits(vm_flags_t vm_flags)
Is this change rather for patch 3? It's not changing vm_get_page_prot().
OTOH git grep shows me you missed:
No it's necessary as it's called by vm_get_page_prot().
arch/powerpc/mm/book3s64/pgtable.c:pgprot_t vm_get_page_prot(unsigned long
vm_flags)
Ugh I checked and double checked this and yet somehow... :)

Let me send a fix-patch for removing the include and converting this.
With that sorted out, feel free to add:

Reviewed-by: Vlastimil Babka <redacted>

Thanks!
Thanks!
Thread (48 messages) 48 messages, 16 authors, last reply 2025-08-27
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help