Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Morello instruction tracing nops #257

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion include/exec/exec-all.h
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,14 @@ static inline uint32_t tb_cflags(const TranslationBlock *tb)
/* current cflags for hashing/comparison */
static inline uint32_t curr_cflags(CPUState *cpu)
{
return cpu->tcg_cflags;
uint32_t cflags = cpu->tcg_cflags;

#ifdef CONFIG_TCG_LOG_INSTR
if (cpu->log_state.loglevel_active && qemu_loglevel_mask(CPU_LOG_INSTR)) {
cflags |= CF_LOG_INSTR;
}
#endif
return cflags;
}

/* TranslationBlock invalidate API */
Expand Down
25 changes: 25 additions & 0 deletions target/arm/translate-a64.c
Original file line number Diff line number Diff line change
Expand Up @@ -2697,7 +2697,32 @@ static void disas_exc(DisasContext *s, uint32_t insn)
#endif
gen_exception_internal_insn(s, s->pc_curr, EXCP_SEMIHOST);
} else {
#ifdef CONFIG_TCG_LOG_INSTR
TCGv tpc = tcg_const_tl(s->base.pc_next);
switch (imm16) {
case 0xff00:
gen_helper_qemu_log_instr_start(cpu_env, tpc);
s->base.is_jmp = DISAS_EXIT;
break;
case 0xff01:
gen_helper_qemu_log_instr_stop(cpu_env, tpc);
s->base.is_jmp = DISAS_EXIT;
break;
case 0xff02:
gen_helper_qemu_log_instr_user_start(cpu_env, tpc);
s->base.is_jmp = DISAS_EXIT;
break;
default:
unsupported_encoding(s, insn);
}
tcg_temp_free(tpc);

if (s->base.is_jmp != DISAS_NEXT) {
gen_a64_set_pc_im(s->base.pc_next);
}
#else
unsupported_encoding(s, insn);
#endif
}
break;
case 5:
Expand Down
Loading