linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] Make instruction dumping work in real mode.
@ 2007-09-27 18:38 Scott Wood
  2007-09-27 18:44 ` Kumar Gala
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Scott Wood @ 2007-09-27 18:38 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

On non-book-E-or-4xx, 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 the state of the IMMU, and if necessary converts PC into a
virtual address.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
OK, just CONFIG_BOOKE this time. :-P

 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..6dbde7f 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");
 
+#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.
-- 
1.5.3.1

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

* Re: [PATCH v4] Make instruction dumping work in real mode.
  2007-09-27 18:38 [PATCH v4] Make instruction dumping work in real mode Scott Wood
@ 2007-09-27 18:44 ` Kumar Gala
  2007-09-27 18:51 ` Olof Johansson
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Kumar Gala @ 2007-09-27 18:44 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, paulus


On Sep 27, 2007, at 1:38 PM, Scott Wood wrote:

> On non-book-E-or-4xx, 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 the state of the IMMU, and if necessary converts  
> PC into a
> virtual address.
>
> Signed-off-by: Scott Wood <scottwood@freescale.com>

Acked-by: Kumar Gala <galak@kernel.crashing.org>

- k

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

* Re: [PATCH v4] Make instruction dumping work in real mode.
  2007-09-27 18:38 [PATCH v4] Make instruction dumping work in real mode Scott Wood
  2007-09-27 18:44 ` Kumar Gala
@ 2007-09-27 18:51 ` Olof Johansson
  2007-09-27 22:57 ` Michael Ellerman
  2007-09-28  9:37 ` Segher Boessenkool
  3 siblings, 0 replies; 6+ messages in thread
From: Olof Johansson @ 2007-09-27 18:51 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, paulus

On Thu, Sep 27, 2007 at 01:38:55PM -0500, Scott Wood wrote:
> On non-book-E-or-4xx, 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 the state of the IMMU, and if necessary converts PC into a
> virtual address.
> 
> Signed-off-by: Scott Wood <scottwood@freescale.com>

Acked-by: Olof Johansson <olof@lixom.net>


-Olof

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

* Re: [PATCH v4] Make instruction dumping work in real mode.
  2007-09-27 18:38 [PATCH v4] Make instruction dumping work in real mode Scott Wood
  2007-09-27 18:44 ` Kumar Gala
  2007-09-27 18:51 ` Olof Johansson
@ 2007-09-27 22:57 ` Michael Ellerman
  2007-09-27 23:01   ` Scott Wood
  2007-09-28  9:37 ` Segher Boessenkool
  3 siblings, 1 reply; 6+ messages in thread
From: Michael Ellerman @ 2007-09-27 22:57 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, paulus

[-- Attachment #1: Type: text/plain, Size: 639 bytes --]

On Thu, 2007-09-27 at 13:38 -0500, Scott Wood wrote:
> On non-book-E-or-4xx, 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 the state of the IMMU, and if necessary converts PC into a
> virtual address.

IMMU ?

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH v4] Make instruction dumping work in real mode.
  2007-09-27 22:57 ` Michael Ellerman
@ 2007-09-27 23:01   ` Scott Wood
  0 siblings, 0 replies; 6+ messages in thread
From: Scott Wood @ 2007-09-27 23:01 UTC (permalink / raw)
  To: michael; +Cc: linuxppc-dev, paulus

Michael Ellerman wrote:
> On Thu, 2007-09-27 at 13:38 -0500, Scott Wood wrote:
>> On non-book-E-or-4xx, 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 the state of the IMMU, and if necessary converts PC into a
>> virtual address.
> 
> IMMU ?

Instruction Memory Management Unit.

-Scott

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

* Re: [PATCH v4] Make instruction dumping work in real mode.
  2007-09-27 18:38 [PATCH v4] Make instruction dumping work in real mode Scott Wood
                   ` (2 preceding siblings ...)
  2007-09-27 22:57 ` Michael Ellerman
@ 2007-09-28  9:37 ` Segher Boessenkool
  3 siblings, 0 replies; 6+ messages in thread
From: Segher Boessenkool @ 2007-09-28  9:37 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, paulus

> On non-book-E-or-4xx, 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 the state of the IMMU, and if necessary converts PC 
> into a
> virtual address.
>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> ---
> OK, just CONFIG_BOOKE this time. :-P

You forgot to fix the commit message ;-P


Segher

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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-27 18:38 [PATCH v4] Make instruction dumping work in real mode Scott Wood
2007-09-27 18:44 ` Kumar Gala
2007-09-27 18:51 ` Olof Johansson
2007-09-27 22:57 ` Michael Ellerman
2007-09-27 23:01   ` Scott Wood
2007-09-28  9:37 ` Segher Boessenkool

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).