Skip to contentSkip to conversation

Make instruction dumping work in real mode.

PATCH Superseded Scott Wood 2 participants 2 messages Sep 24, 2007 – Sep 25, 2007 PowerPC

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Scott Wood

author
#0 lore raw

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

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.

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

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