linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Michael Ellerman <michael@ellerman.id.au>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] powerpc: Fix program check handling when lockdep is enabled
Date: Tue, 21 Feb 2012 19:19:49 +1100	[thread overview]
Message-ID: <1329812389.3980.51.camel@pasglop> (raw)
In-Reply-To: <1329809550-29336-1-git-send-email-michael@ellerman.id.au>

On Tue, 2012-02-21 at 18:32 +1100, Michael Ellerman wrote:
> In commit 54321242afe ("Disable interrupts early in Program Check"), we
> switched from enabling to disabling interrupts in program_check_common.
> 
> Whereas ENABLE_INTS leaves r3 untouched, if lockdep is enabled DISABLE_INTS
> calls into lockdep code and will clobber r3. That means we pass a bogus
> struct pt_regs* into program_check_exception() and all hell breaks loose.
> 
> So load our regs pointer into r3 after we call DISABLE_INTS.

Ah nice catch, thanks !

Cheers,
Ben.

> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
>  arch/powerpc/kernel/exceptions-64s.S |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
> index 3844ca7..15c5a4f 100644
> --- a/arch/powerpc/kernel/exceptions-64s.S
> +++ b/arch/powerpc/kernel/exceptions-64s.S
> @@ -774,8 +774,8 @@ alignment_common:
>  program_check_common:
>  	EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)
>  	bl	.save_nvgprs
> -	addi	r3,r1,STACK_FRAME_OVERHEAD
>  	DISABLE_INTS
> +	addi	r3,r1,STACK_FRAME_OVERHEAD
>  	bl	.program_check_exception
>  	b	.ret_from_except
>  

      reply	other threads:[~2012-02-21  8:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-21  7:32 [PATCH] powerpc: Fix program check handling when lockdep is enabled Michael Ellerman
2012-02-21  8:19 ` 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=1329812389.3980.51.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=michael@ellerman.id.au \
    /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).