Skip to content

Commit f39d16c

Browse files
Christoffer Dallchazy
authored andcommitted
KVM: arm/arm64: Guard kvm_vgic_map_is_active against !vgic_initialized
If the vgic is not initialized, don't try to grab its spinlocks or traverse its data structures. This is important because we soon have to start considering the active state of a virtual interrupts when doing vcpu_load, which may happen early on before the vgic is initialized. Signed-off-by: Christoffer Dall <[email protected]> Acked-by: Marc Zyngier <[email protected]>
1 parent e6d68b0 commit f39d16c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

virt/kvm/arm/vgic/vgic.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,9 @@ bool kvm_vgic_map_is_active(struct kvm_vcpu *vcpu, unsigned int virt_irq)
777777
struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, virt_irq);
778778
bool map_is_active;
779779

780+
if (!vgic_initialized(vcpu->kvm))
781+
return false;
782+
780783
spin_lock(&irq->irq_lock);
781784
map_is_active = irq->hw && irq->active;
782785
spin_unlock(&irq->irq_lock);

0 commit comments

Comments
 (0)