From: Stefan Reinauer Date: Mon, 25 May 2026 17:47:45 +0000 (-0700) Subject: ppc: avoid QEMU IRQ lock inversion X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=c4e21a4ad81b8d1457f02a4a29fa5bc55fcddc5c;p=francis%2Fwinuae.git 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. --- 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); }