]> Git Repo - linux.git/commitdiff
[POWERPC] Make instruction dumping work in real mode
authorScott Wood <[email protected]>
Thu, 27 Sep 2007 18:38:55 +0000 (04:38 +1000)
committerPaul Mackerras <[email protected]>
Wed, 3 Oct 2007 01:48:44 +0000 (11:48 +1000)
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 <[email protected]>
Acked-by: Kumar Gala <[email protected]>
Acked-by: Olof Johansson <[email protected]>
Signed-off-by: Paul Mackerras <[email protected]>
arch/powerpc/kernel/process.c

index 57c589c34147fc4dc54b19f256f4fb0e963ea981..588c0cb8115e5152c4c658df2bd720cf7972b6e2 100644 (file)
@@ -354,6 +354,14 @@ static void show_instructions(struct pt_regs *regs)
                if (!(i % 8))
                        printk("\n");
 
+#if !defined(CONFIG_BOOKE)
+               /* If executing with the IMMU off, adjust pc rather
+                * than print XXXXXXXX.
+                */
+               if (!(regs->msr & MSR_IR))
+                       pc = (unsigned long)phys_to_virt(pc);
+#endif
+
                /* We use __get_user here *only* to avoid an OOPS on a
                 * bad address because the pc *should* only be a
                 * kernel address.
This page took 0.056331 seconds and 4 git commands to generate.