From: Scott Wood <scottwood@freescale.com>
To: paulus@samba.org
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH] Make instruction dumping work in real mode.
Date: Mon, 24 Sep 2007 14:01:00 -0500 [thread overview]
Message-ID: <20070924190100.GB4761@loki.buserror.net> (raw)
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
next reply other threads:[~2007-09-24 19:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-24 19:01 Scott Wood [this message]
2007-09-25 1:41 ` [PATCH] Make instruction dumping work in real mode Olof Johansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070924190100.GB4761@loki.buserror.net \
--to=scottwood@freescale.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).