All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Petri Gynther <pgynther@google.com>
Cc: linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH] MIPS: add nmi_enter() + nmi_exit() to nmi_exception_handler()
Date: Mon, 9 Nov 2015 09:09:06 +0100	[thread overview]
Message-ID: <20151109080906.GA27251@linux-mips.org> (raw)
In-Reply-To: <CAGXr9JH5TLxOnA2LMPdxo3Sqeigprm=KFiiM9Vu2eMOaMgC6yA@mail.gmail.com>

On Mon, Nov 02, 2015 at 12:50:50PM -0800, Petri Gynther wrote:

> On Mon, Oct 19, 2015 at 11:49 AM, Petri Gynther <pgynther@google.com> wrote:
> >
> > We need to enter NMI context when NMI interrupt fires.
> >
> > Signed-off-by: Petri Gynther <pgynther@google.com>
> > ---
> >  arch/mips/kernel/traps.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
> > index fdb392b..efcedd4 100644
> > --- a/arch/mips/kernel/traps.c
> > +++ b/arch/mips/kernel/traps.c
> > @@ -1856,12 +1856,14 @@ void __noreturn nmi_exception_handler(struct pt_regs *regs)
> >  {
> >         char str[100];
> >
> > +       nmi_enter();
> >         raw_notifier_call_chain(&nmi_chain, 0, regs);
> >         bust_spinlocks(1);
> >         snprintf(str, 100, "CPU%d NMI taken, CP0_EPC=%lx\n",
> >                  smp_processor_id(), regs->cp0_epc);
> >         regs->cp0_epc = read_c0_errorepc();
> >         die(str, regs);
> > +       nmi_exit();
> >  }
> >
> >  #define VECTORSPACING 0x100    /* for EI/VI mode */
> > --
> > 2.6.0.rc2.230.g3dd15c0
> >
> 
> Any comments/concerns about this patch?

Is NMI on your systems actually recoverable?  I never bothered with
nmi_enther / nmi_exit and other fine details of the NMI implementations
because as defined by the MIPS architecture an NMI may be pretty destructive
and closer to a reset than what other architectures describer as their NMI.
Think what's going to happen if it hits during any phase when $k0 / $k1
are active.

  Ralf

  reply	other threads:[~2015-11-09  8:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 18:49 [PATCH] MIPS: add nmi_enter() + nmi_exit() to nmi_exception_handler() Petri Gynther
2015-11-02 20:50 ` Petri Gynther
2015-11-09  8:09   ` Ralf Baechle [this message]
2016-01-12  1:03     ` Maciej W. Rozycki
2016-01-12 13:50       ` Ralf Baechle
2016-01-12 21:38         ` Maciej W. Rozycki

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=20151109080906.GA27251@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=linux-mips@linux-mips.org \
    --cc=pgynther@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.