From: sashiko-bot@kernel.org
To: "Vincent Donnefort" <vdonnefort@google.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v9 05/10] arm64: can_set_direct_map() if BBML3
Date: Wed, 02 Sep 2026 11:09:20 +0000 [thread overview]
Message-ID: <20260902110920.A24431F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260902104712.2399797-6-vdonnefort@google.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] can_set_direct_map() incorrectly evaluates to false during early boot on BBML3 systems due to unfinalized capabilities, permanently disabling runtime direct map splitting.
--
commit 145c29bbbc659d3113b49c46e076c4a0f62f5e20
Author: Vincent Donnefort <vdonnefort@google.com>
arm64: can_set_direct_map() if BBML3
Systems supporting BBML3 can split blocks without risking unhandled
page-faults. This commit allows setting the direct map unconditionally
for these systems.
> diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c
> index bbe98ac9ad8c6..58898ae53f5d1 100644
> --- a/arch/arm64/mm/pageattr.c
> +++ b/arch/arm64/mm/pageattr.c
> @@ -99,7 +99,8 @@ bool can_set_direct_map(void)
> * Realms need to make pages shared/protected at page granularity.
> */
> return rodata_full || debug_pagealloc_enabled() ||
> - arm64_kfence_can_set_direct_map() || is_realm_world();
> + arm64_kfence_can_set_direct_map() || is_realm_world() ||
> + system_supports_bbml3();
> }
[Severity: High]
Does system_supports_bbml3() evaluate to false unconditionally during early
boot when CPU alternatives are not yet finalized?
If so, does this break direct map splitting at runtime? When map_mem() in
arch/arm64/mm/mmu.c is called during boot, it statically initializes
linear_map_requires_bbml3 based on can_set_direct_map(). Since CPU
alternatives are unpatched early on, linear_map_requires_bbml3 is permanently
cached as false.
Later, when direct map modifications are requested at runtime (e.g. by
secretmem), split_kernel_leaf_mapping() in arch/arm64/mm/mmu.c bypasses
block splitting because the static flag was evaluated early and cached as
false.
This leads update_range_prot() to attempt a lockless walk and modify the
block mapping, causing a block size mismatch warning and failing with
-EINVAL. Is there a way to evaluate this dynamically or ensure capabilities
are finalized before caching?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260902104712.2399797-1-vdonnefort@google.com?part=5
next prev parent reply other threads:[~2026-09-02 11:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 10:47 [PATCH v9 00/10] arm64: Unmap FF-A lent memory from direct map Vincent Donnefort
2026-09-02 10:47 ` [PATCH v9 01/10] memblock: Introduce MEMBLOCK_LLMAP Vincent Donnefort
2026-09-02 10:47 ` [PATCH v9 02/10] of: reserved_mem: Introduce "ll-map" property Vincent Donnefort
2026-09-02 11:02 ` sashiko-bot
2026-09-02 17:24 ` Rob Herring
2026-09-03 10:03 ` Vincent Donnefort
2026-09-02 10:47 ` [PATCH v9 03/10] set_memory.h: Introduce can_set_direct_map_range() Vincent Donnefort
2026-09-02 10:47 ` [PATCH v9 04/10] set_memory.h: Introduce __set_direct_map*() Vincent Donnefort
2026-09-02 10:47 ` [PATCH v9 05/10] arm64: can_set_direct_map() if BBML3 Vincent Donnefort
2026-09-02 11:09 ` sashiko-bot [this message]
2026-09-02 10:47 ` [PATCH v9 06/10] arm64: Implement can_set_direct_map_range() Vincent Donnefort
2026-09-02 11:06 ` sashiko-bot
2026-09-02 10:47 ` [PATCH v9 07/10] arm64: Implement __set_direct_map*() Vincent Donnefort
2026-09-02 10:47 ` [PATCH v9 08/10] arm64: Add support for MEMBLOCK_LLMAP Vincent Donnefort
2026-09-02 10:47 ` [PATCH v9 09/10] firmware: arm_ffa: Introduce ffa-lend-pool Vincent Donnefort
2026-09-02 11:06 ` sashiko-bot
2026-09-02 17:38 ` Rob Herring
2026-09-03 10:10 ` Vincent Donnefort
2026-09-02 10:47 ` [PATCH v9 10/10] optee: Add support for arm,ffa-lend-pool Vincent Donnefort
2026-09-02 11:09 ` sashiko-bot
2026-09-02 13:27 ` [PATCH v9 00/10] arm64: Unmap FF-A lent memory from direct map Vincent Donnefort
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=20260902110920.A24431F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vdonnefort@google.com \
/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