Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d42c7970 authored by Shih-Wei Li's avatar Shih-Wei Li Committed by Marc Zyngier
Browse files

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: default avatarShih-Wei Li <shihwei@cs.columbia.edu>
Reviewed-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent 112b0b8f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -273,6 +273,18 @@ bool vgic_queue_irq_unlock(struct kvm *kvm, struct vgic_irq *irq)
		 * no more work for us to do.
		 */
		spin_unlock(&irq->irq_lock);

		/*
		 * We have to kick the VCPU here, because we could be
		 * queueing an edge-triggered interrupt for which we
		 * get no EOI maintenance interrupt. In that case,
		 * while the IRQ is already on the VCPU's AP list, the
		 * VCPU could have EOI'ed the original interrupt and
		 * won't see this one until it exits for some other
		 * reason.
		 */
		if (vcpu)
			kvm_vcpu_kick(vcpu);
		return false;
	}