Re: [PATCH] arm64/mm: Limit ARCH_MMAP_RND_BITS_MAX to 24 for 42-bit VA

From: Anshuman Khandual

Date: Sun Nov 29 2026 - 23:43:30 EST


On Thu, Nov 26, 2026 at 05:56:22PM +0000, Catalin Marinas wrote:
> On Wed, Nov 11, 2026 at 09:50:27AM +0530, Anshuman Khandual wrote:
> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > index 1075bc661833..8d8b1331178a 100644
> > --- a/arch/arm64/Kconfig
> > +++ b/arch/arm64/Kconfig
> > @@ -300,7 +300,7 @@ config ARCH_MMAP_RND_BITS_MIN
> > config ARCH_MMAP_RND_BITS_MAX
> > default 19 if ARM64_VA_BITS=36
> > default 24 if ARM64_VA_BITS=39
> > - default 27 if ARM64_VA_BITS=42
> > + default 24 if ARM64_VA_BITS=42
>
> Why not 23? The comment above this config entry was meant say it's
> calculated as VA_BITS - PAGE_SHIFT - 3 since commit 8f0d3aa9de57
> ("arm64: mm: support ARCH_MMAP_RND_BITS"). However, you changed it to
> "... + 3" with commit 51ecb29f7a65 ("arm64/mm: Define PTDESC_ORDER"), so
> you may want to fix the comment as well with this patch.
>

Sure - will make it as 23 instead and also revert back the original
comment although as VA_BITS - PAGE_SHIFT - PTDESC_ORDER.

> --
> Catalin