linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make instruction dumping work in real mode.
@ 2007-09-24 19:01 Scott Wood
  2007-09-25  1:41 ` Olof Johansson
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Wood @ 2007-09-24 19:01 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

On non-book-E, if a faulting PC is in the first few pages, and it's not an
ITLB miss, it's likely executing in real mode, probably at an exception vector.

Rather than print a useless XXXXXXXX, it is assumed that this is the case, and
the address is treated as physical.  This helps when debugging corruption at
the beginning of memory.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 arch/powerpc/kernel/process.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 57c589c..7cb94d7 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -354,6 +354,14 @@ static void show_instructions(struct pt_regs *regs)
 		if (!(i % 8))
 			printk("\n");
 
+#ifndef CONFIG_BOOKE
+		/* If the address is in the first couple pages, it's
+		 * likely executing in real mode.
+		 */
+		if (regs->nip < 0x4000)
+			pc += (unsigned long)phys_to_virt(KERNELBASE);
+#endif
+
 		/* We use __get_user here *only* to avoid an OOPS on a
 		 * bad address because the pc *should* only be a
 		 * kernel address.
-- 
1.5.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Make instruction dumping work in real mode.
  2007-09-24 19:01 [PATCH] Make instruction dumping work in real mode Scott Wood
@ 2007-09-25  1:41 ` Olof Johansson
  0 siblings, 0 replies; 2+ messages in thread
From: Olof Johansson @ 2007-09-25  1:41 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, paulus

On Mon, Sep 24, 2007 at 02:01:00PM -0500, Scott Wood wrote:
> On non-book-E, if a faulting PC is in the first few pages, and it's not an
> ITLB miss, it's likely executing in real mode, probably at an exception vector.
> 
> Rather than print a useless XXXXXXXX, it is assumed that this is the case, and
> the address is treated as physical.  This helps when debugging corruption at
> the beginning of memory.

Please use regs->msr & MSR_IR instead.


-Olof

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-25  1:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-24 19:01 [PATCH] Make instruction dumping work in real mode Scott Wood
2007-09-25  1:41 ` Olof Johansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).