From 23d769c8562523c9b073577a9cd1f23d84b9b182 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sun, 4 Mar 2018 20:34:31 -0500 Subject: [PATCH] target/arm: Move ss check to init_disas_context We can check for single-step just once. Backports commit f7708456aac23a8bb8864b12bcf1f20c6e4b7045 from qemu --- qemu/target/arm/translate.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/qemu/target/arm/translate.c b/qemu/target/arm/translate.c index 259d160e..8601af99 100644 --- a/qemu/target/arm/translate.c +++ b/qemu/target/arm/translate.c @@ -12093,6 +12093,11 @@ static int arm_tr_init_disas_context(DisasContextBase *dcbase, dc->next_page_start = (dc->base.pc_first & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE; + /* If architectural single step active, limit to 1. */ + if (is_singlestepping(dc)) { + max_insns = 1; + } + tcg_ctx->cpu_F0s = tcg_temp_new_i32(tcg_ctx); tcg_ctx->cpu_F1s = tcg_temp_new_i32(tcg_ctx); tcg_ctx->cpu_F0d = tcg_temp_new_i64(tcg_ctx); @@ -12252,11 +12257,9 @@ static void arm_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) * Also stop translation when a page boundary is reached. This * ensures prefetch aborts occur at the right place. */ - if (is_singlestepping(dc)) { - dc->base.is_jmp = DISAS_TOO_MANY; - } else if ((dc->pc >= dc->next_page_start) || - ((dc->pc >= dc->next_page_start - 3) && - insn_crosses_page(env, dc))) { + if (dc->pc >= dc->next_page_start || + (dc->pc >= dc->next_page_start - 3 && + insn_crosses_page(env, dc))) { /* We want to stop the TB if the next insn starts in a new page, * or if it spans between this page and the next. This means that * if we're looking at the last halfword in the page we need to