sparclinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] use vm_flags_t consistently
@ 2025-06-18 19:42 Lorenzo Stoakes
  2025-06-18 19:42 ` [PATCH 1/3] mm: change vm_get_page_prot() to accept vm_flags_t argument Lorenzo Stoakes
                   ` (4 more replies)
  0 siblings, 5 replies; 48+ messages in thread
From: Lorenzo Stoakes @ 2025-06-18 19:42 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Russell King, Catalin Marinas, Will Deacon, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy,
	David S . Miller, Andreas Larsson, Jarkko Sakkinen, Dave Hansen,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, H . Peter Anvin,
	Andy Lutomirski, Peter Zijlstra, Alexander Viro,
	Christian Brauner, Jan Kara, Kees Cook, Peter Xu,
	David Hildenbrand, Zi Yan, Baolin Wang, Liam R . Howlett,
	Nico Pache, Ryan Roberts, Dev Jain, Barry Song, Xu Xin,
	Chengming Zhou, Hugh Dickins, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Rik van Riel, Harry Yoo,
	Dan Williams, Matthew Wilcox, Steven Rostedt, Masami Hiramatsu,
	Mathieu Desnoyers, Jason Gunthorpe, John Hubbard, Muchun Song,
	Oscar Salvador, Jann Horn, Pedro Falcato, Johannes Weiner,
	Qi Zheng, Shakeel Butt, linux-arm-kernel, linux-kernel,
	linuxppc-dev, kvm, sparclinux, linux-sgx, linux-fsdevel, linux-mm,
	nvdimm, linux-trace-kernel

The VMA flags field vma->vm_flags is of type vm_flags_t. Right now this is
exactly equivalent to unsigned long, but it should not be assumed to be.

Much code that references vma->vm_flags already correctly uses vm_flags_t,
but a fairly large chunk of code simply uses unsigned long and assumes that
the two are equivalent.

This series corrects that and has us use vm_flags_t consistently.

This series is motivated by the desire to, in a future series, adjust
vm_flags_t to be a u64 regardless of whether the kernel is 32-bit or 64-bit
in order to deal with the VMA flag exhaustion issue and avoid all the
various problems that arise from it (being unable to use certain features
in 32-bit, being unable to add new flags except for 64-bit, etc.)

This is therefore a critical first step towards that goal. At any rate,
using the correct type is of value regardless.

We additionally take the opportunity to refer to VMA flags as vm_flags
where possible to make clear what we're referring to.

Overall, this series does not introduce any functional change.

Lorenzo Stoakes (3):
  mm: change vm_get_page_prot() to accept vm_flags_t argument
  mm: update core kernel code to use vm_flags_t consistently
  mm: update architecture and driver code to use vm_flags_t

 arch/arm/mm/fault.c                        |   2 +-
 arch/arm64/include/asm/mman.h              |  10 +-
 arch/arm64/mm/fault.c                      |   2 +-
 arch/arm64/mm/mmap.c                       |   2 +-
 arch/arm64/mm/mmu.c                        |   2 +-
 arch/powerpc/include/asm/book3s/64/pkeys.h |   3 +-
 arch/powerpc/include/asm/mman.h            |   2 +-
 arch/powerpc/include/asm/pkeys.h           |   4 +-
 arch/powerpc/kvm/book3s_hv_uvmem.c         |   2 +-
 arch/sparc/include/asm/mman.h              |   4 +-
 arch/sparc/mm/init_64.c                    |   2 +-
 arch/x86/kernel/cpu/sgx/encl.c             |   8 +-
 arch/x86/kernel/cpu/sgx/encl.h             |   2 +-
 arch/x86/mm/pgprot.c                       |   2 +-
 fs/exec.c                                  |   2 +-
 fs/userfaultfd.c                           |   2 +-
 include/linux/coredump.h                   |   2 +-
 include/linux/huge_mm.h                    |  12 +-
 include/linux/khugepaged.h                 |   4 +-
 include/linux/ksm.h                        |   4 +-
 include/linux/memfd.h                      |   4 +-
 include/linux/mm.h                         |  10 +-
 include/linux/mm_types.h                   |   2 +-
 include/linux/mman.h                       |   4 +-
 include/linux/pgtable.h                    |   2 +-
 include/linux/rmap.h                       |   4 +-
 include/linux/userfaultfd_k.h              |   4 +-
 include/trace/events/fs_dax.h              |   6 +-
 mm/debug.c                                 |   2 +-
 mm/execmem.c                               |   8 +-
 mm/filemap.c                               |   2 +-
 mm/gup.c                                   |   2 +-
 mm/huge_memory.c                           |   2 +-
 mm/hugetlb.c                               |   4 +-
 mm/internal.h                              |   4 +-
 mm/khugepaged.c                            |   4 +-
 mm/ksm.c                                   |   2 +-
 mm/madvise.c                               |   4 +-
 mm/mapping_dirty_helpers.c                 |   2 +-
 mm/memfd.c                                 |   8 +-
 mm/memory.c                                |   4 +-
 mm/mmap.c                                  |  16 +-
 mm/mprotect.c                              |   8 +-
 mm/mremap.c                                |   2 +-
 mm/nommu.c                                 |  12 +-
 mm/rmap.c                                  |   4 +-
 mm/shmem.c                                 |   6 +-
 mm/userfaultfd.c                           |  14 +-
 mm/vma.c                                   |  78 +++---
 mm/vma.h                                   |  16 +-
 mm/vmscan.c                                |   4 +-
 tools/testing/vma/vma.c                    | 266 ++++++++++-----------
 tools/testing/vma/vma_internal.h           |  12 +-
 53 files changed, 298 insertions(+), 297 deletions(-)

