[Qemu-devel] [PATCH v14 06/34] target/arm: Delay check for magic kernel page

Richard Henderson posted 34 patches 8 years, 6 months ago
There is a newer version of this series
[Qemu-devel] [PATCH v14 06/34] target/arm: Delay check for magic kernel page
Posted by Richard Henderson 8 years, 6 months ago
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.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target/arm/translate.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index fea76fb..2ae68ce 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -11930,17 +11930,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb)
                            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(EXCP_KERNEL_TRAP);
-            dc->is_jmp = DISAS_NORETURN;
-            break;
-        }
-#endif
-
         if (unlikely(!QTAILQ_EMPTY(&cs->breakpoints))) {
             CPUBreakpoint *bp;
             QTAILQ_FOREACH(bp, &cs->breakpoints, entry) {
@@ -11972,6 +11961,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(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
-- 
2.9.4


Re: [Qemu-devel] [PATCH v14 06/34] target/arm: Delay check for magic kernel page
Posted by Emilio G. Cota 8 years, 6 months ago
On Fri, Jul 14, 2017 at 23:42:15 -1000, Richard Henderson wrote:
> 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.
> 
> Signed-off-by: Richard Henderson <rth@twiddle.net>

Reviewed-by: Emilio G. Cota <cota@braap.org>

		E.