]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: Use ARM64_HAS_GICV5_LEGACY for GICv5 probing
authorSascha Bischoff <Sascha.Bischoff@arm.com>
Thu, 28 Aug 2025 10:59:42 +0000 (10:59 +0000)
committerMarc Zyngier <maz@kernel.org>
Wed, 17 Sep 2025 16:41:02 +0000 (17:41 +0100)
commit754e43b09561f59dd04e0b8aafe4f5c9a71a4d1f
tree77cf2971c5f8cb85829d16b6d6c45e7d718de739
parent7847f51189343b29a24ca7edafb60a9032d5acf8
KVM: arm64: Use ARM64_HAS_GICV5_LEGACY for GICv5 probing

The previous implementation of the probing function had the flaw that
it wouldn't catch mismatched CPU features. Specifically, GICv5 legacy
support (support for GICv3 VMs on a GICv5 host) was being enabled as
long as the initial boot CPU had support for the feature. This allowed
the support to become enabled on mismatched configurations.

Move to using cpus_have_final_cap(ARM64_HAS_GICV5_LEGACY) instead,
which only returns true when all booted CPUs support
FEAT_GCIE_LEGACY. A byproduct of this is that it ensures that late
onlining of CPUs is blocked on feature mismatch.

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/kvm/vgic/vgic-v5.c