diff options
author | Murilo Opsfelder Araujo <muriloo@linux.ibm.com> | 2018-08-01 17:33:20 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-08-07 10:32:30 -0400 |
commit | a99b9c5ed43ecfff5c47c558cc0fcbf8c6503f4c (patch) | |
tree | 73603c2fa512799f8ef2e5694e8f601a461e2695 | |
parent | 88b0fe17573592a8e3196bf143f865da460178e7 (diff) |
powerpc/traps: Show instructions on exceptions
Call show_user_instructions() in arch/powerpc/kernel/traps.c to dump
instructions at faulty location, useful to debugging.
Before this patch, an unhandled signal message looked like:
pandafault[10524]: segfault (11) at 100007d0 nip 1000061c lr 7fffbd295100 code 2 in pandafault[10000000+10000]
After this patch, it looks like:
pandafault[10524]: segfault (11) at 100007d0 nip 1000061c lr 7fffbd295100 code 2 in pandafault[10000000+10000]
pandafault[10524]: code: 4bfffeec 4bfffee8 3c401002 38427f00 fbe1fff8 f821ffc1 7c3f0b78 3d22fffe
pandafault[10524]: code: 392988d0 f93f0020 e93f0020 39400048 <99490000> 39200000 7d234b78 383f0040
Signed-off-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/kernel/traps.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 171c504d78fb..070e96f1773a 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -70,6 +70,7 @@ | |||
70 | #include <asm/hmi.h> | 70 | #include <asm/hmi.h> |
71 | #include <sysdev/fsl_pci.h> | 71 | #include <sysdev/fsl_pci.h> |
72 | #include <asm/kprobes.h> | 72 | #include <asm/kprobes.h> |
73 | #include <asm/stacktrace.h> | ||
73 | 74 | ||
74 | #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC_CORE) | 75 | #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC_CORE) |
75 | int (*__debugger)(struct pt_regs *regs) __read_mostly; | 76 | int (*__debugger)(struct pt_regs *regs) __read_mostly; |
@@ -337,6 +338,8 @@ static void show_signal_msg(int signr, struct pt_regs *regs, int code, | |||
337 | print_vma_addr(KERN_CONT " in ", regs->nip); | 338 | print_vma_addr(KERN_CONT " in ", regs->nip); |
338 | 339 | ||
339 | pr_cont("\n"); | 340 | pr_cont("\n"); |
341 | |||
342 | show_user_instructions(regs); | ||
340 | } | 343 | } |
341 | 344 | ||
342 | void _exception_pkey(int signr, struct pt_regs *regs, int code, | 345 | void _exception_pkey(int signr, struct pt_regs *regs, int code, |