[PATCH] hppa: Show registers at KERN_CRIT loglevel in parisc_terminate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch displays registers at KERN_CRIT loglevel in parisc_terminate.
For example,

 Backtrace:


Bad Address (null pointer deref?): Code=6 (Instruction TLB miss fault) at addr 00000000e09b5d5f
CPU: 1 PID: 30812 Comm: Qt bearer threa Not tainted 5.14.21+ #2
Hardware name: 9000/800/rp3440

     YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
PSW: 00000000000001001111111100001111 Not tainted
r00-03  000000ff0004ff0f 00000000f3c11d93 00000000e09ba3d7 0000000000fb4528
r04-07  00000000f3dafcd8 0000000000fb2730 0000000000fb4548 000000000000000a
r08-11  0000000000fb9a60 0000000000000000 00000000f3dafcd8 0000000000000000
r12-15  0000000000fb9a7c 0000000000fb9a74 0000000000fb9a70 0000000000000034
r16-19  0000000000000001 0000000000fb9a78 0000000000fb2730 00000000e09bfa3c
r20-23  0000000000000000 00000000e09ba370 00000000e09bf76a 00000000f887cdc8
r24-27  0000000000000001 0000000000000000 0000000000fb2730 0000000000b00970
r28-31  000000000000000a 0000000000fb3550 00000000e1629ac0 00000000f3b12303
sr00-03  0000000003645000 0000000000000000 0000000000000000 0000000003645000
sr04-07  0000000003645000 0000000003645000 0000000003645000 0000000003645000

      VZOUICununcqcqcqcqcqcrmunTDVZOUI
FPSR: 00001100001111111111100000000000
FPER1: 00000000
fr00-03  0c3ff80000000000 0000000000000000 0000000000000000 0000000000000000
fr04-07  41143c0000000000 40b77080f7b1f342 408d169e3fb4abb2 0000000000000000
fr08-11  4051d93d8a819523 40538f743d58009d 40520029ad7a1ee0 407e8d24303158b6
fr12-15  0000000000000000 0000000000000000 0000000000000000 0000000000000000
fr16-19  0000000000000000 0000000000000000 0000000000000000 0000000000000000
fr20-23  0000000000000000 0000000000000000 f3ad5af4f3dafcd8 00fb1cd800000000
fr24-27  0000000000000000 0000000000000000 40590001083547bf 0000000000000000
fr28-31  0000000000000000 3fd8e4f30713752c 40836297d7543512 4073d11b7867ef74

IASQ: 0000000003645000 0000000003645000 IAOQ: 00000000e09b5d5f 00000000e09b5d63
 IIR: 43ffff80    ISR: 0000000003645000  IOR: 00000000f570319c
 CPU:        1   CR30: 00000000551f0000 CR31: ffffffffffffffff
 ORIG_R28: 0000000000000000
 IAOQ[0]: 00000000e09b5d5f
 IAOQ[1]: 00000000e09b5d63
 RP(r2): 00000000e09ba3d7
Kernel panic - not syncing: Bad Address (null pointer deref?)
---[ end Kernel panic - not syncing: Bad Address (null pointer deref?) ]---

In this case, the dump isn't very useful as the crash appears to have
been caused by a memory TIMEOUT. This caused a HPMC.

Signed-off-by: John David Anglin <dave.anglin@xxxxxxxx>
---

diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index 892b7fc8f3c4..978bda16c71c 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -117,14 +117,12 @@ static void print_fr(const char *level, struct pt_regs *regs)
 		PRINTREGS(level, regs->fr, "fr", FFMT, i);
 }
 
-void show_regs(struct pt_regs *regs)
+static void __show_regs(struct pt_regs *regs, const char *level)
 {
 	int i, user;
-	const char *level;
 	unsigned long cr30, cr31;
 
 	user = user_mode(regs);
-	level = user ? KERN_DEBUG : KERN_CRIT;
 
 	show_regs_print_info(level);
 
@@ -160,6 +158,11 @@ void show_regs(struct pt_regs *regs)
 	}
 }
 
+void show_regs(struct pt_regs *regs)
+{
+	__show_regs(regs, user_mode(regs) ? KERN_DEBUG : KERN_CRIT);
+}
+
 static DEFINE_RATELIMIT_STATE(_hppa_rs,
 	DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST);
 
@@ -452,7 +455,7 @@ void parisc_terminate(char *msg, struct pt_regs *regs, int code, unsigned long o
 	printk("\n");
 	pr_crit("%s: Code=%d (%s) at addr " RFMT "\n",
 		msg, code, trap_name(code), offset);
-	show_regs(regs);
+	__show_regs(regs, KERN_CRIT);
 
 	spin_unlock(&terminate_lock);
 

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux