arm64: show unhandled SP/PC alignment faults
authorVladimir Murzin <vladimir.murzin@arm.com>
Fri, 19 Jun 2015 14:28:16 +0000 (15:28 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 19 Jun 2015 15:20:10 +0000 (16:20 +0100)
Report unhandled SP/PC alignment faults if the show_unhandled_signals
variable is set (via /proc/sys/debug/exception-trace).

Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/fault.c

index 96da13167d4a5c77564952a6d3a0fdce35d6580f..e8c608c893cfb08a3aea776210e5b0c58f2d5d95 100644 (file)
@@ -478,12 +478,19 @@ asmlinkage void __exception do_sp_pc_abort(unsigned long addr,
                                           struct pt_regs *regs)
 {
        struct siginfo info;
+       struct task_struct *tsk = current;
+
+       if (show_unhandled_signals && unhandled_signal(tsk, SIGBUS))
+               pr_info_ratelimited("%s[%d]: %s exception: pc=%p sp=%p\n",
+                                   tsk->comm, task_pid_nr(tsk),
+                                   esr_get_class_string(esr), (void *)regs->pc,
+                                   (void *)regs->sp);
 
        info.si_signo = SIGBUS;
        info.si_errno = 0;
        info.si_code  = BUS_ADRALN;
        info.si_addr  = (void __user *)addr;
-       arm64_notify_die("", regs, &info, esr);
+       arm64_notify_die("Oops - SP/PC alignment exception", regs, &info, esr);
 }
 
 static struct fault_info debug_fault_info[] = {