[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250403183638.3386628-1-korneld@google.com>
Date: Thu, 3 Apr 2025 18:36:38 +0000
From: "Kornel Dulęba" <korneld@...omium.org>
To: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>
Cc: Steve Capper <steve.capper@....com>,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
ssradjacoumar@...gle.com,
chromeos-krk-upstreaming@...gle.com,
Kornel Dulęba <korneld@...gle.com>
Subject: [PATCH] arm64: Support ARM64_VA_BITS=52 when setting ARCH_MMAP_RND_BITS_MAX
When the 52-bit virtual addressing was enabled the select like
ARCH_MMAP_RND_BITS_MAX logic was never updated to account for it.
Because of that the rnd max bits would be set to the default value of
18 when ARM64_VA_BITS=52.
Fix this by setting ARCH_MMAP_RND_BITS_MAX to the same value that would
be used if 48-bit addressing was used. That's because the 52-bit
addressing is used only if the caller provides a hint to mmap, with a
fallback to 48-bit addressing.
Fixes: b6d00d47e81a ("arm64: mm: Introduce 52-bit Kernel VAs")
Signed-off-by: Kornel Dulęba <korneld@...gle.com>
---
arch/arm64/Kconfig | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 748c34dc953c..38e0bac567f5 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -332,9 +332,9 @@ config ARCH_MMAP_RND_BITS_MAX
default 24 if ARM64_VA_BITS=39
default 27 if ARM64_VA_BITS=42
default 30 if ARM64_VA_BITS=47
- default 29 if ARM64_VA_BITS=48 && ARM64_64K_PAGES
- default 31 if ARM64_VA_BITS=48 && ARM64_16K_PAGES
- default 33 if ARM64_VA_BITS=48
+ default 29 if (ARM64_VA_BITS=48 || ARM64_VA_BITS=52) && ARM64_64K_PAGES
+ default 31 if (ARM64_VA_BITS=48 || ARM64_VA_BITS=52) && ARM64_16K_PAGES
+ default 33 if (ARM64_VA_BITS=48 || ARM64_VA_BITS=52)
default 14 if ARM64_64K_PAGES
default 16 if ARM64_16K_PAGES
default 18
--
2.49.0.504.g3bcea36a83-goog
Powered by blists - more mailing lists