target/s390x: move tcg_gen_insn_start to s390x_tr_insn_start

We use INDEX_op_insn_start to make the start of instruction boundaries.
If we don't do it in the .insn_start hook things get confused especially
now plugins want to use that marking to identify the start of instructions
and will bomb out if it sees instrumented ops before the first instruction
boundary.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20211011185332.166763-1-richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
Richard Henderson 2021-10-11 11:53:32 -07:00 committed by Alex Bennée
parent 6a78a987c6
commit 5d23d53023

View File

@ -138,6 +138,7 @@ struct DisasFields {
struct DisasContext { struct DisasContext {
DisasContextBase base; DisasContextBase base;
const DisasInsn *insn; const DisasInsn *insn;
TCGOp *insn_start;
DisasFields fields; DisasFields fields;
uint64_t ex_value; uint64_t ex_value;
/* /*
@ -6380,8 +6381,8 @@ static DisasJumpType translate_one(CPUS390XState *env, DisasContext *s)
/* Search for the insn in the table. */ /* Search for the insn in the table. */
insn = extract_insn(env, s); insn = extract_insn(env, s);
/* Emit insn_start now that we know the ILEN. */ /* Update insn_start now that we know the ILEN. */
tcg_gen_insn_start(s->base.pc_next, s->cc_op, s->ilen); tcg_set_insn_start_param(s->insn_start, 2, s->ilen);
/* Not found means unimplemented/illegal opcode. */ /* Not found means unimplemented/illegal opcode. */
if (insn == NULL) { if (insn == NULL) {
@ -6552,6 +6553,11 @@ static void s390x_tr_tb_start(DisasContextBase *db, CPUState *cs)
static void s390x_tr_insn_start(DisasContextBase *dcbase, CPUState *cs) static void s390x_tr_insn_start(DisasContextBase *dcbase, CPUState *cs)
{ {
DisasContext *dc = container_of(dcbase, DisasContext, base);
/* Delay the set of ilen until we've read the insn. */
tcg_gen_insn_start(dc->base.pc_next, dc->cc_op, 0);
dc->insn_start = tcg_last_op();
} }
static void s390x_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) static void s390x_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)