[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 6/6] hw/vmapple: XHCI controller's interrupt mapping workaroun
From: |
Phil Dennis-Jordan |
Subject: |
[PATCH v3 6/6] hw/vmapple: XHCI controller's interrupt mapping workaround for macOS |
Date: |
Fri, 27 Dec 2024 13:13:36 +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.
v3:
* Moved the compat global property table into vmapple patch set -v16,
now just add the conditional-intr-mapping property to it.
* Set the property on any device implementing the abstract TYPE_XHCI_PCI
rather than only the TYPE_QEMU_XHCI device specifically. (So the
NEC controller works with the vmapple machine type too.)
hw/vmapple/vmapple.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/hw/vmapple/vmapple.c b/hw/vmapple/vmapple.c
index 41e3d7d189..ec0896dd32 100644
--- a/hw/vmapple/vmapple.c
+++ b/hw/vmapple/vmapple.c
@@ -38,7 +38,7 @@
#include "hw/intc/arm_gicv3_common.h"
#include "hw/misc/pvpanic.h"
#include "hw/pci-host/gpex.h"
-#include "hw/usb/xhci.h"
+#include "hw/usb/hcd-xhci-pci.h"
#include "hw/virtio/virtio-pci.h"
#include "hw/vmapple/vmapple.h"
#include "net/net.h"
@@ -562,6 +562,12 @@ static const CPUArchIdList
*vmapple_possible_cpu_arch_ids(MachineState *ms)
static GlobalProperty vmapple_compat_defaults[] = {
{ TYPE_VIRTIO_PCI, "disable-legacy", "on" },
+ /*
+ * 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_XHCI_PCI, "conditional-intr-mapping", "on" },
};
static void vmapple_machine_class_init(ObjectClass *oc, void *data)
--
2.39.5 (Apple Git-154)
- [PATCH v3 0/6] hw/usb/hcd-xhci: Fixes, improvements, and macOS workaround, Phil Dennis-Jordan, 2024/12/27
- [PATCH v3 5/6] hw/usb/hcd-xhci-pci: Adds property for disabling mapping in IRQ mode, Phil Dennis-Jordan, 2024/12/27
- [PATCH v3 3/6] hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsupported, Phil Dennis-Jordan, 2024/12/27
- [PATCH v3 1/6] hw/usb/hcd-xhci-pci: Use modulo to select MSI vector as per spec, Phil Dennis-Jordan, 2024/12/27
- [PATCH v3 2/6] hw/usb/hcd-xhci-pci: Move msi/msix properties from NEC to superclass, Phil Dennis-Jordan, 2024/12/27
- [PATCH v3 4/6] hw/usb/hcd-xhci: Unimplemented/guest error logging for port MMIO, Phil Dennis-Jordan, 2024/12/27
- [PATCH v3 6/6] hw/vmapple: XHCI controller's interrupt mapping workaround for macOS,
Phil Dennis-Jordan <=