[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Issue with MSI in a HVM domU with several passed through PCI devices



On Wed, 27 Jun 2012, Rolu wrote:
> > That's because msitranslate is still enabled somehow, that is a
> > toolstack bug.
> > While we fix that bug, could you try this QEMU patch to forcefully disable
> > msitranslate?
> >
> 
> This worked!
> 
> The "unsupported delivery mode" message is gone. Sound works, although
> there is still occasionally a very short stutter, but I expect that's
> a different issue. I've been testing with a KDE desktop with 3D
> effects (cube, expo, that sort of stuff) and performance there has
> gone up noticeably, from around 30-40 fps in most cases to near 60.

Great, good to hear!
Now that we have narrowed down the issue to msitranslate (that should be
disabled by default anyway), I would like to fix it entirely if possible.
Could you please try the appended patch, without any other patches
(therefore msitranslate would still be enabled)?

Thanks for testing!!

---


diff --git a/hw/pass-through.c b/hw/pass-through.c
index 8581253..fc8c49f 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -3841,21 +3841,18 @@ static int pt_msgctrl_reg_write(struct pt_dev *ptdev,
                 PT_LOG("guest enabling MSI, disable MSI-INTx translation\n");
                 pt_disable_msi_translate(ptdev);
             }
-            else
+            /* Init physical one */
+            PT_LOG("setup msi for dev %x\n", pd->devfn);
+            if (pt_msi_setup(ptdev))
             {
-                /* Init physical one */
-                PT_LOG("setup msi for dev %x\n", pd->devfn);
-                if (pt_msi_setup(ptdev))
-                {
-                   /* We do not broadcast the error to the framework code, so
-                    * that MSI errors are contained in MSI emulation code and
-                    * QEMU can go on running.
-                    * Guest MSI would be actually not working.
-                    */
-                   *value &= ~PCI_MSI_FLAGS_ENABLE;
-                   PT_LOG("Warning: Can not map MSI for dev %x\n", pd->devfn);
-                   return 0;
-                }
+                /* We do not broadcast the error to the framework code, so
+                 * that MSI errors are contained in MSI emulation code and
+                 * QEMU can go on running.
+                 * Guest MSI would be actually not working.
+                 */
+                *value &= ~PCI_MSI_FLAGS_ENABLE;
+                PT_LOG("Warning: Can not map MSI for dev %x\n", pd->devfn);
+                return 0;
             }
             if (pt_msi_update(ptdev))
             {
diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 70c4023..73f737d 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -263,16 +263,8 @@ void pt_disable_msi_translate(struct pt_dev *dev)
     uint8_t e_device = 0;
     uint8_t e_intx = 0;
 
-    /* MSI_ENABLE bit should be disabed until the new handler is set */
-    msi_set_enable(dev, 0);
-
-    e_device = PCI_SLOT(dev->dev.devfn);
-    e_intx = pci_intx(dev);
-
-    if (xc_domain_unbind_pt_irq(xc_handle, domid, dev->msi->pirq,
-                                 PT_IRQ_TYPE_MSI_TRANSLATE, 0,
-                                 e_device, e_intx, 0))
-        PT_LOG("Error: Unbinding pt irq for MSI-INTx failed!\n");
+    pt_msi_disable(dev);
+    dev->msi->flags |= MSI_FLAG_UNINIT;
 
     if (dev->machine_irq)
     {
@@ -280,8 +272,6 @@ void pt_disable_msi_translate(struct pt_dev *dev)
                                        0, e_device, e_intx))
             PT_LOG("Error: Rebinding of interrupt failed!\n");
     }
-
-    dev->msi_trans_en = 0;
 }
 
 static int pt_msix_update_one(struct pt_dev *dev, int entry_nr)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.