summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2009-07-26 17:10:01 +0300
committerAvi Kivity <avi@redhat.com>2009-08-05 14:03:43 +0300
commit5116d8f6b977970ebefc1932c0f313163a6ec91f (patch)
tree6666716c07c7c3e1ea9803350278e96e02fbf16a /virt
parentd3bc2f91b4761a8d9f96bea167fef2f8c00dea54 (diff)
downloadlinux-5116d8f6b977970ebefc1932c0f313163a6ec91f.tar.gz
linux-5116d8f6b977970ebefc1932c0f313163a6ec91f.tar.bz2
linux-5116d8f6b977970ebefc1932c0f313163a6ec91f.zip
KVM: fix ack not being delivered when msi present
kvm_notify_acked_irq does not check irq type, so that it sometimes interprets msi vector as irq. As a result, ack notifiers are not called, which typially hangs the guest. The fix is to track and check irq type. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/irq_comm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c
index a8bd466d00cc..ddc17f0e2f35 100644
--- a/virt/kvm/irq_comm.c
+++ b/virt/kvm/irq_comm.c
@@ -160,7 +160,8 @@ void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin)
unsigned gsi = pin;
list_for_each_entry(e, &kvm->irq_routing, link)
- if (e->irqchip.irqchip == irqchip &&
+ if (e->type == KVM_IRQ_ROUTING_IRQCHIP &&
+ e->irqchip.irqchip == irqchip &&
e->irqchip.pin == pin) {
gsi = e->gsi;
break;
@@ -259,6 +260,7 @@ static int setup_routing_entry(struct kvm_kernel_irq_routing_entry *e,
int delta;
e->gsi = ue->gsi;
+ e->type = ue->type;
switch (ue->type) {
case KVM_IRQ_ROUTING_IRQCHIP:
delta = 0;