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

From: Andrew Morton
Date: Thu Apr 17 2008 - 16:30:47 EST


On Thu, 17 Apr 2008 16:14:10 -0400
Mathieu Desnoyers <compudj@xxxxxxxxxxxxxxxxxx> 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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/