[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 15/18] target/arm: Create helper_exception_swstep
From: |
Richard Henderson |
Subject: |
[PATCH 15/18] target/arm: Create helper_exception_swstep |
Date: |
Mon, 23 May 2022 13:47:39 -0700 |
Move the computation from gen_swstep_exception into a helper.
The assert removed here is present in raise_exception_debug.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/helper.h | 1 +
target/arm/translate.h | 12 +++---------
target/arm/debug_helper.c | 5 +++++
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/target/arm/helper.h b/target/arm/helper.h
index 5161cdf73d..f3fd53f3f9 100644
--- a/target/arm/helper.h
+++ b/target/arm/helper.h
@@ -47,6 +47,7 @@ DEF_HELPER_FLAGS_3(sel_flags, TCG_CALL_NO_RWG_SE,
DEF_HELPER_2(exception_internal, noreturn, env, i32)
DEF_HELPER_4(exception_with_syndrome, noreturn, env, i32, i32, i32)
DEF_HELPER_2(exception_bkpt_insn, noreturn, env, i32)
+DEF_HELPER_2(exception_swstep, noreturn, env, i32)
DEF_HELPER_2(exception_pc_alignment, noreturn, env, tl)
DEF_HELPER_1(setend, void, env)
DEF_HELPER_2(wfi, void, env, i32)
diff --git a/target/arm/translate.h b/target/arm/translate.h
index 6f0ebdc88e..c03dbfb618 100644
--- a/target/arm/translate.h
+++ b/target/arm/translate.h
@@ -340,15 +340,9 @@ static inline void gen_exception(int excp, uint32_t
syndrome,
/* Generate an architectural singlestep exception */
static inline void gen_swstep_exception(DisasContext *s, int isv, int ex)
{
- bool same_el = (s->debug_target_el == s->current_el);
-
- /*
- * If singlestep is targeting a lower EL than the current one,
- * then s->ss_active must be false and we can never get here.
- */
- assert(s->debug_target_el >= s->current_el);
-
- gen_exception(EXCP_UDEF, syn_swstep(same_el, isv, ex), s->debug_target_el);
+ /* Fill in the same_el field of the syndrome in the helper. */
+ uint32_t syn = syn_swstep(false, isv, ex);
+ gen_helper_exception_swstep(cpu_env, tcg_constant_i32(syn));
}
/*
diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c
index 181ba7b042..8d87b65a8d 100644
--- a/target/arm/debug_helper.c
+++ b/target/arm/debug_helper.c
@@ -467,6 +467,11 @@ void HELPER(exception_bkpt_insn)(CPUARMState *env,
uint32_t syndrome)
raise_exception_debug(env, EXCP_BKPT, syndrome);
}
+void HELPER(exception_swstep)(CPUARMState *env, uint32_t syndrome)
+{
+ raise_exception_debug(env, EXCP_UDEF, syndrome);
+}
+
#if !defined(CONFIG_USER_ONLY)
vaddr arm_adjust_watchpoint_address(CPUState *cs, vaddr addr, int len)
--
2.34.1
- Re: [PATCH 11/18] target/arm: Move arm_debug_target_el to internals.h, (continued)
- [PATCH 10/18] target/arm: Move arm_debug_exception_fsr to debug_helper.c, Richard Henderson, 2022/05/23
- [PATCH 06/18] target/arm: Move arm_generate_debug_exceptions out of line, Richard Henderson, 2022/05/23
- [PATCH 14/18] target/arm: Mark exception helpers as noreturn, Richard Henderson, 2022/05/23
- [PATCH 08/18] target/arm: Use is_a64 in arm_generate_debug_exceptions, Richard Henderson, 2022/05/23
- [PATCH 13/18] target/arm: Move MDCR_TDE test into exception_target_el, Richard Henderson, 2022/05/23
- [PATCH 12/18] target/arm: Create raise_exception_debug, Richard Henderson, 2022/05/23
- [PATCH 15/18] target/arm: Create helper_exception_swstep,
Richard Henderson <=
- [PATCH 17/18] target/arm: Add cur_el parameter to arm_generate_debug_exceptions, Richard Henderson, 2022/05/23
- [PATCH 18/18] target/arm: Remove route_to_el2 case from sve_exception_el, Richard Henderson, 2022/05/23
- [PATCH 16/18] target/arm: Remove TBFLAG_ANY.DEBUG_TARGET_EL, Richard Henderson, 2022/05/23