Re: [PATCH 1/3] mm: Make arch_get_unmapped_area() take vm_flags by default

From: Helge Deller
Date: Tue Sep 03 2024 - 15:52:44 EST


On 9/2/24 21:08, Mark Brown wrote:
When we introduced arch_get_unmapped_area_vmflags() in 961148704acd
("mm: introduce arch_get_unmapped_area_vmflags()") we did so as part of
properly supporting guard pages for shadow stacks on x86_64, which uses
a custom arch_get_unmapped_area(). Equivalent features are also present
on both arm64 and RISC-V, both of which use the generic implementation
of arch_get_unmapped_area() and will require equivalent modification
there. Rather than continue to deal with having two versions of the
functions let's bite the bullet and have all implementations of
arch_get_unmapped_area() take vm_flags as a parameter.

The new parameter is currently ignored by all implementations other than
x86. The only caller that doesn't have a vm_flags available is
mm_get_unmapped_area(), as for the x86 implementation and the wrapper used
on other architectures this is modified to supply no flags.

No functional changes.

Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
---
arch/alpha/kernel/osf_sys.c | 2 +-
arch/arc/mm/mmap.c | 3 ++-
arch/arm/mm/mmap.c | 7 ++++---
arch/csky/abiv1/mmap.c | 3 ++-
arch/loongarch/mm/mmap.c | 5 +++--
arch/mips/mm/mmap.c | 2 +-
arch/parisc/kernel/sys_parisc.c | 5 +++--
arch/parisc/mm/hugetlbpage.c | 2 +-

Acked-by: Helge Deller <deller@xxxxxx> # parisc

Helge