diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2009-07-26 10:10:01 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-08-05 07:03:43 -0400 |
commit | 5116d8f6b977970ebefc1932c0f313163a6ec91f (patch) | |
tree | 6666716c07c7c3e1ea9803350278e96e02fbf16a /virt/kvm/irq_comm.c | |
parent | d3bc2f91b4761a8d9f96bea167fef2f8c00dea54 (diff) |
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/kvm/irq_comm.c')
-rw-r--r-- | virt/kvm/irq_comm.c | 4 |
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) | |||
160 | unsigned gsi = pin; | 160 | unsigned gsi = pin; |
161 | 161 | ||
162 | list_for_each_entry(e, &kvm->irq_routing, link) | 162 | list_for_each_entry(e, &kvm->irq_routing, link) |
163 | if (e->irqchip.irqchip == irqchip && | 163 | if (e->type == KVM_IRQ_ROUTING_IRQCHIP && |
164 | e->irqchip.irqchip == irqchip && | ||
164 | e->irqchip.pin == pin) { | 165 | e->irqchip.pin == pin) { |
165 | gsi = e->gsi; | 166 | gsi = e->gsi; |
166 | break; | 167 | break; |
@@ -259,6 +260,7 @@ static int setup_routing_entry(struct kvm_kernel_irq_routing_entry *e, | |||
259 | int delta; | 260 | int delta; |
260 | 261 | ||
261 | e->gsi = ue->gsi; | 262 | e->gsi = ue->gsi; |
263 | e->type = ue->type; | ||
262 | switch (ue->type) { | 264 | switch (ue->type) { |
263 | case KVM_IRQ_ROUTING_IRQCHIP: | 265 | case KVM_IRQ_ROUTING_IRQCHIP: |
264 | delta = 0; | 266 | delta = 0; |