Skip to content

Commit d42c797

Browse files
shihweiliMarc Zyngier
authored andcommitted
KVM: arm/arm64: vgic: Kick VCPUs when queueing already pending IRQs
In cases like IPI, we could be queueing an interrupt for a VCPU that is already running and is not about to exit, because the VCPU has entered the VM with the interrupt pending and would not trap on EOI'ing that interrupt. This could result to delays in interrupt deliveries or even loss of interrupts. To guarantee prompt interrupt injection, here we have to try to kick the VCPU. Signed-off-by: Shih-Wei Li <[email protected]> Reviewed-by: Christoffer Dall <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent 112b0b8 commit d42c797

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

virt/kvm/arm/vgic/vgic.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,18 @@ bool vgic_queue_irq_unlock(struct kvm *kvm, struct vgic_irq *irq)
273273
* no more work for us to do.
274274
*/
275275
spin_unlock(&irq->irq_lock);
276+
277+
/*
278+
* We have to kick the VCPU here, because we could be
279+
* queueing an edge-triggered interrupt for which we
280+
* get no EOI maintenance interrupt. In that case,
281+
* while the IRQ is already on the VCPU's AP list, the
282+
* VCPU could have EOI'ed the original interrupt and
283+
* won't see this one until it exits for some other
284+
* reason.
285+
*/
286+
if (vcpu)
287+
kvm_vcpu_kick(vcpu);
276288
return false;
277289
}
278290

0 commit comments

Comments
 (0)