summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShih-Wei Li <shihwei@cs.columbia.edu>2016-10-27 17:08:13 +0200
committerMarc Zyngier <marc.zyngier@arm.com>2016-11-04 18:56:56 +0100
commitd42c79701a3ee5c38fbbc82f98a140420bd40134 (patch)
treea279e574dfee0728062122f33ef5b7fa90e8638f
parentKVM: arm/arm64: vgic: Prevent access to invalid SPIs (diff)
downloadlinux-d42c79701a3ee5c38fbbc82f98a140420bd40134.tar.xz
linux-d42c79701a3ee5c38fbbc82f98a140420bd40134.zip
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 <shihwei@cs.columbia.edu> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r--virt/kvm/arm/vgic/vgic.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/virt/kvm/arm/vgic/vgic.c b/virt/kvm/arm/vgic/vgic.c
index 2893d5ba523a..6440b56ec90e 100644
--- a/virt/kvm/arm/vgic/vgic.c
+++ b/virt/kvm/arm/vgic/vgic.c
@@ -273,6 +273,18 @@ retry:
* 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;
}