[PATCH v2] arm64: raise default ARCH_MMAP_RND_BITS for 48-bit and 52-bit VA
Anshuman Khandual
anshuman.khandual at arm.com
Thu Oct 15 20:57:26 PDT 2026
On Thu, Oct 15, 2026 at 05:35:00PM +0100, Catalin Marinas wrote:
> On Wed, Oct 14, 2026 at 10:23:35PM -0700, Iurii Trukhin wrote:
> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > index cab741a695f5..7bca47269dd5 100644
> > --- a/arch/arm64/Kconfig
> > +++ b/arch/arm64/Kconfig
> > @@ -313,6 +313,14 @@ config ARCH_MMAP_RND_BITS_MAX
> > default 16 if ARM64_16K_PAGES
> > default 18
> >
> > +# default to 1 TiB (5 bits below ARCH_MMAP_RND_BITS_MAX) on 48-bit and
> > +# 52-bit VA; smaller VA sizes fall back to ARCH_MMAP_RND_BITS_MIN in
> > +# arch/Kconfig
> > +config ARCH_MMAP_RND_BITS
> > + default 24 if (ARM64_VA_BITS=48 || ARM64_VA_BITS=52) && ARM64_64K_PAGES
> > + default 26 if (ARM64_VA_BITS=48 || ARM64_VA_BITS=52) && ARM64_16K_PAGES
> > + default 28 if (ARM64_VA_BITS=48 || ARM64_VA_BITS=52)
>
> This looks fine but I was wondering what ARCH_MMAP_RND_BITS_DEFAULT (and
> the compat equivalent) is for. It turns out that an int always evaluates
> to 'n', so not taken into account. It might be worth removing them
> altogether as a separate patch. No-one seems to be using them.
I had the same observation looking into v7.3-rc7 but seems like that option
is already being removed via the following patch, already in next-20261015.
commit 8cdae75cebe06b8abea9cd3402442d47cf50b485
Author: Julian Braha <julianbraha at gmail.com>
Date: Mon Aug 31 00:00:16 2026 +0100
arch/Kconfig: fix dead conditions by removing dead options
These two 'int' options:
ARCH_MMAP_RND_BITS_DEFAULT
ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
[---snip---]
https://lore.kernel.org/all/20260830230016.2730093-1-julianbraha@gmail.com/
>
> --
> Catalin
More information about the linux-arm-kernel
mailing list