qemu-ppc
[Top][All Lists]
Advanced

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

RE: [PATCH v2 04/15] target/ppc: Move DISAS_NORETURN setting into gen_ex


From: Luis Fernando Fujita Pires
Subject: RE: [PATCH v2 04/15] target/ppc: Move DISAS_NORETURN setting into gen_exception*
Date: Thu, 29 Apr 2021 17:07:44 +0000

> > -static inline void gen_stop_exception(DisasContext *ctx)
> > +static inline void gen_end_tb_exception(DisasContext *ctx, uint32_t
> > +excp)
> >   {
> > -    gen_update_nip(ctx, ctx->base.pc_next);
> > -    ctx->exception = POWERPC_EXCP_STOP;
> > +    /* No need to update nip for SYNC/BRANCH, as execution flow will change
> */
> > +    if ((excp != POWERPC_EXCP_SYNC) &&
> > +        (excp != POWERPC_EXCP_BRANCH))
> > +    {
> > +        gen_update_nip(ctx, ctx->base.pc_next);
> > +    }
> > +    ctx->exception = excp;
> > +    ctx->base.is_jmp = DISAS_NORETURN;
> >   }
> 
> Hmm.  You didn't actually raise the exception, so you can't set
> DISAS_NORETURN that way.  It looks like you should be using
> gen_exception_nip().

This is reproducing the behavior that was implemented before the DISAS_NORETURN 
changes, that caused check-tcg to fail with an assertion otherwise.

IIUC, POWERPC_EXCP_{STOP,SYNC,BRANCH} are not really exceptions and, in these 
cases, ctx->exception is being used just to cause  ppc_tr_translate_insn() to 
end the translation block. If so, we should not be using ctx->exception for 
that, but I believe fixing that to not use ctx->exception belongs in a separate 
stand-alone patch.

> 
> And as side notes: (1) no need for extra parentheses, (2) brace is misplaced.
> 
> 
> r~

reply via email to

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