public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Murilo Opsfelder Araujo <muriloo@linux•ibm.com>
To: linux-kernel@vger•kernel.org
Cc: "Alastair D'Silva" <alastair@d-silva•org>,
	Andrew Donnellan <andrew.donnellan@au1•ibm.com>,
	Balbir Singh <bsingharora@gmail•com>,
	Benjamin Herrenschmidt <benh@kernel•crashing.org>,
	Christophe Leroy <christophe.leroy@c-s•fr>,
	Cyril Bur <cyrilbur@gmail•com>,
	"Eric W . Biederman" <ebiederm@xmission•com>,
	Joe Perches <joe@perches•com>,
	Michael Ellerman <mpe@ellerman•id.au>,
	Michael Neuling <mikey@neuling•org>,
	Murilo Opsfelder Araujo <muriloo@linux•ibm.com>,
	Nicholas Piggin <npiggin@gmail•com>,
	Paul Mackerras <paulus@samba•org>,
	Simon Guo <wei.guo.simon@gmail•com>,
	Sukadev Bhattiprolu <sukadev@linux•vnet.ibm.com>,
	"Tobin C . Harding" <me@tobin•cc>,
	linuxppc-dev@lists•ozlabs.org,
	Segher Boessenkool <segher@kernel•crashing.org>
Subject: [PATCH v4 6/6] powerpc/traps: Show instructions on exceptions
Date: Wed,  1 Aug 2018 18:33:20 -0300	[thread overview]
Message-ID: <20180801213320.11203-7-muriloo@linux.ibm.com> (raw)
In-Reply-To: <20180801213320.11203-1-muriloo@linux.ibm.com>

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>
---
 arch/powerpc/kernel/traps.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index bcefbb1ee771..8494b0ff4904 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -70,6 +70,7 @@
 #include <asm/hmi.h>
 #include <sysdev/fsl_pci.h>
 #include <asm/kprobes.h>
+#include <asm/stacktrace.h>
 
 #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC_CORE)
 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,
 	print_vma_addr(KERN_CONT " in ", regs->nip);
 
 	pr_cont("\n");
+
+	show_user_instructions(regs);
 }
 
 void _exception_pkey(int signr, struct pt_regs *regs, int code,
-- 
2.17.1

      parent reply	other threads:[~2018-08-01 21:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-01 21:33 [PATCH v4 0/6] powerpc: Modernize unhandled signals message Murilo Opsfelder Araujo
2018-08-01 21:33 ` [PATCH v4 1/6] powerpc/traps: Print unhandled signals in a separate function Murilo Opsfelder Araujo
2018-08-08 14:26   ` [v4, " Michael Ellerman
2018-08-01 21:33 ` [PATCH v4 2/6] powerpc/traps: Use an explicit ratelimit state for show_signal_msg() Murilo Opsfelder Araujo
2018-08-01 21:33 ` [PATCH v4 3/6] powerpc/traps: Use %lx format in show_signal_msg() Murilo Opsfelder Araujo
2018-08-01 21:33 ` [PATCH v4 4/6] powerpc/traps: Print VMA for unhandled signals Murilo Opsfelder Araujo
2018-08-01 21:33 ` [PATCH v4 5/6] powerpc: Add show_user_instructions() Murilo Opsfelder Araujo
2018-08-02  5:26   ` Christophe LEROY
2018-08-03  0:42     ` Murilo Opsfelder Araujo
2018-08-03  1:22       ` Joe Perches
2018-08-03  6:38       ` Christophe LEROY
2018-08-03  8:44         ` Michael Ellerman
2018-08-03 11:31           ` Murilo Opsfelder Araujo
2018-08-10  9:29             ` Christophe LEROY
2018-08-10 18:08               ` Murilo Opsfelder Araujo
2018-08-01 21:33 ` Murilo Opsfelder Araujo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180801213320.11203-7-muriloo@linux.ibm.com \
    --to=muriloo@linux$(echo .)ibm.com \
    --cc=alastair@d-silva$(echo .)org \
    --cc=andrew.donnellan@au1$(echo .)ibm.com \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=bsingharora@gmail$(echo .)com \
    --cc=christophe.leroy@c-s$(echo .)fr \
    --cc=cyrilbur@gmail$(echo .)com \
    --cc=ebiederm@xmission$(echo .)com \
    --cc=joe@perches$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=me@tobin$(echo .)cc \
    --cc=mikey@neuling$(echo .)org \
    --cc=mpe@ellerman$(echo .)id.au \
    --cc=npiggin@gmail$(echo .)com \
    --cc=paulus@samba$(echo .)org \
    --cc=segher@kernel$(echo .)crashing.org \
    --cc=sukadev@linux$(echo .)vnet.ibm.com \
    --cc=wei.guo.simon@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox