]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
KVM: irqchip: convey devid to kvm_set_msi
authorEric Auger <eric.auger@linaro.org>
Thu, 18 Jun 2015 08:30:19 +0000 (10:30 +0200)
committerJulien Grall <julien.grall@citrix.com>
Mon, 28 Sep 2015 11:05:13 +0000 (12:05 +0100)
on ARM, a devid field is populated in kvm_msi struct in case the
flag is set to KVM_MSI_VALID_DEVID. Let's populate the corresponding
kvm_kernel_irq_routing_entry devid field and set the msi type to
KVM_IRQ_ROUTING_EXTENDED_MSI.

Signed-off-by: Eric Auger <eric.auger@linaro.org>
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
virt/kvm/irqchip.c

index 21c14244f4c4fd1c3c8ffade7f3265df91c89efb..e678f8a1ef25e82a153ae55f395821eeb819c824 100644 (file)
@@ -72,9 +72,17 @@ int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi)
 {
        struct kvm_kernel_irq_routing_entry route;
 
-       if (!irqchip_in_kernel(kvm) || msi->flags != 0)
+       if (!irqchip_in_kernel(kvm))
                return -EINVAL;
 
+       if (msi->flags & KVM_MSI_VALID_DEVID) {
+               route.devid = msi->devid;
+               route.type = KVM_IRQ_ROUTING_EXTENDED_MSI;
+       } else if (!msi->flags)
+               return -EINVAL;
+
+       /* historically the route.type was not set */
+
        route.msi.address_lo = msi->address_lo;
        route.msi.address_hi = msi->address_hi;
        route.msi.data = msi->data;