aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2021-10-06 09:11:40 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2021-10-21 11:42:47 +1100
commit5ae3d2e8ba37def4b3ca38f220200bf5721317e0 (patch)
treefc79222a450a2c1b40e091f6a8a7cf8101d4d530 /hw
parent644c68696e8335f80d4a9295db0445505e24d8e2 (diff)
hw/ppc: Fix iothread locking in the 405 code
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 <thuth@redhat.com> Message-Id: <20211006071140.565952-1-thuth@redhat.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Tested-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw')
-rw-r--r--hw/ppc/ppc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
index a724b0bb5e..e8127599c9 100644
--- a/hw/ppc/ppc.c
+++ b/hw/ppc/ppc.c
@@ -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 */