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>

authored by Michael S. Tsirkin and committed by Avi Kivity 5116d8f6 d3bc2f91

+4 -1
+1
include/linux/kvm_host.h
··· 110 110 111 111 struct kvm_kernel_irq_routing_entry { 112 112 u32 gsi; 113 + u32 type; 113 114 int (*set)(struct kvm_kernel_irq_routing_entry *e, 114 115 struct kvm *kvm, int level); 115 116 union {
+3 -1
virt/kvm/irq_comm.c
··· 160 160 unsigned gsi = pin; 161 161 162 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 165 e->irqchip.pin == pin) { 165 166 gsi = e->gsi; 166 167 break; ··· 260 259 int delta; 261 260 262 261 e->gsi = ue->gsi; 262 + e->type = ue->type; 263 263 switch (ue->type) { 264 264 case KVM_IRQ_ROUTING_IRQCHIP: 265 265 delta = 0;