Message ID | 20221118091858.242569-7-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | main-loop: Introduce QEMU_IOTHREAD_LOCK_GUARD | expand |
On 11/18/22 06:18, Richard Henderson wrote: > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > Cc: qemu-ppc@nongnu.org > --- Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> > hw/ppc/ppc.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > > 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 */
On 18/11/22 10:18, Richard Henderson wrote: > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > Cc: qemu-ppc@nongnu.org > --- > hw/ppc/ppc.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
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 */
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- Cc: qemu-ppc@nongnu.org --- hw/ppc/ppc.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)