qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 6/6] hw/vmapple: XHCI controller's interrupt mapping workaroun


From: Phil Dennis-Jordan
Subject: [PATCH v2 6/6] hw/vmapple: XHCI controller's interrupt mapping workaround for macOS
Date: Fri, 13 Dec 2024 17:06:19 +0100

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 --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)
 
-- 
2.39.5 (Apple Git-154)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]