]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: arm64: Follow specification when implementing WXN
authorMarc Zyngier <maz@kernel.org>
Tue, 1 Jul 2025 15:16:48 +0000 (16:16 +0100)
committerOliver Upton <oliver.upton@linux.dev>
Thu, 24 Jul 2025 06:34:50 +0000 (23:34 -0700)
commit5152977340b6dc54e7c8cc8fe401e89cfa3e6f94
tree132f170b2d8e317d9def0f98479ff29b2f802961
parenta508d5afb70894ab50ccc4678f55ff801468182b
KVM: arm64: Follow specification when implementing WXN

The R_QXXPC and R_NPBXC rules have some interesting (and pretty
sharp) corners when defining the behaviour of of WXN at S1:

- when S1 overlay is enabled, WXN applies to the overlay and
  will remove W

- when S1 overlay is disabled, WXN applies to the base permissions
  and will remove X.

Today, we lumb the two together in a way that doesn't really match
the rules, making things awkward to follow what is happening, in
particular when overlays are enabled.

Split these two rules over two distinct paths, which makes things
a lot easier to read and validate against the architecture rules.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20250701151648.754785-3-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/at.c