[PATCH] powerpc: Nicer printing of address at oops
Olof Johansson
olof at lixom.net
Mon Nov 7 09:54:36 EST 2005
On Mon, Nov 07, 2005 at 09:44:50AM +1100, Paul Mackerras wrote:
> Olof Johansson writes:
>
> > + printk("data at address 0x%016lx\n", regs->dar);
>
> Nice idea, but 16 digits is a bit excessive for 32-bit...
Ack, it's shared now, I forgot. Thanks.
Here's a new patch. I don't like the thought of ifdeffing for it so we'll
just have to live with 8 digit padding for small 64-bit pointers. :-)
-Olof
Add nicer printing of faulting address on unresolvable kernel faults.
Makes life a little easier for those who don't know how to decode our
register contents at oops time.
Signed-off-by: Olof Johansson <olof at lixom.net>
Index: 2.6/arch/powerpc/mm/fault.c
===================================================================
--- 2.6.orig/arch/powerpc/mm/fault.c 2005-11-06 12:55:22.000000000 -0800
+++ 2.6/arch/powerpc/mm/fault.c 2005-11-06 14:52:23.000000000 -0800
@@ -389,5 +389,22 @@ void bad_page_fault(struct pt_regs *regs
}
/* kernel has accessed a bad area */
+
+ printk(KERN_ALERT "Unable to handle kernel paging request for ");
+ switch (regs->trap) {
+ case 0x300:
+ case 0x380:
+ printk("data at address 0x%08lx\n", regs->dar);
+ break;
+ case 0x400:
+ case 0x480:
+ printk("instruction fetch\n");
+ break;
+ default:
+ printk("unknown fault\n");
+ }
+ printk(KERN_ALERT "Faulting instruction address: 0x%08lx\n",
+ regs->nip);
+
die("Kernel access of bad area", regs, sig);
}
More information about the Linuxppc64-dev
mailing list