powerpc/traps: Print VMA for unhandled signals
This adds VMA address in the message printed for unhandled signals, similarly to what other architectures, like x86, print. Before this patch, a page fault looked like: pandafault[61470]: unhandled signal 11 at 100007d0 nip 1000061c lr 7fff8d185100 code 2 After this patch, a page fault looks like: pandafault[6303]: segfault 11 at 100007d0 nip 1000061c lr 7fff93c55100 code 2 in pandafault[10000000+10000] Signed-off-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
49d8f2011d
commit
0f642d616b
|
@ -96,6 +96,19 @@ EXPORT_SYMBOL(__debugger_fault_handler);
|
|||
#define TM_DEBUG(x...) do { } while(0)
|
||||
#endif
|
||||
|
||||
static const char *signame(int signr)
|
||||
{
|
||||
switch (signr) {
|
||||
case SIGBUS: return "bus error";
|
||||
case SIGFPE: return "floating point exception";
|
||||
case SIGILL: return "illegal instruction";
|
||||
case SIGSEGV: return "segfault";
|
||||
case SIGTRAP: return "unhandled trap";
|
||||
}
|
||||
|
||||
return "unknown signal";
|
||||
}
|
||||
|
||||
/*
|
||||
* Trap & Exception support
|
||||
*/
|
||||
|
@ -317,9 +330,13 @@ static void show_signal_msg(int signr, struct pt_regs *regs, int code,
|
|||
if (!unhandled_signal(current, signr))
|
||||
return;
|
||||
|
||||
pr_info("%s[%d]: unhandled signal %d at %lx nip %lx lr %lx code %x\n",
|
||||
current->comm, current->pid, signr,
|
||||
pr_info("%s[%d]: %s (%d) at %lx nip %lx lr %lx code %x",
|
||||
current->comm, current->pid, signame(signr), signr,
|
||||
addr, regs->nip, regs->link, code);
|
||||
|
||||
print_vma_addr(KERN_CONT " in ", regs->nip);
|
||||
|
||||
pr_cont("\n");
|
||||
}
|
||||
|
||||
void _exception_pkey(int signr, struct pt_regs *regs, int code,
|
||||
|
|
Loading…
Reference in New Issue