summaryrefslogtreecommitdiff
path: root/include/linux/hardirq.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2020-02-19 09:46:47 +0100
committerThomas Gleixner <tglx@linutronix.de>2020-05-19 15:51:17 +0200
commit69ea03b56ed2c7189ccd0b5910ad39f3cad1df21 (patch)
treef5070915d8d90d28e70b6a467db88c69a73d803e /include/linux/hardirq.h
parent28f6bf9e247fe23d177cfdbf7e709270e8cc7fa6 (diff)
hardirq/nmi: Allow nested nmi_enter()
Since there are already a number of sites (ARM64, PowerPC) that effectively nest nmi_enter(), make the primitive support this before adding even more. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Marc Zyngier <maz@kernel.org> Acked-by: Will Deacon <will@kernel.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Link: https://lkml.kernel.org/r/20200505134100.864179229@linutronix.de
Diffstat (limited to 'include/linux/hardirq.h')
-rw-r--r--include/linux/hardirq.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 7c8b82f69288..a043ad826c67 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -65,13 +65,16 @@ extern void irq_exit(void);
#define arch_nmi_exit() do { } while (0)
#endif
+/*
+ * nmi_enter() can nest up to 15 times; see NMI_BITS.
+ */
#define nmi_enter() \
do { \
arch_nmi_enter(); \
printk_nmi_enter(); \
lockdep_off(); \
ftrace_nmi_enter(); \
- BUG_ON(in_nmi()); \
+ BUG_ON(in_nmi() == NMI_MASK); \
preempt_count_add(NMI_OFFSET + HARDIRQ_OFFSET); \
rcu_nmi_enter(); \
lockdep_hardirq_enter(); \