kvm/irqchip: allow only multiple irqchip routes per GSI
authorAndrey Smetanin <[email protected]>
Fri, 16 Oct 2015 07:07:48 +0000 (10:07 +0300)
committerPaolo Bonzini <[email protected]>
Fri, 16 Oct 2015 08:34:30 +0000 (10:34 +0200)
Any other irq routing types (MSI, S390_ADAPTER, upcoming Hyper-V
SynIC) map one-to-one to GSI.

Signed-off-by: Andrey Smetanin <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Signed-off-by: Denis V. Lunev <[email protected]>
CC: Vitaly Kuznetsov <[email protected]>
CC: "K. Y. Srinivasan" <[email protected]>
CC: Gleb Natapov <[email protected]>
CC: Paolo Bonzini <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
virt/kvm/irqchip.c

index 716a1c4db528ffd8c8a2765a20579c02e1095010..f0b08a2a48ba3ff2486dc84180c709d0deacfe55 100644 (file)
@@ -144,11 +144,11 @@ static int setup_routing_entry(struct kvm_irq_routing_table *rt,
 
        /*
         * Do not allow GSI to be mapped to the same irqchip more than once.
-        * Allow only one to one mapping between GSI and MSI.
+        * Allow only one to one mapping between GSI and non-irqchip routing.
         */
        hlist_for_each_entry(ei, &rt->map[ue->gsi], link)
-               if (ei->type == KVM_IRQ_ROUTING_MSI ||
-                   ue->type == KVM_IRQ_ROUTING_MSI ||
+               if (ei->type != KVM_IRQ_ROUTING_IRQCHIP ||
+                   ue->type != KVM_IRQ_ROUTING_IRQCHIP ||
                    ue->u.irqchip.irqchip == ei->irqchip.irqchip)
                        return r;