]> xenbits.xensource.com Git - qemu-xen-4.4-testing.git/commitdiff
qemu-xen: if pirq == 0 fall back to emulated MSIs
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 5 Jan 2011 23:16:54 +0000 (23:16 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 5 Jan 2011 23:16:54 +0000 (23:16 +0000)
If the pirq requested is 0, it probably means that the guest is
misconfigured, so fall back to the emulated code path.

This patch depends on "qemu-xen: support PV on HVM MSIX remapping".

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
hw/pt-msi.c

index b01744ed520d32dbc53dee9d37674eed24f0bd08..71fa6f00414566bdbd0d0c0cff6fa853275b485e 100644 (file)
@@ -79,7 +79,12 @@ int pt_msi_setup(struct pt_dev *dev)
          * is passed as dest_id */
         pirq = (dev->msi->addr_hi & 0xffffff00) |
                ((dev->msi->addr_lo >> MSI_TARGET_CPU_SHIFT) & 0xff);
-        PT_LOG("pt_msi_setup requested pirq = %d\n", pirq);
+        if (!pirq)
+            /* this probably identifies an misconfiguration of the guest,
+             * try the emulated path */
+            pirq = -1;
+        else
+            PT_LOG("pt_msi_setup requested pirq = %d\n", pirq);
     }
 
     if ( xc_physdev_map_pirq_msi(xc_handle, domid, AUTO_ASSIGN, &pirq,
@@ -305,7 +310,12 @@ static int pt_msix_update_one(struct pt_dev *dev, int entry_nr)
          * is passed as dest_id */
         pirq = ((gaddr >> 32) & 0xffffff00) |
                (((gaddr & 0xffffffff) >> MSI_TARGET_CPU_SHIFT) & 0xff);
-        PT_LOG("pt_msix_update_one requested pirq = %d\n", pirq);
+        if (!pirq)
+            /* this probably identifies an misconfiguration of the guest,
+             * try the emulated path */
+            pirq = -1;
+        else
+            PT_LOG("pt_msix_update_one requested pirq = %d\n", pirq);
     }
 
     /* Check if this entry is already mapped */