* [PATCH v3] Make instruction dumping work in real mode.
@ 2007-09-27 18:00 Scott Wood
2007-09-27 18:02 ` Kumar Gala
2007-09-27 18:09 ` Sergei Shtylyov
0 siblings, 2 replies; 4+ messages in thread
From: Scott Wood @ 2007-09-27 18:00 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>
---
Resent with 40x->44x.
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) && !defined(CONFIG_44x)
+ /* 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] 4+ messages in thread
* Re: [PATCH v3] Make instruction dumping work in real mode.
2007-09-27 18:00 [PATCH v3] Make instruction dumping work in real mode Scott Wood
@ 2007-09-27 18:02 ` Kumar Gala
2007-09-27 18:09 ` Sergei Shtylyov
1 sibling, 0 replies; 4+ messages in thread
From: Kumar Gala @ 2007-09-27 18:02 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev, paulus
On Sep 27, 2007, at 1:00 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>
44x is Book-e :)
all you need is a ifndef CONFIG_BOOKE.
- k
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] Make instruction dumping work in real mode.
2007-09-27 18:00 [PATCH v3] Make instruction dumping work in real mode Scott Wood
2007-09-27 18:02 ` Kumar Gala
@ 2007-09-27 18:09 ` Sergei Shtylyov
2007-09-27 18:23 ` Grant Likely
1 sibling, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2007-09-27 18:09 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev, paulus
Hello.
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>
> ---
> Resent with 40x->44x.
>
> 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) && !defined(CONFIG_44x)
Doesn't CONFIG_44x select CONFIG_BOOKE? Maybe you meant CONFIG_40x?
> + /* 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.
WBR, Sergei
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] Make instruction dumping work in real mode.
2007-09-27 18:09 ` Sergei Shtylyov
@ 2007-09-27 18:23 ` Grant Likely
0 siblings, 0 replies; 4+ messages in thread
From: Grant Likely @ 2007-09-27 18:23 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: linuxppc-dev, paulus
On 9/27/07, Sergei Shtylyov <sshtylyov@ru.mvista.com> wrote:
> Hello.
>
> 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>
> > ---
> > Resent with 40x->44x.
> >
> > 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) && !defined(CONFIG_44x)
>
> Doesn't CONFIG_44x select CONFIG_BOOKE? Maybe you meant CONFIG_40x?
Heeheehee! That was the *last* version of the patch. :-)
40x *does* have real mode, so CONFIG_40x is not appropriate here. As
Kumar mentioned, only CONFIG_BOOKE is needed.
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-09-27 18:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-27 18:00 [PATCH v3] Make instruction dumping work in real mode Scott Wood
2007-09-27 18:02 ` Kumar Gala
2007-09-27 18:09 ` Sergei Shtylyov
2007-09-27 18:23 ` Grant Likely
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).