From: Andrew Morton <akpm@linux-foundation.org>
To: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: mingo@elte.hu, hpa@zytor.com, jeremy@goop.org,
rostedt@goodmis.org, fche@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5)
Date: Thu, 17 Apr 2008 14:26:14 -0700 [thread overview]
Message-ID: <20080417142614.23c3849f.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080417211625.GB803@Krystal>
On Thu, 17 Apr 2008 17:16:25 -0400
Mathieu Desnoyers <compudj@krystal.dyndns.org> wrote:
> > Should we or should we not make in_interrupt() return true in NMI?
> > "should", I expect.
> >
> > If not, we'd need to do something else to communicate the current
> > processing state down to the BUG-handling code.
> >
>
> You bring an interesting question. In practice, since this BUG_ON could
> only happen if we have an NMI nested over another NMI or an nmi which
> fails to decrement its HARDNMI_MASK. Given that the HARDIRQ_MASK is
> incremented right after the HARDNMI_MASK increment (the reverse is also
> true), really bad things (TM) must have happened for the BUG_ON to be
> triggered outside of the __irq_enter()/__irq_exit() scope of the NMI
> below the buggy one.
>
> But since this code is there to extract as much information as possible
> when things go wrong, I would say it's safer to, at least, add
> HARDNMI_MASK to irq_count().
>
> Instead, though, I think we could add :
>
> if (in_nmi())
> panic("Fatal exception in non-maskable interrupt");
>
> to die().
But that's just one site. There might be (now, or in the future) other
code under BUG() which tests in_interrupt().
And most of the places where we test for in_interrupt() and in_irq()
probably want that to return true is we're in NMI too. After all, it's an
interrupt.
> That would be clearer. I just added it to x86_32, but can't
> find where x86_64 reports the "fatal exception in interrupt" and friends
> message. Any idea ?
Dunno - maybe it just doesn't have it. Maybe it was never the right thing
to do.
> By dealing with this case specifically, I think we don't really have to
> add HARDNMI_MASK to irq_count(), considering it's normally an HARDIRQ
> too.
next prev parent reply other threads:[~2008-04-17 21:27 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080417165839.GA25198@Krystal>
[not found] ` <20080417165944.GB25198@Krystal>
2008-04-17 20:14 ` [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5) Mathieu Desnoyers
2008-04-17 20:29 ` Andrew Morton
2008-04-17 21:16 ` Mathieu Desnoyers
2008-04-17 21:26 ` Andrew Morton [this message]
2008-04-17 22:01 ` Andi Kleen
2008-04-18 0:06 ` Mathieu Desnoyers
2008-04-18 8:07 ` Andi Kleen
2008-04-19 21:00 ` Mathieu Desnoyers
2008-04-18 11:30 ` Andi Kleen
2008-04-19 21:23 ` Mathieu Desnoyers
2008-04-21 14:00 ` Pavel Machek
2008-04-21 14:22 ` H. Peter Anvin
2008-04-21 14:51 ` Mathieu Desnoyers
2008-04-21 15:08 ` Mathieu Desnoyers
2008-04-21 15:08 ` H. Peter Anvin
2008-04-21 15:21 ` Mathieu Desnoyers
2008-04-21 15:47 ` Mathieu Desnoyers
2008-04-21 17:23 ` Pavel Machek
2008-04-21 17:28 ` H. Peter Anvin
2008-04-21 17:42 ` Mathieu Desnoyers
2008-04-21 17:59 ` H. Peter Anvin
2008-04-22 13:12 ` Mathieu Desnoyers
2008-04-21 15:11 ` Mathieu Desnoyers
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=20080417142614.23c3849f.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=compudj@krystal.dyndns.org \
--cc=fche@redhat.com \
--cc=hpa@zytor.com \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.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 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.