Re: [PATCH v2 02/13] mm/vma: update do_mmap() to use vma_flags_t

"Vlastimil Babka (SUSE)" <[email protected]> Wed, 22 Jul 2026 15:33:53 +0200
Newsgroups gmane.linux.kernel.aio.general,gmane.linux.kernel.mm,gmane.linux.kernel,gmane.linux.ports.mips,gmane.linux.file-systems,gmane.linux.ports.ppc64.devel,gmane.comp.video.dri.devel,gmane.linux.kernel.samsung-soc,gmane.comp.freedesktop.xorg.drivers.intel,gmane.linux.ports.arm.msm,gmane.comp.freedesktop.xorg.drivers.freedreno,gmane.comp.freedesktop.xorg.nouveau,gmane.linux.ports.arm.rockchip,gmane.linux.ports.tegra,gmane.comp.emulators.xen.devel,gmane.linux.sound
Message-ID <[email protected]>
On 7/11/26 20:44, Lorenzo Stoakes wrote:
> The core do_mmap() function accepts a vm_flags_t parameter which it then
> manipulates before passing to mmap_region() to do the heavy lifting of the
> memory mapping.
> 
> Update do_mmap() to instead accept a vma_flags_t parameter, and adjust all
> the logic within do_mmap() to manipulate this instead.
> 
> This is as part of the ongoing effort to convert VMA flags from a system
> word size to a bitmap type which allows us to unrestrict the number of VMA
> flags, as well as gain control over how VMA flag manipulation occurs.
> 
> We do not cascade these changes to all functions which accept vm_flags_t,
> but rather use vma_flags_to_legacy() where necessary, specifically
> deferring converting calc_vm_prot_bits(), calc_vm_flag_bits() and
> __get_unmapped_area() to vma_flags_t.
> 
> Also utilise the new vma_flags_can_grow() predicate which correctly handles
> the case of architectures without upward growing stacks.
> 
> As part of this change, introduce VMA_SHADOW_STACK so we can correctly
> handle the case of the shadow stack not being defined.
> 
> No functional change intended.
> 
> Reviewed-by: Lance Yang <[email protected]>
> Reviewed-by: Zi Yan <[email protected]>
> Signed-off-by: Lorenzo Stoakes <[email protected]>

Reviewed-by: Vlastimil Babka (SUSE) <[email protected]>


--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to [email protected].  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"[email protected]">[email protected]</a>