From: Ian Campbell Subject: [PATCH] xen: arm64: more useful logging on bad trap. Date: Wed, 18 Feb 2015 15:19:31 +0000 Message-ID: <1424272771-25072-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: jintack@cs.columbia.edu, julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org 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 Cc: jintack@cs.columbia.edu --- Jintack, since you have a system which is exhibiting SError issues I wonder if I could prevail on you to give this patch a try on your system and report on the output. I've only compile tested this myself. --- xen/arch/arm/arm64/traps.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/arm64/traps.c b/xen/arch/arm/arm64/traps.c index 1693b5d..89b8eb3 100644 --- a/xen/arch/arm/arm64/traps.c +++ b/xen/arch/arm/arm64/traps.c @@ -24,11 +24,6 @@ #include -asmlinkage void do_trap_serror(struct cpu_user_regs *regs) -{ - panic("Unhandled serror trap"); -} - static const char *handler[]= { "Synchronous Abort", "IRQ", @@ -38,11 +33,13 @@ 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, code 0x%08"PRIx32"," + " EC=%"PRIx32", IL=%"PRIx32" ISS=%"PRIx32"\n", + handler[reason], hsr.bits, hsr.ec, hsr.len, hsr.iss); local_irq_disable(); + show_execution_state(regs); panic("bad mode"); } -- 1.7.10.4