[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/18] target/arm: Move exception_bkpt_insn to debug_helper.c
From: |
Richard Henderson |
Subject: |
[PATCH 09/18] target/arm: Move exception_bkpt_insn to debug_helper.c |
Date: |
Mon, 23 May 2022 13:47:33 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/debug_helper.c | 31 +++++++++++++++++++++++++++++++
target/arm/op_helper.c | 29 -----------------------------
2 files changed, 31 insertions(+), 29 deletions(-)
diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c
index 3a86901779..bdcd5f36d6 100644
--- a/target/arm/debug_helper.c
+++ b/target/arm/debug_helper.c
@@ -429,6 +429,37 @@ void arm_debug_excp_handler(CPUState *cs)
}
}
+/*
+ * Raise an EXCP_BKPT with the specified syndrome register value,
+ * targeting the correct exception level for debug exceptions.
+ */
+void HELPER(exception_bkpt_insn)(CPUARMState *env, uint32_t syndrome)
+{
+ int debug_el = arm_debug_target_el(env);
+ int cur_el = arm_current_el(env);
+
+ /* FSR will only be used if the debug target EL is AArch32. */
+ env->exception.fsr = arm_debug_exception_fsr(env);
+ /*
+ * FAR is UNKNOWN: clear vaddress to avoid potentially exposing
+ * values to the guest that it shouldn't be able to see at its
+ * exception/security level.
+ */
+ env->exception.vaddress = 0;
+ /*
+ * Other kinds of architectural debug exception are ignored if
+ * they target an exception level below the current one (in QEMU
+ * this is checked by arm_generate_debug_exceptions()). Breakpoint
+ * instructions are special because they always generate an exception
+ * to somewhere: if they can't go to the configured debug exception
+ * level they are taken to the current exception level.
+ */
+ if (debug_el < cur_el) {
+ debug_el = cur_el;
+ }
+ raise_exception(env, EXCP_BKPT, syndrome, debug_el);
+}
+
#if !defined(CONFIG_USER_ONLY)
vaddr arm_adjust_watchpoint_address(CPUState *cs, vaddr addr, int len)
diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c
index 55440dfa84..0a50dbf274 100644
--- a/target/arm/op_helper.c
+++ b/target/arm/op_helper.c
@@ -413,35 +413,6 @@ void HELPER(exception_with_syndrome)(CPUARMState *env,
uint32_t excp,
raise_exception(env, excp, syndrome, target_el);
}
-/* Raise an EXCP_BKPT with the specified syndrome register value,
- * targeting the correct exception level for debug exceptions.
- */
-void HELPER(exception_bkpt_insn)(CPUARMState *env, uint32_t syndrome)
-{
- int debug_el = arm_debug_target_el(env);
- int cur_el = arm_current_el(env);
-
- /* FSR will only be used if the debug target EL is AArch32. */
- env->exception.fsr = arm_debug_exception_fsr(env);
- /* FAR is UNKNOWN: clear vaddress to avoid potentially exposing
- * values to the guest that it shouldn't be able to see at its
- * exception/security level.
- */
- env->exception.vaddress = 0;
- /*
- * Other kinds of architectural debug exception are ignored if
- * they target an exception level below the current one (in QEMU
- * this is checked by arm_generate_debug_exceptions()). Breakpoint
- * instructions are special because they always generate an exception
- * to somewhere: if they can't go to the configured debug exception
- * level they are taken to the current exception level.
- */
- if (debug_el < cur_el) {
- debug_el = cur_el;
- }
- raise_exception(env, EXCP_BKPT, syndrome, debug_el);
-}
-
uint32_t HELPER(cpsr_read)(CPUARMState *env)
{
return cpsr_read(env) & ~CPSR_EXEC;
--
2.34.1
- [PATCH 03/18] target/arm: Move and expand parameters to exception_target_el, (continued)
- [PATCH 03/18] target/arm: Move and expand parameters to exception_target_el, Richard Henderson, 2022/05/23
- [PATCH 05/18] target/arm: Move arm_singlestep_active out of line, Richard Henderson, 2022/05/23
- [PATCH 06/18] target/arm: Move arm_generate_debug_exceptions out of line, Richard Henderson, 2022/05/23
- [PATCH 07/18] target/arm: Hoist arm_current_el in arm_generate_debug_exceptions, Richard Henderson, 2022/05/23
- [PATCH 08/18] target/arm: Use is_a64 in arm_generate_debug_exceptions, Richard Henderson, 2022/05/23
- [PATCH 09/18] target/arm: Move exception_bkpt_insn to debug_helper.c,
Richard Henderson <=
- [PATCH 10/18] target/arm: Move arm_debug_exception_fsr to debug_helper.c, Richard Henderson, 2022/05/23
- [PATCH 12/18] target/arm: Create raise_exception_debug, Richard Henderson, 2022/05/23
- [PATCH 14/18] target/arm: Mark exception helpers as noreturn, Richard Henderson, 2022/05/23
- [PATCH 16/18] target/arm: Remove TBFLAG_ANY.DEBUG_TARGET_EL, Richard Henderson, 2022/05/23
- [PATCH 15/18] target/arm: Create helper_exception_swstep, Richard Henderson, 2022/05/23
- [PATCH 13/18] target/arm: Move MDCR_TDE test into exception_target_el, 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 17/18] target/arm: Add cur_el parameter to arm_generate_debug_exceptions, Richard Henderson, 2022/05/23