From: Anshuman Khandual <anshuman.khandual@arm.com>
To: "Kornel Dulęba" <korneld@chromium.org>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Will Deacon" <will@kernel.org>
Cc: "Steve Capper" <steve.capper@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, ssradjacoumar@google.com,
chromeos-krk-upstreaming@google.com,
"Kornel Dulęba" <korneld@google.com>
Subject: Re: [PATCH] arm64: Support ARM64_VA_BITS=52 when setting ARCH_MMAP_RND_BITS_MAX
Date: Fri, 4 Apr 2025 12:16:27 +0530 [thread overview]
Message-ID: <38049b58-a504-4223-9f6d-537609931fb4@arm.com> (raw)
In-Reply-To: <20250403183638.3386628-1-korneld@google.com>
On 4/4/25 00:06, Kornel Dulęba wrote:
> 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.
Why should ARCH_MMAP_RND_BITS_MAX value be same for both 48 bits and 52
bits VA in case the user does request for 52 bit VA via mmap() hint and
the HW supports it ?
>
> Fixes: b6d00d47e81a ("arm64: mm: Introduce 52-bit Kernel VAs")
> Signed-off-by: Kornel Dulęba <korneld@google.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
next prev parent reply other threads:[~2025-04-04 6:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-03 18:36 Kornel Dulęba
2025-04-04 6:46 ` Anshuman Khandual [this message]
2025-04-04 16:46 ` Kornel Dulęba
2025-04-14 7:42 ` Kornel Dulęba
2025-04-17 5:15 ` Anshuman Khandual
2025-04-17 8:08 ` Kornel Dulęba
2025-04-17 9:02 ` Anshuman Khandual
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=38049b58-a504-4223-9f6d-537609931fb4@arm.com \
--to=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=chromeos-krk-upstreaming@google.com \
--cc=korneld@chromium.org \
--cc=korneld@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ssradjacoumar@google.com \
--cc=steve.capper@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®