aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/hcd-xhci-sysbus.c
diff options
context:
space:
mode:
authorRuimei Yan <ruimei.yan@windriver.com>2021-05-21 10:42:24 +0800
committerGerd Hoffmann <kraxel@redhat.com>2021-05-28 09:10:20 +0200
commitfc967aad408eb4777b099d17ada1f39be5f6fd2e (patch)
tree45b56123354608ea6b9fa00361eb8686e4e37656 /hw/usb/hcd-xhci-sysbus.c
parent3c6151cd11ae7e4a7dae10f8c17ab1fe2f0a73bf (diff)
downloadqemu-fc967aad408eb4777b099d17ada1f39be5f6fd2e.zip
qemu-fc967aad408eb4777b099d17ada1f39be5f6fd2e.tar.gz
qemu-fc967aad408eb4777b099d17ada1f39be5f6fd2e.tar.bz2
hw/usb: hcd-xhci-pci: Fix spec violation of IP flag for MSI/MSI-X
Per xHCI spec v1.2 chapter 4.17.5 page 296: If MSI or MSI-X interrupts are enabled, Interrupt Pending (IP) shall be cleared automatically when the PCI dword write generated by the interrupt assertion is complete. Currently QEMU does not clear the IP flag in the MSI / MSI-X mode. This causes subsequent spurious interrupt to be delivered to guests. To solve this, we change the xhci intr_raise() hook routine to have a bool return value that is passed to its caller (the xhci core), with true indicating that IP should be self-cleared. Fixes: 62c6ae04cf43 ("xhci: Initial xHCI implementation") Fixes: 4c47f800631a ("xhci: add msix support") Signed-off-by: Ruimei Yan <ruimei.yan@windriver.com> [bmeng: move IP clear codes from xhci pci to xhci core] Signed-off-by: Bin Meng <bin.meng@windriver.com> Message-Id: <20210521024224.2277634-2-bmeng.cn@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/hcd-xhci-sysbus.c')
-rw-r--r--hw/usb/hcd-xhci-sysbus.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/usb/hcd-xhci-sysbus.c b/hw/usb/hcd-xhci-sysbus.c
index 42e2574..a14e438 100644
--- a/hw/usb/hcd-xhci-sysbus.c
+++ b/hw/usb/hcd-xhci-sysbus.c
@@ -16,11 +16,13 @@
#include "hw/acpi/aml-build.h"
#include "hw/irq.h"
-static void xhci_sysbus_intr_raise(XHCIState *xhci, int n, bool level)
+static bool xhci_sysbus_intr_raise(XHCIState *xhci, int n, bool level)
{
XHCISysbusState *s = container_of(xhci, XHCISysbusState, xhci);
qemu_set_irq(s->irq[n], level);
+
+ return false;
}
void xhci_sysbus_reset(DeviceState *dev)