linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH 1/3] powerpc/64s: fix handling of non-synchronous machine checks
Date: Tue, 28 Feb 2017 18:43:34 +1000	[thread overview]
Message-ID: <20170228184334.717ca813@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <15d128c9-f574-0104-d47e-37e2dced8d8f@linux.vnet.ibm.com>

On Tue, 28 Feb 2017 11:27:29 +0530
Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com> wrote:

> On 02/28/2017 07:30 AM, Nicholas Piggin wrote:
> > A synchronous machine check is an exception raised by the attempt to
> > execute the current instruction. If the error can't be corrected, it
> > can make sense to SIGBUS the currently running process.
> > 
> > In other cases, the error condition is not related to the current
> > instruction, so killing the current process is not the right thing to
> > do.
> > 
> > Today, all machine checks are MCE_SEV_ERROR_SYNC, so this has no
> > practical change. It will be used to handle POWER9 asynchronous
> > machine checks.
> > 
> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> > ---
> >  arch/powerpc/platforms/powernv/opal.c | 21 ++++++---------------
> >  1 file changed, 6 insertions(+), 15 deletions(-)
> > 
> > diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
> > index 86d9fde93c17..e0f856bfbfe8 100644
> > --- a/arch/powerpc/platforms/powernv/opal.c
> > +++ b/arch/powerpc/platforms/powernv/opal.c
> > @@ -395,7 +395,6 @@ static int opal_recover_mce(struct pt_regs *regs,
> >  					struct machine_check_event *evt)
> >  {
> >  	int recovered = 0;
> > -	uint64_t ea = get_mce_fault_addr(evt);
> > 
> >  	if (!(regs->msr & MSR_RI)) {
> >  		/* If MSR_RI isn't set, we cannot recover */
> > @@ -404,26 +403,18 @@ static int opal_recover_mce(struct pt_regs *regs,
> >  	} else if (evt->disposition == MCE_DISPOSITION_RECOVERED) {
> >  		/* Platform corrected itself */
> >  		recovered = 1;
> > -	} else if (ea && !is_kernel_addr(ea)) {
> > +	} else if (evt->severity == MCE_SEV_FATAL) {
> > +		/* Fatal machine check */
> > +		pr_err("Machine check interrupt is fatal\n");
> > +		recovered = 0;  
> 
> Setting recovered = 0 would trigger kernel panic. Should we panic the
> kernel for asynchronous errors ?

If it's not recoverable, I don't see what other option we have. SRR0 is
meaningless for async machine checks. So it's much the same thing we do
as if we don't have a process to kill or were running in kernel when a
synchronous MCE occurred.

Thanks,
Nick

  reply	other threads:[~2017-02-28  8:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28  2:00 [PATCH 0/3 v2] MCE handler for POWER9 Nicholas Piggin
2017-02-28  2:00 ` [PATCH 1/3] powerpc/64s: fix handling of non-synchronous machine checks Nicholas Piggin
2017-02-28  5:57   ` Mahesh Jagannath Salgaonkar
2017-02-28  8:43     ` Nicholas Piggin [this message]
2017-03-14 11:45   ` [1/3] " Michael Ellerman
2017-02-28  2:00 ` [PATCH 2/3] powerpc/64s: allow machine check handler to set severity and initiator Nicholas Piggin
2017-02-28  2:00 ` [PATCH 3/3] powerpc/64s: POWER9 machine check handler Nicholas Piggin
2017-02-28  7:07   ` Mahesh Jagannath Salgaonkar
2017-03-09  5:35     ` Nicholas Piggin

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=20170228184334.717ca813@roar.ozlabs.ibm.com \
    --to=npiggin@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mahesh@linux.vnet.ibm.com \
    --cc=mpe@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).