[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 29/32] target/arm: [a64] Move page and ss checks to i
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 29/32] target/arm: [a64] Move page and ss checks to init_disas_context |
Date: |
Wed, 6 Sep 2017 09:06:09 -0700 |
From: Richard Henderson <address@hidden>
Since AArch64 uses a fixed-width ISA, we can pre-compute the number of
insns remaining on the page. Also, we can check for single-step once.
Reviewed-by: Emilio G. Cota <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
target/arm/translate-a64.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 25c6622825..9017e30510 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -11206,6 +11206,7 @@ static int
aarch64_tr_init_disas_context(DisasContextBase *dcbase,
DisasContext *dc = container_of(dcbase, DisasContext, base);
CPUARMState *env = cpu->env_ptr;
ARMCPU *arm_cpu = arm_env_get_cpu(env);
+ int bound;
dc->pc = dc->base.pc_first;
dc->condjmp = 0;
@@ -11254,8 +11255,14 @@ static int
aarch64_tr_init_disas_context(DisasContextBase *dcbase,
dc->is_ldex = false;
dc->ss_same_el = (arm_debug_target_el(env) == dc->current_el);
- dc->next_page_start =
- (dc->base.pc_first & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE;
+ /* Bound the number of insns to execute to those left on the page. */
+ bound = -(dc->base.pc_first | TARGET_PAGE_MASK) / 4;
+
+ /* If architectural single step active, limit to 1. */
+ if (dc->ss_active) {
+ bound = 1;
+ }
+ max_insns = MIN(max_insns, bound);
init_tmp_a64_array(dc);
@@ -11323,12 +11330,6 @@ static void aarch64_tr_translate_insn(DisasContextBase
*dcbase, CPUState *cpu)
disas_a64_insn(env, dc);
}
- if (dc->base.is_jmp == DISAS_NEXT) {
- if (dc->ss_active || dc->pc >= dc->next_page_start) {
- dc->base.is_jmp = DISAS_TOO_MANY;
- }
- }
-
dc->base.pc_next = dc->pc;
translator_loop_temp_check(&dc->base);
}
--
2.13.5
- [Qemu-devel] [PULL 19/32] target/arm: [tcg] Port to insn_start, (continued)
- [Qemu-devel] [PULL 19/32] target/arm: [tcg] Port to insn_start, Richard Henderson, 2017/09/06
- [Qemu-devel] [PULL 25/32] target/arm: [tcg,a64] Port to tb_stop, Richard Henderson, 2017/09/06
- [Qemu-devel] [PULL 15/32] target/arm: [tcg] Port to DisasContextBase, Richard Henderson, 2017/09/06
- [Qemu-devel] [PULL 24/32] target/arm: [tcg] Port to tb_stop, Richard Henderson, 2017/09/06
- [Qemu-devel] [PULL 26/32] target/arm: [tcg] Port to disas_log, Richard Henderson, 2017/09/06
- [Qemu-devel] [PULL 17/32] target/arm: [tcg, a64] Port to init_disas_context, Richard Henderson, 2017/09/06
- [Qemu-devel] [PULL 22/32] target/arm: [tcg] Port to translate_insn, Richard Henderson, 2017/09/06
- [Qemu-devel] [PULL 21/32] target/arm: [tcg, a64] Port to breakpoint_check, Richard Henderson, 2017/09/06
- [Qemu-devel] [PULL 28/32] target/arm: [tcg] Port to generic translation framework, Richard Henderson, 2017/09/06
- [Qemu-devel] [PULL 23/32] target/arm: [tcg, a64] Port to translate_insn, Richard Henderson, 2017/09/06
- [Qemu-devel] [PULL 29/32] target/arm: [a64] Move page and ss checks to init_disas_context,
Richard Henderson <=
- [Qemu-devel] [PULL 27/32] target/arm: [tcg,a64] Port to disas_log, Richard Henderson, 2017/09/06
- [Qemu-devel] [PULL 30/32] target/arm: Move ss check to init_disas_context, Richard Henderson, 2017/09/06
- [Qemu-devel] [PULL 32/32] target/arm: Perform per-insn cross-page check only for Thumb, Richard Henderson, 2017/09/06
- [Qemu-devel] [PULL 31/32] target/arm: Split out thumb_tr_translate_insn, Richard Henderson, 2017/09/06
- Re: [Qemu-devel] [PULL 00/32] tcg generic translate loop, Peter Maydell, 2017/09/07