qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/ppc: Fix iothread locking in the 405 code


From: Cédric Le Goater
Subject: Re: [PATCH] hw/ppc: Fix iothread locking in the 405 code
Date: Wed, 6 Oct 2021 10:15:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0

On 10/6/21 09:11, Thomas Huth wrote:
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>

Reviewed-by: Cédric Le Goater <clg@kaod.org>
Tested-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

---
  hw/ppc/ppc.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
index f5d012f860..bb57f1c9ed 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 */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]