From: Richard Henderson Date: Fri, 18 Nov 2022 03:17:18 +0000 (-0800) Subject: hw/ppc: Use QEMU_IOTHREAD_LOCK_GUARD in ppc_set_irq X-Git-Tag: qemu-xen-4.18.0-rc5~367^2~37 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=50c9c512ac15e8eeb0ec63f6a92ba8e017e7676e;p=qemu-xen.git hw/ppc: Use QEMU_IOTHREAD_LOCK_GUARD in ppc_set_irq Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index dc86c1c7db..4e816c68c7 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -44,13 +44,9 @@ void ppc_set_irq(PowerPCCPU *cpu, int irq, int level) { CPUPPCState *env = &cpu->env; unsigned int old_pending; - bool locked = false; /* We may already have the BQL if coming from the reset path */ - if (!qemu_mutex_iothread_locked()) { - locked = true; - qemu_mutex_lock_iothread(); - } + QEMU_IOTHREAD_LOCK_GUARD(); old_pending = env->pending_interrupts; @@ -67,10 +63,6 @@ void ppc_set_irq(PowerPCCPU *cpu, int irq, int level) trace_ppc_irq_set_exit(env, irq, level, env->pending_interrupts, CPU(cpu)->interrupt_request); - - if (locked) { - qemu_mutex_unlock_iothread(); - } } /* PowerPC 6xx / 7xx internal IRQ controller */