aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2005-01-11 01:43:28 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-11 01:43:28 -0800
commit9aaf64a0f7cfd94cac1d0be99d2943e1302c0608 (patch)
tree4ad065425ff7cd670462b181b8b56936deee05ab /arch
parent61542216fa90397a2e70c46583edf26bc81994df (diff)
downloadhistory-9aaf64a0f7cfd94cac1d0be99d2943e1302c0608.tar.gz
[PATCH] ppc64: make xmon print BUG() warnings
I've had to explain to a number of people that a 0x700 exception is often a BUG(). Make this crystal clear by printing the BUG information in the xmon exception printout. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/ppc64/kernel/traps.c4
-rw-r--r--arch/ppc64/xmon/xmon.c24
2 files changed, 26 insertions, 2 deletions
diff --git a/arch/ppc64/kernel/traps.c b/arch/ppc64/kernel/traps.c
index c37af43a7a6233..418aff49933ed1 100644
--- a/arch/ppc64/kernel/traps.c
+++ b/arch/ppc64/kernel/traps.c
@@ -344,7 +344,7 @@ extern struct bug_entry __start___bug_table[], __stop___bug_table[];
#define module_find_bug(x) NULL
#endif
-static struct bug_entry *find_bug(unsigned long bugaddr)
+struct bug_entry *find_bug(unsigned long bugaddr)
{
struct bug_entry *bug;
@@ -354,7 +354,7 @@ static struct bug_entry *find_bug(unsigned long bugaddr)
return module_find_bug(bugaddr);
}
-int
+static int
check_bug_trap(struct pt_regs *regs)
{
struct bug_entry *bug;
diff --git a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c
index c53046d52e6c1b..2be270592fb399 100644
--- a/arch/ppc64/xmon/xmon.c
+++ b/arch/ppc64/xmon/xmon.c
@@ -31,6 +31,7 @@
#include <asm/cputable.h>
#include <asm/rtas.h>
#include <asm/sstep.h>
+#include <asm/bug.h>
#include "nonstdio.h"
#include "privinst.h"
@@ -1319,6 +1320,26 @@ static void backtrace(struct pt_regs *excp)
scannl();
}
+static void print_bug_trap(struct pt_regs *regs)
+{
+ struct bug_entry *bug;
+ unsigned long addr;
+
+ if (regs->msr & MSR_PR)
+ return; /* not in kernel */
+ addr = regs->nip; /* address of trap instruction */
+ if (addr < PAGE_OFFSET)
+ return;
+ bug = find_bug(regs->nip);
+ if (bug == NULL)
+ return;
+ if (bug->line & BUG_WARNING_TRAP)
+ return;
+
+ printf("kernel BUG in %s at %s:%d!\n",
+ bug->function, bug->file, (unsigned int)bug->line);
+}
+
void excprint(struct pt_regs *fp)
{
unsigned long trap;
@@ -1350,6 +1371,9 @@ void excprint(struct pt_regs *fp)
printf(" pid = %ld, comm = %s\n",
current->pid, current->comm);
}
+
+ if (trap == 0x700)
+ print_bug_trap(fp);
}
void prregs(struct pt_regs *fp)