]> Git Repo - qemu.git/commitdiff
hw/ppc: Fix iothread locking in the 405 code
authorThomas Huth <[email protected]>
Wed, 6 Oct 2021 07:11:40 +0000 (09:11 +0200)
committerDavid Gibson <[email protected]>
Thu, 21 Oct 2021 00:42:47 +0000 (11:42 +1100)
When using u-boot as firmware with the taihu board, QEMU aborts with
this assertion:

 ERROR:../accel/tcg/tcg-accel-ops.c:79:tcg_handle_interrupt: assertion failed:
  (qemu_mutex_iothread_locked())

Running QEMU with "-d in_asm" shows that the crash happens when writing
to SPR 0x3f2, so we are missing to lock the iothread in the code path
here.

Signed-off-by: Thomas Huth <[email protected]>
Message-Id: <20211006071140[email protected]>
Reviewed-by: Cédric Le Goater <[email protected]>
Tested-by: Cédric Le Goater <[email protected]>
Signed-off-by: David Gibson <[email protected]>
hw/ppc/ppc.c

index a724b0bb5ecbd092684d0466a29ee2998675a59b..e8127599c9073e77decebbf3a828ac6b1b39d056 100644 (file)
@@ -336,6 +336,8 @@ void store_40x_dbcr0(CPUPPCState *env, uint32_t val)
 {
     PowerPCCPU *cpu = env_archcpu(env);
 
+    qemu_mutex_lock_iothread();
+
     switch ((val >> 28) & 0x3) {
     case 0x0:
         /* No action */
@@ -353,6 +355,8 @@ void store_40x_dbcr0(CPUPPCState *env, uint32_t val)
         ppc40x_system_reset(cpu);
         break;
     }
+
+    qemu_mutex_unlock_iothread();
 }
 
 /* PowerPC 40x internal IRQ controller */
This page took 0.025369 seconds and 4 git commands to generate.