qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Nicholas Piggin" <npiggin@gmail.com>, <qemu-devel@nongnu.org>
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	<qemu-ppc@nongnu.org>
Subject: Re: assert !temp_readonly(ts) in tcg_reg_alloc_op
Date: Fri, 07 Apr 2023 20:24:23 +1000	[thread overview]
Message-ID: <CRQG87D3J96O.2610UOHM3V36V@wheely> (raw)
In-Reply-To: <CRQEHNGPTSUM.34NYFP2RDLQA6@wheely>

On Fri Apr 7, 2023 at 7:02 PM AEST, Nicholas Piggin wrote:
> I get a crash running a powerpc64 TCG machine on x86.
>
> It can be triggered by booting a custom vmlinux patched to use powerpc
> prefix instructions and pcrel addressing, I don't know if that's related
> or coincidence. I can give Linux patches or a vmlinux file to reproduce
> if needed, or I can test patches quickly.
>
> The first bad commit is 7058ff5231a0 ("target/ppc: Avoid tcg_const_* in
> translate.c")

This seems to do the trick:

diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 9d05357d03..23869fe6cb 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -1807,8 +1807,8 @@ static inline void gen_op_arith_modw(DisasContext *ctx, TCGv ret, TCGv arg1,
         TCGv_i32 t2 = tcg_constant_i32(1);
         TCGv_i32 t3 = tcg_constant_i32(0);
         tcg_gen_movcond_i32(TCG_COND_EQ, t1, t1, t3, t2, t1);
-        tcg_gen_remu_i32(t3, t0, t1);
-        tcg_gen_extu_i32_tl(ret, t3);
+        tcg_gen_remu_i32(t1, t0, t1);
+        tcg_gen_extu_i32_tl(ret, t1);
     }
 }




  reply	other threads:[~2023-04-07 10:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07  9:02 assert !temp_readonly(ts) in tcg_reg_alloc_op Nicholas Piggin
2023-04-07 10:24 ` Nicholas Piggin [this message]
2023-04-07 16:50   ` Richard Henderson

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=CRQG87D3J96O.2610UOHM3V36V@wheely \
    --to=npiggin@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).