Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[POWERPC] Make instruction dumping work in real mode

On non-book-E, exceptions execute in real mode. If a fault happens
that leads to a register dump, the kernel currently prints XXXXXXXX
because it doesn't realize that PC is a physical address.

This patch checks whether instruction address translation is turned
on, and if not converts PC into a virtual address.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Scott Wood and committed by
Paul Mackerras
0de2d820 3eb523b9

+8
+8
arch/powerpc/kernel/process.c
··· 354 354 if (!(i % 8)) 355 355 printk("\n"); 356 356 357 + #if !defined(CONFIG_BOOKE) 358 + /* If executing with the IMMU off, adjust pc rather 359 + * than print XXXXXXXX. 360 + */ 361 + if (!(regs->msr & MSR_IR)) 362 + pc = (unsigned long)phys_to_virt(pc); 363 + #endif 364 + 357 365 /* We use __get_user here *only* to avoid an OOPS on a 358 366 * bad address because the pc *should* only be a 359 367 * kernel address.