[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~
- [PATCH v2 00/15] Base for adding PowerPC 64-bit instructions, Luis Pires, 2021/04/27
- [PATCH v2 05/15] target/ppc: Tidy exception vs exit_tb, Luis Pires, 2021/04/27
- [PATCH v2 06/15] target/ppc: Mark helper_raise_exception* as noreturn, Luis Pires, 2021/04/27
- [PATCH v2 07/15] target/ppc: Use translator_loop_temp_check, Luis Pires, 2021/04/27
- [PATCH v2 08/15] target/ppc: Add infrastructure for prefixed insns, Luis Pires, 2021/04/27
- [PATCH v2 09/15] target/ppc: Move ADDI, ADDIS to decodetree, implement PADDI, Luis Pires, 2021/04/27
- [PATCH v2 10/15] target/ppc: Implement PNOP, Luis Pires, 2021/04/27
- [PATCH v2 11/15] target/ppc: Move D/DS/X-form integer loads to decodetree, Luis Pires, 2021/04/27