linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: xufeng zhang <xufeng.zhang@windriver.com>
Cc: Linuxppc-dev@ozlabs.org, Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Subject: Re: Run 'usermode-agent' cause kernel panic on Powerpc
Date: Thu, 09 Dec 2010 14:26:20 +1100	[thread overview]
Message-ID: <1291865180.16694.217.camel@pasglop> (raw)
In-Reply-To: <4CFEDD4D.5020205@windriver.com>

On Wed, 2010-12-08 at 09:20 +0800, xufeng zhang wrote:

> > I believe it would have such an impact.  I don't see that user-mode
> > debugging would be enabled at all.
> >
> > Maybe something like this untested patch:
> >
> > diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
> > index 84906d3..0e7d1cf 100644
> > --- a/arch/powerpc/kernel/process.c
> > +++ b/arch/powerpc/kernel/process.c
> > @@ -323,6 +323,13 @@ static void set_debug_reg_defaults(struct thread_struct *thread)
> >
> >   static void prime_debug_regs(struct thread_struct *thread)
> >   {
> > +	/*
> > +	 * If we're setting up debug events for user space, make sure they
> > +	 * don't fire in kernel space before we get to user space
> > +	 */
> > +	if (thread->dbcr0&  DBCR0_IDM)
> > +		mtmsr(mfmsr()&  ~MSR_DE);
> > +
> >   	mtspr(SPRN_IAC1, thread->iac1);
> >   	mtspr(SPRN_IAC2, thread->iac2);
> >   #if CONFIG_PPC_ADV_DEBUG_IACS>  2
> >
> >    
> Thanks for your reply, Dave, I know where the problem is.

So is there a kernel bug we need to fix ?

Cheers,
Ben.

      reply	other threads:[~2010-12-09  3:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-07  6:48 Run 'usermode-agent' cause kernel panic on Powerpc xufeng zhang
2010-12-07 14:04 ` Dave Kleikamp
2010-12-08  1:20   ` xufeng zhang
2010-12-09  3:26     ` Benjamin Herrenschmidt [this message]

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=1291865180.16694.217.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=Linuxppc-dev@ozlabs.org \
    --cc=shaggy@linux.vnet.ibm.com \
    --cc=xufeng.zhang@windriver.com \
    /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).