Skip to contentSkip to conversation

Make instruction dumping work in real mode.

PATCH In review Scott Wood 5 participants 6 messages Sep 27, 2007 – Sep 28, 2007 PowerPC

lore
Share & tools
lore

Scott Wood

author
#0 lore raw

PATCH v4 1/1 Make instruction dumping work in real mode.

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.

---
OK, just CONFIG_BOOKE this time. :-P

 arch/powerpc/kernel/process.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
arch/powerpc/kernel/process.c +8 -0
index 57c589c..6dbde7f 100644
@@ -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.
Signature · 1 line
1.5.3.1
Acked-by on v4 1/1
#1 lore raw
Quoted 8 lines · Scott Wood

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.

- k

Acked-by on v4 1/1
#2 lore raw
In reply to Scott Wood
Quoted 8 lines · Scott Wood

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.

-Olof

#3 lore raw
In reply to Scott Wood
Quoted 6 lines · Scott Wood

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

Signature · 8 lines
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
author
#4 lore raw
Quoted 9 lines · Michael Ellerman
Quoted 6 lines · Scott Wood

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

#5 lore raw
In reply to Scott Wood
Quoted 10 lines

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.

---
OK, just CONFIG_BOOKE this time. :-P

You forgot to fix the commit message ;-P

Segher