All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: Thomas Huth <thuth@redhat.com>, <qemu-devel@nongnu.org>
Cc: qemu-ppc@nongnu.org, Greg Kurz <groug@kaod.org>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH] hw/ppc: Fix iothread locking in the 405 code
Date: Wed, 6 Oct 2021 10:15:16 +0200	[thread overview]
Message-ID: <673d7ff6-6a5a-b672-7182-0d1a39ad83e1@kaod.org> (raw)
In-Reply-To: <20211006071140.565952-1-thuth@redhat.com>

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	other threads:[~2021-10-06  8:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06  7:11 [PATCH] hw/ppc: Fix iothread locking in the 405 code Thomas Huth
2021-10-06  8:15 ` Cédric Le Goater [this message]
2021-10-07  0:48 ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=673d7ff6-6a5a-b672-7182-0d1a39ad83e1@kaod.org \
    --to=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.