From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/2] powerpc/44x: Fix xmon single step on PowerPC 44x
Date: Thu, 24 Sep 2009 07:34:34 +1000 [thread overview]
Message-ID: <1253741674.7103.327.camel@pasglop> (raw)
In-Reply-To: <20090923135156.GH14261@zod.rchland.ibm.com>
On Wed, 2009-09-23 at 09:51 -0400, Josh Boyer wrote:
> Prior to the arch/ppc -> arch/powerpc transition, xmon had support for single
> stepping on 4xx boards. The functionality was lost when arch/ppc was removed.
> This patch restores single step support for 44x boards.
>
> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> ---
> arch/powerpc/xmon/xmon.c | 20 +++++++++++++++++++-
> 1 files changed, 19 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
> index c6f0a71..fe2ad71 100644
> --- a/arch/powerpc/xmon/xmon.c
> +++ b/arch/powerpc/xmon/xmon.c
> @@ -517,6 +517,15 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
> in_xmon = 0;
> #endif
>
> +#ifdef CONFIG_4xx
> + if ((regs->msr & (MSR_DE)) == (MSR_DE)) {
Why not just if (regs->msr & MSR_DE) ?
> + bp = at_breakpoint(regs->nip);
> + if (bp != NULL) {
> + regs->nip = (unsigned long) &bp->instr[0];
> + atomic_inc(&bp->ref_count);
> + }
> + }
> +#else
Any reason why that couldn't be in CONFIG_BOOKE ?
> if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) == (MSR_IR|MSR_SF)) {
> bp = at_breakpoint(regs->nip);
> if (bp != NULL) {
> @@ -530,7 +539,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
> }
> }
> }
> -
> +#endif
> insert_cpu_bpts();
>
> local_irq_restore(flags);
> @@ -894,6 +903,14 @@ cmds(struct pt_regs *excp)
> }
> }
>
> +#ifdef CONFIG_44x
Same comment about BOOKE intead of 44x
> +static int do_step(struct pt_regs *regs)
> +{
> + regs->msr |= MSR_DE;
> + mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM);
I'm not sure about setting IDM... Won't that be a problem if you have
an external debugger connected ?
> + return 1;
> +}
> +#else
> /*
> * Step a single instruction.
> * Some instructions we emulate, others we execute with MSR_SE set.
> @@ -924,6 +941,7 @@ static int do_step(struct pt_regs *regs)
> regs->msr |= MSR_SE;
> return 1;
> }
> +#endif
Cheers,
Ben.
> static void bootcmds(void)
> {
next prev parent reply other threads:[~2009-09-23 21:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-23 13:48 [PATCH 0/2] 4xx xmon fixes Josh Boyer
2009-09-23 13:51 ` [PATCH 1/2] powerpc/4xx: Fix erroneous xmon warning on PowerPC 4xx Josh Boyer
2009-09-23 13:51 ` [PATCH 2/2] powerpc/44x: Fix xmon single step on PowerPC 44x Josh Boyer
2009-09-23 21:34 ` Benjamin Herrenschmidt [this message]
2009-09-23 22:35 ` Josh Boyer
2009-09-23 22:40 ` Benjamin Herrenschmidt
2009-09-23 23:22 ` David Gibson
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=1253741674.7103.327.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=jwboyer@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.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).