[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v17 02/11] hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsup
From: |
Phil Dennis-Jordan |
Subject: |
[PATCH v17 02/11] hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsupported |
Date: |
Sun, 12 Jan 2025 22:00:47 +0100 |
The XHCI specification, section 4.17.1 specifies that "If the
Number of Interrupters (MaxIntrs) field is greater than 1, then
Interrupter Mapping shall be supported." and "If Interrupter
Mapping is not supported, the Interrupter Target field shall be
ignored by the xHC and all Events targeted at Interrupter 0."
QEMU's XHCI device has so far not specially addressed this case,
so we add a check to xhci_event() to redirect to event ring and
interrupt 0 if mapping is disabled.
Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/usb/hcd-xhci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 7dc0994c89..00d5bc3779 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -644,6 +644,10 @@ static void xhci_event(XHCIState *xhci, XHCIEvent *event,
int v)
dma_addr_t erdp;
unsigned int dp_idx;
+ if (xhci->numintrs == 1) {
+ v = 0;
+ }
+
if (v >= xhci->numintrs) {
DPRINTF("intr nr out of range (%d >= %d)\n", v, xhci->numintrs);
return;
--
2.39.5 (Apple Git-154)
- [PATCH v17 00/11] New vmapple machine type and xhci fixes, Phil Dennis-Jordan, 2025/01/12
- [PATCH v17 01/11] hw/usb/hcd-xhci-pci: Use modulo to select MSI vector as per spec, Phil Dennis-Jordan, 2025/01/12
- [PATCH v17 03/11] hw: Add vmapple subdir, Phil Dennis-Jordan, 2025/01/12
- [PATCH v17 02/11] hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsupported,
Phil Dennis-Jordan <=
- [PATCH v17 04/11] hw/misc/pvpanic: Add MMIO interface, Phil Dennis-Jordan, 2025/01/12
- [PATCH v17 06/11] hw/vmapple/bdif: Introduce vmapple backdoor interface, Phil Dennis-Jordan, 2025/01/12
- [PATCH v17 07/11] hw/vmapple/cfg: Introduce vmapple cfg region, Phil Dennis-Jordan, 2025/01/12
- [PATCH v17 05/11] hw/vmapple/aes: Introduce aes engine, Phil Dennis-Jordan, 2025/01/12
- [PATCH v17 10/11] hw/intc: Remove TCG dependency on ARM_GICV3, Phil Dennis-Jordan, 2025/01/12
- [PATCH v17 09/11] hw/usb/hcd-xhci-pci: Adds property for disabling mapping in IRQ mode, Phil Dennis-Jordan, 2025/01/12
- [PATCH v17 08/11] hw/vmapple/virtio-blk: Add support for apple virtio-blk, Phil Dennis-Jordan, 2025/01/12
- [PATCH v17 11/11] hw/vmapple/vmapple: Add vmapple machine type, Phil Dennis-Jordan, 2025/01/12