From: Qing He Subject: [PATCH] ioemu: fix INTx disable bit in MSI-INTx translation Date: Wed, 15 Apr 2009 21:40:52 +0800 Message-ID: <1239802852-8480-1-git-send-email-qing.he@intel.com> Return-path: In-Reply-To: <> References: <> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 --- 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 *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# */