diff mbox series

[v3,24/30] target/ppc: Move page crossing check to ppc_tr_translate_insn

Message ID 20210430011543.1017113-25-richard.henderson@linaro.org
State New
Headers show
Series Base for adding PowerPC 64-bit instructions | expand

Commit Message

Richard Henderson April 30, 2021, 1:15 a.m. UTC
With prefixed instructions, the number of instructions
remaining until the page crossing is no longer constant.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 target/ppc/translate.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

-- 
2.25.1

Comments

Richard Henderson April 30, 2021, 1:26 a.m. UTC | #1
On 4/29/21 6:15 PM, Richard Henderson wrote:
> With prefixed instructions, the number of instructions

> remaining until the page crossing is no longer constant.

> 

> Signed-off-by: Richard Henderson<richard.henderson@linaro.org>

> ---

>   target/ppc/translate.c | 8 +++++---

>   1 file changed, 5 insertions(+), 3 deletions(-)


Oops, this was supposed to be ordered before the previous patch.


r~
diff mbox series

Patch

diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 65848463ea..d782a13d27 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -8019,9 +8019,6 @@  static void ppc_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
 
     if (ctx->singlestep_enabled & (CPU_SINGLE_STEP | GDBSTUB_SINGLE_STEP)) {
         ctx->base.max_insns = 1;
-    } else {
-        int bound = -(ctx->base.pc_first | TARGET_PAGE_MASK) / 4;
-        ctx->base.max_insns = MIN(ctx->base.max_insns, bound);
     }
 }
 
@@ -8098,6 +8095,11 @@  static void ppc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
     handler->count++;
 #endif
 
+    /* End the TB when crossing a page boundary. */
+    if (ctx->base.is_jmp == DISAS_NEXT && !(pc & ~TARGET_PAGE_MASK)) {
+        ctx->base.is_jmp = DISAS_TOO_MANY;
+    }
+
     translator_loop_temp_check(&ctx->base);
 }