From c4e21a4ad81b8d1457f02a4a29fa5bc55fcddc5c Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 25 May 2026 10:47:45 -0700 Subject: [PATCH] ppc: avoid QEMU IRQ lock inversion QEMU 10 and newer take the BQL inside ppc_set_irq(). The external interrupt path can call into QEMU while still holding the UAE PPC spinlock. That can deadlock if the main thread waits for QEMU BQL while the QEMU CPU thread waits for the UAE spinlock. Use the release-spinlock path for external interrupt injection. This matches the ordering used for QEMU memory mapping and state changes. --- ppc/ppc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppc/ppc.cpp b/ppc/ppc.cpp index 1b5df8f6..b9b315c3 100644 --- a/ppc/ppc.cpp +++ b/ppc/ppc.cpp @@ -939,7 +939,7 @@ void uae_ppc_interrupt(bool active) return; } - PPCLockStatus status = get_ppc_lock(PPC_KEEP_SPINLOCK); + PPCLockStatus status = get_ppc_lock(PPC_RELEASE_SPINLOCK); impl.external_interrupt(active); release_ppc_lock(status); } -- 2.47.3