KVM: arm64: GICv3: Don't advertise ICH_HCR_EL2.En==1 when no vgic is configured
Marc Zyngier
maintainerPATCH 1/1 KVM: arm64: GICv3: Don't advertise ICH_HCR_EL2.En==1 when no vgic is configured
Configuring GICv3 to deal with the lack of GIC in the guest relies on not setting ICH_HCR_EL2.En in the shadow register, as this is an indication of the fact that we want to trap all system registers to report an UNDEF in the guest.
Make sure we leave vgic_hcr untouched in this case.
Reported-by Mark Brown <[email protected]>
Fixes 877324a1b5415 ("KVM: arm64: Revamp vgic maintenance interrupt configuration")
Signed-off-by Marc Zyngier <[email protected]>
--- arch/arm64/kvm/vgic/vgic-v3.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/kvm/vgic/vgic-v3.c +3 -0
@@ -26,6 +26,9 @@ void vgic_v3_configure_hcr(struct kvm_vcpu *vcpu, {struct vgic_v3_cpu_if *cpuif = &vcpu->arch.vgic_cpu.vgic_v3; +if (!irqchip_in_kernel (vcpu->kvm)) +return ; + cpuif->vgic_hcr = ICH_HCR_EL2_En;if (irqs_pending_outside_lrs (als))
Signature · 1 line
2.47.3
Quoted 6 lines · Marc Zyngier
Configuring GICv3 to deal with the lack of GIC in the guest relies on not setting ICH_HCR_EL2.En in the shadow register, as this is an indication of the fact that we want to trap all system registers to report an UNDEF in the guest.
Make sure we leave
vgic_hcruntouched in this case.
This resolves the issues I was seeing with no-vgic-v3:
Tested-by Mark Brown <[email protected]>