diff mbox

[v14,32/34] target/arm: Move ss check to init_disas_context

Message ID 20170715094243.28371-33-rth@twiddle.net (mailing list archive)
State New, archived
Headers show

Commit Message

Richard Henderson July 15, 2017, 9:42 a.m. UTC
We can check for single-step just once.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target/arm/translate.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Emilio Cota July 21, 2017, 11:17 p.m. UTC | #1
On Fri, Jul 14, 2017 at 23:42:41 -1000, Richard Henderson wrote:
> We can check for single-step just once.
> 
> Signed-off-by: Richard Henderson <rth@twiddle.net>

Reviewed-by: Emilio G. Cota <cota@braap.org>

		E.
Lluís Vilanova July 22, 2017, 9:07 a.m. UTC | #2
Richard Henderson writes:

> We can check for single-step just once.
> Signed-off-by: Richard Henderson <rth@twiddle.net>

Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>


> ---
>  target/arm/translate.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)

> diff --git a/target/arm/translate.c b/target/arm/translate.c
> index 4b1230b..ebe1c1a 100644
> --- a/target/arm/translate.c
> +++ b/target/arm/translate.c
> @@ -11845,6 +11845,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;
> +    }
> +
>      cpu_F0s = tcg_temp_new_i32();
>      cpu_F1s = tcg_temp_new_i32();
>      cpu_F0d = tcg_temp_new_i64();
> @@ -12000,11 +12005,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
> -- 
> 2.9.4
diff mbox

Patch

diff --git a/target/arm/translate.c b/target/arm/translate.c
index 4b1230b..ebe1c1a 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -11845,6 +11845,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;
+    }
+
     cpu_F0s = tcg_temp_new_i32();
     cpu_F1s = tcg_temp_new_i32();
     cpu_F0d = tcg_temp_new_i64();
@@ -12000,11 +12005,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