qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] This patch fixes processing of rfi instructions


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH] This patch fixes processing of rfi instructions in icount mode.
Date: Thu, 8 Nov 2018 12:09:51 +1100
User-agent: Mutt/1.10.1 (2018-07-13)

On Wed, Nov 07, 2018 at 06:25:19PM +0000, Mark Cave-Ayland wrote:
> On 30/10/2018 12:21, Pavel Dovgalyuk wrote:
> 
> > From: Maria Klimushenkova <address@hidden>
> > 
> > In this mode writing to interrupt/peripheral state is controlled
> > by can_do_io flag. This flag must be set explicitly before helper
> > function invocation.
> > 
> > Signed-off-by: Maria Klimushenkova <address@hidden>
> > Signed-off-by: Pavel Dovgalyuk <address@hidden>
> > ---
> >  target/ppc/translate.c |   12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> > index 987ce6e..980862c 100644
> > --- a/target/ppc/translate.c
> > +++ b/target/ppc/translate.c
> > @@ -3878,9 +3878,15 @@ static void gen_rfi(DisasContext *ctx)
> >      }
> >      /* Restore CPU state */
> >      CHK_SV;
> > +    if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
> > +        gen_io_start();
> > +    }
> >      gen_update_cfar(ctx, ctx->base.pc_next - 4);
> >      gen_helper_rfi(cpu_env);
> >      gen_sync_exception(ctx);
> > +    if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
> > +        gen_io_end();
> > +    }
> >  #endif
> >  }
> >  
> > @@ -3892,9 +3898,15 @@ static void gen_rfid(DisasContext *ctx)
> >  #else
> >      /* Restore CPU state */
> >      CHK_SV;
> > +    if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
> > +        gen_io_start();
> > +    }
> >      gen_update_cfar(ctx, ctx->base.pc_next - 4);
> >      gen_helper_rfid(cpu_env);
> >      gen_sync_exception(ctx);
> > +    if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
> > +        gen_io_end();
> > +    }
> >  #endif
> >  }
> 
> I've given this patch a spin on top of ppc-for-3.1 and it allows my test 
> images to
> boot with icount enabled without asserting, so:
> 
> Tested-by: Mark Cave-Ayland <address@hidden>

Good enough for me.  Applied to ppc-for-3.1.

-- 
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

Attachment: signature.asc
Description: PGP signature


reply via email to

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