From cbb20881a2506bab2f425cd9877e8cc1df184f2e Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sun, 4 Mar 2018 14:05:43 -0500 Subject: [PATCH] target/arm: Delay check for magic kernel page There's nothing magic about the exception that we generate in order to execute the magic kernel page. We can and should allow gdb to set a breakpoint at this location. Backports commit 3805c2eba8999049bbbea29fdcdea4d47d943c88 from qemu --- qemu/target/arm/translate.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/qemu/target/arm/translate.c b/qemu/target/arm/translate.c index ff666e66..8f9b2e94 100644 --- a/qemu/target/arm/translate.c +++ b/qemu/target/arm/translate.c @@ -12187,16 +12187,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) (dc->condexec_cond << 4) | (dc->condexec_mask >> 1), 0); num_insns++; -#ifdef CONFIG_USER_ONLY - /* Intercept jump to the magic kernel page. */ - if (dc->pc >= 0xffff0000) { - /* We always get here via a jump, so know we are not in a - conditional execution block. */ - gen_exception_internal(dc, EXCP_KERNEL_TRAP); - dc->is_jmp = DISAS_NORETURN; - break; - } -#endif if (unlikely(!QTAILQ_EMPTY(&cs->breakpoints))) { CPUBreakpoint *bp; @@ -12229,6 +12219,17 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) // gen_io_start(); //} +#ifdef CONFIG_USER_ONLY + /* Intercept jump to the magic kernel page. */ + if (dc->pc >= 0xffff0000) { + /* We always get here via a jump, so know we are not in a + conditional execution block. */ + gen_exception_internal(dc, EXCP_KERNEL_TRAP); + dc->is_jmp = DISAS_NORETURN; + break; + } +#endif + if (dc->ss_active && !dc->pstate_ss) { /* Singlestep state is Active-pending. * If we're in this state at the start of a TB then either