--
2.49.0

^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2025-08-27 16:59 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18 19:42 [PATCH 0/3] use vm_flags_t consistently Lorenzo Stoakes
2025-06-18 19:42 ` [PATCH 1/3] mm: change vm_get_page_prot() to accept vm_flags_t argument Lorenzo Stoakes
2025-06-19  8:42   ` Christian Brauner
2025-06-19  8:49     ` Lorenzo Stoakes
2025-06-20 18:46       ` Pedro Falcato
2025-06-19 11:31   ` Vlastimil Babka
2025-06-19 12:18     ` Lorenzo Stoakes
2025-06-19 12:12   ` Oscar Salvador
2025-06-19 12:20     ` Lorenzo Stoakes
2025-06-19 12:25   ` Lorenzo Stoakes
2025-06-23 14:16     ` David Hildenbrand
2025-06-20 18:31   ` Pedro Falcato
2025-06-23 14:32   ` Zi Yan
2025-06-23 15:17   ` Catalin Marinas
2025-06-25  5:55   ` Anshuman Khandual
2025-06-18 19:42 ` [PATCH 2/3] mm: update core kernel code to use vm_flags_t consistently Lorenzo Stoakes
2025-06-18 21:17   ` Kees Cook
2025-06-19  7:44   ` Jan Kara
2025-06-19  8:37   ` Christian Brauner
2025-06-19 11:48   ` Vlastimil Babka
2025-06-19 12:06   ` Oscar Salvador
2025-06-20 18:49   ` Pedro Falcato
2025-06-23 14:17   ` David Hildenbrand
2025-06-23 14:33   ` Zi Yan
2025-06-25  6:00   ` Anshuman Khandual
2025-07-29  0:15   ` Harry Yoo
2025-07-29  5:25     ` Lorenzo Stoakes
2025-07-29 18:39       ` Uladzislau Rezki
2025-08-01 11:20         ` Lorenzo Stoakes
2025-08-04 10:54           ` Uladzislau Rezki
2025-08-05  9:37             ` Mike Rapoport
2025-08-05 16:13               ` Uladzislau Rezki
2025-08-25 21:37                 ` Kees Cook
2025-08-27 16:59                   ` Uladzislau Rezki
2025-06-18 19:42 ` [PATCH 3/3] mm: update architecture and driver code to use vm_flags_t Lorenzo Stoakes
2025-06-19  8:43   ` Christian Brauner
2025-06-19 11:48   ` Vlastimil Babka
2025-06-19 12:18   ` Oscar Salvador
2025-06-20 18:47   ` Pedro Falcato
2025-06-23 14:18   ` David Hildenbrand
2025-06-23 14:34   ` Zi Yan
2025-06-23 15:17   ` Catalin Marinas
2025-06-24 20:44   ` Jarkko Sakkinen
2025-06-25  6:08   ` Anshuman Khandual
2025-06-19  5:47 ` [PATCH 0/3] use vm_flags_t consistently Mike Rapoport
2025-06-25  2:55 ` Anshuman Khandual
2025-06-25  4:50   ` Andrew Morton
2025-06-25  6:47     ` Lorenzo Stoakes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).