All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Horak <thement@ibawizard.net>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] Bug in ppc/BookE wait instruction
Date: Mon, 6 Jun 2016 10:47:28 +0200	[thread overview]
Message-ID: <20160606084728.GB24720@ibawizard> (raw)
In-Reply-To: <20160606013441.GF9226@voom.fritz.box>


Hello,

David Gibson (david@gibson.dropbear.id.au) wrote:
> On Fri, Jun 03, 2016 at 05:45:49PM +0200, Jakub Horak wrote:
> > Hello,
> > I think there's a bug in "wait" instruction code generator for PowerPC
> > architecture. It doesn't make sense to store a non-initialized register.
> > 
> > Best regards,
> > Jakub Horak
> 
> The fix looks correct, but I need a Signed-off-by line in order to
> apply it.

Here you go:

    Fixed bug in code generator.
    
    Signed-off-by: Jakub Horak <thement@ibawizard.net>

diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index f5ceae5..6af567b 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -3439,7 +3439,7 @@ static void gen_sync(DisasContext *ctx)
 /* wait */
 static void gen_wait(DisasContext *ctx)
 {
-    TCGv_i32 t0 = tcg_temp_new_i32();
+    TCGv_i32 t0 = tcg_const_i32(1);
     tcg_gen_st_i32(t0, cpu_env,
                    -offsetof(PowerPCCPU, env) + offsetof(CPUState, halted));
     tcg_temp_free_i32(t0);


> 
> In future, please send such patches to myself and Alex Graf
> (target-ppc maintainers) the qemu-ppc list as well as qemu-devel.  I
> wouldn't have spotted this if Marc Cave-Ayland hadn't copied it to me.

Sorry, I'll be more thoughtful next time.

Best regards,
Jakub 

> 
> > 
> > 
> > diff --git a/target-ppc/translate.c b/target-ppc/translate.c
> > index f5ceae5..6af567b 100644
> > --- a/target-ppc/translate.c
> > +++ b/target-ppc/translate.c
> > @@ -3439,7 +3439,7 @@ static void gen_sync(DisasContext *ctx)
> >  /* wait */
> >  static void gen_wait(DisasContext *ctx)
> >  {
> > -    TCGv_i32 t0 = tcg_temp_new_i32();
> > +    TCGv_i32 t0 = tcg_const_i32(1);
> >      tcg_gen_st_i32(t0, cpu_env,
> >                     -offsetof(PowerPCCPU, env) + offsetof(CPUState, halted));
> >      tcg_temp_free_i32(t0);
> > 
> 
> -- 
> David Gibson			| I'll have my music baroque, and my code
> david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
> 				| _way_ _around_!
> http://www.ozlabs.org/~dgibson

  reply	other threads:[~2016-06-06  8:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03 15:45 [Qemu-devel] Bug in ppc/BookE wait instruction Jakub Horak
2016-06-03 17:11 ` Mark Cave-Ayland
2016-06-06  1:34 ` David Gibson
2016-06-06  8:47   ` Jakub Horak [this message]
2016-06-15  4:06     ` [Qemu-devel] [Qemu-ppc] " 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=20160606084728.GB24720@ibawizard \
    --to=thement@ibawizard.net \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.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 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.