Skip to contentSkip to conversation

ioemu: fix INTx disable bit in MSI-INTx translation

PATCH In review Qing He 2 participants 3 messages Apr 15, 2009 – Apr 16, 2009

lore
Share & tools
lore

Qing He

author
#0 lore raw

PATCH 1/1 ioemu: fix INTx disable bit in MSI-INTx translation

Fix the bug introduced in commit 8c771eb6: when msi-intx translation is enabled, int disable bit in PCI_COMMAND is set. This approach has two issues:
1. for some (buggy) devices, set INTx bit will also disable MSI so that MSI doesn't work any more.
2. it's never re-enabled when msi translation is turned off. If the guest uses INTx, it can't receive any interrupts from then.

This patch leaves INTx disable bit unset if MSI-INTx translation is used.

---

hw/pass-through.c +3 -1
index 95b4a47..d16f177 100644
@@ -3769,9 +3769,11 @@ static struct pt_dev * register_real_device(PCIBus *e_bus,
 
     /* setup MSI-INTx translation if support */
     rc = pt_enable_msi_translate(assigned_device);
+    if (rc == 0)
+        goto out;
 
     /* bind machine_irq to device */
-    if (rc < 0 && machine_irq != 0)
+    if (machine_irq != 0)
     {
         e_device = (assigned_device->dev.devfn >> 3) & 0x1f;
         /* fix virtual interrupt pin to INTA# */
#1 lore raw
Quoted 11 lines · On Wed, 15 Apr 2009 21:40:52 +0800 Qing He <[email protected]> wrote:

Fix the bug introduced in commit 8c771eb6: when msi-intx translation is enabled, int disable bit in PCI_COMMAND is set. This approach has two issues:
1. for some (buggy) devices, set INTx bit will also disable MSI so that MSI doesn't work any more.
2. it's never re-enabled when msi translation is turned off. If the guest uses INTx, it can't receive any interrupts from then.

This patch leaves INTx disable bit unset if MSI-INTx translation is used.

I have sent the patch to fix the issue that you pointed out.

The following patch is.
http://lists.xensource.com/archives/html/xen-devel/2009-04/msg00300.html

The patch has already applied in commit 290b6d18585c887ff2cfa30b239aa2fecfcd0308.

Your changeset seem to be old.
Could you test the latest qemu-xen?

Thanks,
--
Yuji Shimada

author
#2 lore raw
Quoted 15 lines · Yuji Shimada
Quoted 11 lines · On Wed, 15 Apr 2009 21:40:52 +0800 Qing He <[email protected]> wrote:

Fix the bug introduced in commit 8c771eb6: when msi-intx translation is enabled, int disable bit in PCI_COMMAND is set. This approach has two issues:
1. for some (buggy) devices, set INTx bit will also disable MSI so that MSI doesn't work any more.
2. it's never re-enabled when msi translation is turned off. If the guest uses INTx, it can't receive any interrupts from then.

This patch leaves INTx disable bit unset if MSI-INTx translation is used.

Quoted 6 lines

I have sent the patch to fix the issue that you pointed out.

The following patch is.
http://lists.xensource.com/archives/html/xen-devel/2009-04/msg00300.html

The patch has already applied in commit 290b6d18585c887ff2cfa30b239aa2fecfcd0308.

Seems I didn't notice that. I'll have a look.

Thanks,
Qing

Quoted 8 lines

Your changeset seem to be old.
Could you test the latest qemu-xen?

Thanks,
--
Yuji Shimada