]> xenbits.xensource.com Git - xen.git/commitdiff
xen: arm64: more useful logging on bad trap.
authorIan Campbell <ian.campbell@citrix.com>
Wed, 18 Feb 2015 17:01:55 +0000 (17:01 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 19 Feb 2015 16:48:52 +0000 (16:48 +0000)
Dump the register state before panicing so we have some clue where the
issue occurred. Also decode the ESR register a bit to save having to
grab a pen and paper.

ESR_EL2 is a 32-bit register, so use SYSREG_READ32 not ..._READ64, as
we already do correctly in the main trap handler.

While here notice that do_trap_serror is never called and remove it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Tested-by: Jintack Lim <jintack@cs.columbia.edu>
Cc: jintack@cs.columbia.edu
[ ijc -- add missing \n to first printk ]

xen/arch/arm/arm64/traps.c

index 1693b5d3fbddd0cd3c2ba9382aa4365392153dff..5a90cfa9a6a455c9acb5ab5c415efa8ad169e469 100644 (file)
 
 #include <public/xen.h>
 
-asmlinkage void do_trap_serror(struct cpu_user_regs *regs)
-{
-    panic("Unhandled serror trap");
-}
-
 static const char *handler[]= {
         "Synchronous Abort",
         "IRQ",
@@ -38,11 +33,14 @@ static const char *handler[]= {
 
 asmlinkage void do_bad_mode(struct cpu_user_regs *regs, int reason)
 {
-    uint64_t esr = READ_SYSREG64(ESR_EL2);
-    printk("Bad mode in %s handler detected, code 0x%08"PRIx64"\n",
-           handler[reason], esr);
+    union hsr hsr = { .bits = READ_SYSREG32(ESR_EL2) };
+
+    printk("Bad mode in %s handler detected\n", handler[reason]);
+    printk("ESR=0x%08"PRIx32":  EC=%"PRIx32", IL=%"PRIx32", ISS=%"PRIx32"\n",
+           hsr.bits, hsr.ec, hsr.len, hsr.iss);
 
     local_irq_disable();
+    show_execution_state(regs);
     panic("bad mode");
 }