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