Messages in this thread | | | Date | Thu, 17 Apr 2008 13:29:19 -0700 | From | Andrew Morton <> | Subject | Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5) |
| |
On Thu, 17 Apr 2008 16:14:10 -0400 Mathieu Desnoyers <compudj@krystal.dyndns.org> wrote:
> +#define nmi_enter() \ > + do { \ > + lockdep_off(); \ > + BUG_ON(hardnmi_count()); \ > + add_preempt_count(HARDNMI_OFFSET); \ > + __irq_enter(); \ > + } while (0)
<did it _have_ to be a macro?>
Doing BUG() inside an NMI should be OK most of the time. But the BUG-handling code does want to know if we're in interrupt context - at least for the "fatal exception in interrupt" stuff, and probably other things.
But afacit the failure to include HARDNMI_MASK in
#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
will prevent that.
So.
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.
| |