From: Oliver Upton <oupton@kernel.org>
To: Fuad Tabba <fuad.tabba@linux.dev>
Cc: Marc Zyngier <maz@kernel.org>,
kvmarm@lists.linux.dev, Joey Gouly <joey.gouly@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Wei-Lin Chang <weilin.chang@arm.com>,
Steffen Eiden <seiden@linux.ibm.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] KVM: arm64: nv: Respect HA when computing translated TCR
Date: Thu, 29 Oct 2026 11:37:20 -0700 [thread overview]
Message-ID: <auOSYE97K5y19DAy@kernel.org> (raw)
In-Reply-To: <CA+EHjTw0EjMHKOH8s0F6PZRR7WkmRJJrMrqTzpYoP9gm5n_9Gg@mail.gmail.com>
On Thu, Oct 29, 2026 at 11:41:22AM +0000, Fuad Tabba wrote:
> Hi Marc,
>
> On Thu, 29 Oct 2026 10:58:54 +0000, Marc Zyngier <maz@kernel.org> wrote:
> [...]
> > That's a good point. However, my reading of the ARM ARM indicates that
> > as long as S2 shareability is Inner-Shareable, the resulting
> > shareability is Inner-Shareable (see R_ZNLRJ), so we're actually safe.
> > This should be fixed though.
>
> If my reading is correct, I don't think R_ZNLRJ is enough here.
> AArch64_S1Translate() (J1.2.4.57 in M.d) checks the walk attributes
> before it translates the update through stage 2:
>
> // Either the access flag was clear or AP[2]/nDirty was set
> if new_desc != descriptor then
> if (!IsWBShareable(descipaddr.memattrs) &&
> ConstrainUnpredictableBool(
> Unpredictable_Unsupported_Atomic_HW_Update)) then
> fault.statuscode = Fault_UnsupportedAtomicHWUpdate;
> return (fault, ARBITRARY : AddressDescriptor);
> end;
> ...
> if regime == Regime_EL10 && EL2Enabled() then
> ...
> (s2fault, descpaddr) = AArch64_S2Translate(fault,
> descipaddr, s1aarch64, s2aligned, descaccess);
>
> descipaddr is what AArch64_S1Walk() returns, and it holds the stage 1
> walk attributes (walkaddress.memattrs = walkstate.memattrs, with SH0
> from TCR_EL1), never combined with stage 2. R_VSXXT also covers an
> update "not supported in the stage 1 translation due to the defined
> memory type": that one is a stage 1 abort, taken to EL1.
>
> But it's not like the ARM ARM is an easy read :P
This is definitely helpful but my understanding is that the pseudocode
is *not* authoritative. I think the line "If a translation table hardware
update is not atomic as observed by other agents ..." in R_NNNMB gives
an implementation enough freedom to decide something Non-Shareable at S1
is actually atomic after the result of S2 translation (e.g. S2FWB).
So if the implementation decides it is atomic, no MMU fault is generated
and the update happens like normal. Now, with that being IMP DEF there's
a good chance the behavior can vary, like we saw on the output of
translation on N3 [*].
I'll add another patch to propagate SH0 and HPD, thanks Fuad.
[*]: c8631ea59b65 ("KVM: arm64: selftests: Explicitly set the page attrs to Inner-Shareable")
Best,
Oliver
next prev parent reply other threads:[~2026-10-29 18:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 9:05 [PATCH] KVM: arm64: nv: Respect HA when computing translated TCR Oliver Upton
2026-10-29 10:05 ` Fuad Tabba
2026-10-29 10:58 ` Marc Zyngier
2026-10-29 11:41 ` Fuad Tabba
2026-10-29 18:37 ` Oliver Upton [this message]
2026-10-29 19:11 ` Fuad Tabba
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=auOSYE97K5y19DAy@kernel.org \
--to=oupton@kernel.org \
--cc=fuad.tabba@linux.dev \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=seiden@linux.ibm.com \
--cc=stable@vger.kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=weilin.chang@arm.com \
--cc=yuzenghui@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.