diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2022-06-10 14:32:32 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2022-06-10 14:32:32 +0100 |
commit | f0d7c2054aee5d17ed0a84a11cc8c89b38902d3c (patch) | |
tree | 7bacdd2bfd03508c1babbbfce7cb008d9a398a55 /target/arm/translate.h | |
parent | 486d6c9699a5fc1f11c48dbe73b46e183020fa49 (diff) | |
download | qemu-f0d7c2054aee5d17ed0a84a11cc8c89b38902d3c.zip qemu-f0d7c2054aee5d17ed0a84a11cc8c89b38902d3c.tar.gz qemu-f0d7c2054aee5d17ed0a84a11cc8c89b38902d3c.tar.bz2 |
target/arm: Create helper_exception_swstep
Move the computation from gen_swstep_exception into a helper.
This fixes a bug when:
- MDSCR_EL1.KDE == 1 to enable debug exceptions within EL_D itself
- we singlestep an ERET from EL_D to some lower EL
Previously we were computing 'same el' based on the EL which
executed the ERET instruction, whereas it ought to be computed
based on the EL to which ERET returned. This happens naturally
with the new helper, which runs after EL has been changed.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220609202901.1177572-14-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/arm/translate.h')
-rw-r--r-- | target/arm/translate.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/target/arm/translate.h b/target/arm/translate.h index 4575af6..890e731 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -341,15 +341,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)); } /* |