Skip to content

Commit 754e43b

Browse files
Sticklyman1936Marc Zyngier
authored andcommitted
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>
1 parent 7847f51 commit 754e43b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/arm64/kvm/vgic/vgic-v5.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ int vgic_v5_probe(const struct gic_kvm_info *info)
1515
u64 ich_vtr_el2;
1616
int ret;
1717

18-
if (!info->has_gcie_v3_compat)
18+
if (!cpus_have_final_cap(ARM64_HAS_GICV5_LEGACY))
1919
return -ENODEV;
2020

2121
kvm_vgic_global_state.type = VGIC_V5;

0 commit comments

Comments
 (0)