]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: arm64: Don't access ICC_SRE_EL2 if GICv3 doesn't support v2 compatibility
authorMarc Zyngier <maz@kernel.org>
Wed, 17 Sep 2025 09:11:28 +0000 (10:11 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 17 Sep 2025 16:40:42 +0000 (17:40 +0100)
commit9664d5810e9bc919a9a661594e01eabc80befe8a
tree339b6e7de416b251bb1972a325be3dfa0d69dc4e
parentb320789d6883cc00ac78ce83bccbfe7ed58afcf0
KVM: arm64: Don't access ICC_SRE_EL2 if GICv3 doesn't support v2 compatibility

We currently access ICC_SRE_EL2 at each load/put on VHE, and on each
entry/exit on nVHE. Both are quite onerous on NV, as this register
always traps.

We do this to make sure the EL1 guest doesn't flip between v2 and v3
behind our back. But all modern implementations have dropped v2,
and this is just overhead.

At the same time, the GICv5 spec has been fixed to allow access to
ICC_SRE_EL2 in legacy mode. Use this opportunity to replace the
GICv5 checks for v2 compat checks, with an ad-hoc static key.

Co-developed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kernel/image-vars.h
arch/arm64/kvm/hyp/vgic-v3-sr.c
arch/arm64/kvm/vgic/vgic-v3.c
include/kvm/arm_vgic.h