This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] [PATCH] ioemu: fix INTx disable bit in MSI-INTx translation

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] ioemu: fix INTx disable bit in MSI-INTx translation
From: Qing He <qing.he@xxxxxxxxx>
Date: Wed, 15 Apr 2009 21:40:52 +0800
Delivery-date: Wed, 15 Apr 2009 06:39:08 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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.

Signed-off-by: Qing He <qing.he@xxxxxxxxx>
diff --git a/hw/pass-through.c b/hw/pass-through.c
index 95b4a47..d16f177 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -3769,9 +3769,11 @@ static struct pt_dev * register_real_device(PCIBus 
     /* 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# */

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>