qemu/hw/usb
Phil Dennis-Jordan 9422a5acf2 hw/usb/hcd-xhci-pci: Adds property for disabling mapping in IRQ mode
This change addresses an edge case that trips up macOS guest drivers
for PCI based XHCI controllers. The guest driver would attempt to
schedule events to XHCI event rings 1 and 2 even when using PCI
pin-based interrupts. Interrupts would therefore be dropped, and events
only handled on timeout.

So, in addition to disabling interrupter mapping if numintrs is 1, a
callback is added to xhci to check whether interrupter mapping should be
enabled. The PCI XHCI device type now provides an implementation of
this callback if the new "conditional-intr-mapping" property is enabled.
(default: disabled) When enabled, interrupter mapping is only enabled
when MSI-X or MSI is active.

This means that when using pin-based interrupts, events are only
submitted to interrupter 0 regardless of selected target. This allows
the macOS guest drivers to work with the device in those configurations.

Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2705
Message-ID: <20241227121336.25838-6-phil@philjordan.eu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2025-03-04 14:45:34 +01:00
..
bus-stub.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
bus.c hw/usb: Inline usb_new() 2025-01-13 17:07:00 +01:00
canokey.c hw/usb/canokey: Fix buffer overflow for OUT packet 2025-01-28 18:40:19 +00:00
canokey.h hw/usb/canokey: Fix buffer overflow for OUT packet 2025-01-28 18:40:19 +00:00
ccid-card-emulated.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
ccid-card-passthru.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
ccid.h Use OBJECT_DECLARE_TYPE when possible 2020-09-18 14:12:32 -04:00
chipidea.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
combined-packet.c usb: limit combined packets to 1 MiB (CVE-2021-3527) 2021-05-05 15:06:01 +02:00
core.c usb: add pcap support. 2021-01-22 14:51:35 +01:00
desc-msos.c hw/usb: Fix typo in comments and print 2021-09-01 06:37:13 +02:00
desc.c hw/usb: Silence compiler warnings in USB code when compiling with -Wshadow 2023-10-06 13:27:48 +02:00
desc.h usb: allow max 8192 bytes for desc 2022-01-13 10:22:37 +01:00
dev-audio.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
dev-hid.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
dev-hub.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
dev-mtp.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
dev-network.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
dev-serial.c hw/usb: Inline usb_new() 2025-01-13 17:07:00 +01:00
dev-smartcard-reader.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
dev-storage-bot.c Don't include headers already included by qemu/osdep.h 2023-02-08 07:28:05 +01:00
dev-storage-classic.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
dev-storage.c hw/usb/msd: Add status to usb_msd_packet_complete() function 2024-12-14 00:16:20 +01:00
dev-uas.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
dev-wacom.c hw/usb: fix tab indentation 2022-11-08 11:13:48 +01:00
hcd-dwc2.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
hcd-dwc2.h include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
hcd-dwc3.c hw/usb/hcd-dwc3: Align global registers size with Linux 2025-02-25 15:32:58 +00:00
hcd-ehci-pci.c hw: Declare various const data as 'const' 2025-02-16 14:26:07 +01:00
hcd-ehci-sysbus.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
hcd-ehci.c hw/usb/hcd-ehci: Fix debug printf format string 2025-01-31 19:36:44 +01:00
hcd-ehci.h include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
hcd-ohci-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
hcd-ohci-sysbus.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
hcd-ohci.c hw/usb/hcd-ohci: Fix ohci_service_td: accept zero-length TDs where CBP=BE+1 2024-06-21 16:20:45 +01:00
hcd-ohci.h include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
hcd-uhci.c hw: Declare various const data as 'const' 2025-02-16 14:26:07 +01:00
hcd-uhci.h hw/usb/uhci: Rename NB_PORTS -> UHCI_PORTS 2024-02-20 20:34:21 +03:00
hcd-xhci-nec.c hw/usb/hcd-xhci-pci: Move msi/msix properties from NEC to superclass 2024-12-31 21:21:34 +01:00
hcd-xhci-pci.c hw/usb/hcd-xhci-pci: Adds property for disabling mapping in IRQ mode 2025-03-04 14:45:34 +01:00
hcd-xhci-pci.h hw/usb/hcd-xhci-pci: Adds property for disabling mapping in IRQ mode 2025-03-04 14:45:34 +01:00
hcd-xhci-sysbus.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
hcd-xhci-sysbus.h usb/xhci: add include/hw/usb/xhci.h header file 2020-10-21 11:36:19 +02:00
hcd-xhci.c hw/usb/hcd-xhci-pci: Adds property for disabling mapping in IRQ mode 2025-03-04 14:45:34 +01:00
hcd-xhci.h hw/usb/hcd-xhci-pci: Adds property for disabling mapping in IRQ mode 2025-03-04 14:45:34 +01:00
host-libusb.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
imx-usb-phy.c hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
Kconfig Kconfig: Extract CONFIG_USB_CHIPIDEA from CONFIG_IMX 2025-02-20 14:20:29 +00:00
libhw.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
meson.build Kconfig: Extract CONFIG_USB_CHIPIDEA from CONFIG_IMX 2025-02-20 14:20:29 +00:00
pcap.c usb/pcap: set flag_setup 2021-02-17 14:29:12 +01:00
quirks-ftdi-ids.h hw/usb: Fix typo in comments and print 2021-09-01 06:37:13 +02:00
quirks-pl2303-ids.h hw/usb: fix tab indentation 2022-11-08 11:13:48 +01:00
quirks.c hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB 2020-03-16 23:02:25 +01:00
quirks.h hw/usb: spelling fixes 2023-08-31 19:47:43 +02:00
redirect.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
trace-events hw/usb/hcd-ohci: Fix ohci_service_td: accept zero-length TDs where CBP=BE+1 2024-06-21 16:20:45 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
u2f-emulated.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
u2f-passthru.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
u2f.c hw/usb: Constify VMState 2023-12-30 07:38:06 +11:00
u2f.h hw/usb/u2f: Declare QOM macros using OBJECT_DECLARE_TYPE() 2023-02-27 22:29:02 +01:00
vt82c686-uhci-pci.c hw/usb/vt82c686-uhci-pci: Use ISA instead of PCI interrupts 2023-11-28 14:26:37 +01:00
xen-usb.c hw/xen: Prefer QOM cast for XenLegacyDevice 2025-02-16 14:25:08 +01:00
xlnx-usb-subsystem.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
xlnx-versal-usb2-ctrl-regs.c hw, target: Add ResetType argument to hold and exit phase methods 2024-04-25 10:21:06 +01:00