diff mbox series

[v2,6/6] hw/vmapple: XHCI controller's interrupt mapping workaround for macOS

Message ID 20241213160619.66509-7-phil@philjordan.eu (mailing list archive)
State New, archived
Headers show
Series hw/usb/hcd-xhci: Fixes, improvements, and macOS workaround | expand

Commit Message

Phil Dennis-Jordan Dec. 13, 2024, 4:06 p.m. UTC
This change enables the new conditional interrupt mapping support
property on the vmapple machine type's integrated XHCI controller
using compat_props.

The macOS guest driver attempts to use event rings 1 and 2 on the XHCI
controller, despite there being only one (PCI pin) interrupt channel
available. With conditional interrupt mapping enabled, the XHCI
controller will only schedule events on interrupter 0 in PCI pin mode.

Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu>
---

v2:

 * Set the "conditional-intr-mapping" property via compat_props, not
   directly on the created XHCI controller object.

 hw/vmapple/vmapple.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/hw/vmapple/vmapple.c b/hw/vmapple/vmapple.c
index 66336942c8d..1732334c779 100644
--- a/hw/vmapple/vmapple.c
+++ b/hw/vmapple/vmapple.c
@@ -641,8 +641,19 @@  static void machvmapple_machine_init(void)
 }
 type_init(machvmapple_machine_init);
 
+static GlobalProperty vmapple_compat_defaults[] = {
+    /*
+     * macOS XHCI driver attempts to schedule events onto even rings 1 & 2
+     * even when (as here) there is no MSI(-X) support. Disabling interrupter
+     * mapping in the XHCI controller works around the problem.
+     */
+    { TYPE_QEMU_XHCI, "conditional-intr-mapping", "on" },
+};
+
 static void vmapple_machine_10_0_options(MachineClass *mc)
 {
+    compat_props_add(mc->compat_props, vmapple_compat_defaults,
+                     G_N_ELEMENTS(vmapple_compat_defaults));
 }
 DEFINE_VMAPPLE_MACHINE_AS_LATEST(10, 0)