Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Sascha Bischoff and committed by
Marc Zyngier
754e43b0 7847f511

+1 -1
+1 -1
arch/arm64/kvm/vgic/vgic-v5.c
··· 15 15 u64 ich_vtr_el2; 16 16 int ret; 17 17 18 - if (!info->has_gcie_v3_compat) 18 + if (!cpus_have_final_cap(ARM64_HAS_GICV5_LEGACY)) 19 19 return -ENODEV; 20 20 21 21 kvm_vgic_global_state.type = VGIC_V5;