login
Header Space

 
 

Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5)

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: <mingo@...>, <hpa@...>, <jeremy@...>, <rostedt@...>, <fche@...>, <linux-kernel@...>
Date: Thursday, April 17, 2008 - 5:16 pm

* Andrew Morton (akpm@linux-foundation.org) wrote:

isn't this real macro art work ? ;) I kept the same coding style that
was already there, which mimics the irq_enter/irq_exit macros. Changing
all of them at once could be done in a separate patch.


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(). 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 ?

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.

Mathieu



-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Mathieu Desnoyers, (Thu Apr 17, 4:14 pm)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Pavel Machek, (Mon Apr 21, 10:00 am)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), H. Peter Anvin, (Mon Apr 21, 10:22 am)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Mathieu Desnoyers, (Mon Apr 21, 11:08 am)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), H. Peter Anvin, (Mon Apr 21, 11:08 am)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Mathieu Desnoyers, (Mon Apr 21, 11:47 am)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Pavel Machek, (Mon Apr 21, 1:23 pm)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), H. Peter Anvin, (Mon Apr 21, 1:28 pm)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Mathieu Desnoyers, (Mon Apr 21, 1:42 pm)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), H. Peter Anvin, (Mon Apr 21, 1:59 pm)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Mathieu Desnoyers, (Tue Apr 22, 9:12 am)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Mathieu Desnoyers, (Mon Apr 21, 11:21 am)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Mathieu Desnoyers, (Mon Apr 21, 11:11 am)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Mathieu Desnoyers, (Mon Apr 21, 10:51 am)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Mathieu Desnoyers, (Thu Apr 17, 8:06 pm)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Mathieu Desnoyers, (Sat Apr 19, 5:23 pm)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Mathieu Desnoyers, (Sat Apr 19, 5:00 pm)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Andrew Morton, (Thu Apr 17, 4:29 pm)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Mathieu Desnoyers, (Thu Apr 17, 5:16 pm)
Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5), Andrew Morton, (Thu Apr 17, 5:26 pm)
speck-geostationary