[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200219103126.33f67cf3@gandalf.local.home>
Date: Wed, 19 Feb 2020 10:31:26 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
mingo@...nel.org, joel@...lfernandes.org,
gregkh@...uxfoundation.org, gustavo@...eddedor.com,
tglx@...utronix.de, paulmck@...nel.org, josh@...htriplett.org,
mathieu.desnoyers@...icios.com, jiangshanlai@...il.com,
luto@...nel.org, tony.luck@...el.com, frederic@...nel.org,
dan.carpenter@...cle.com, mhiramat@...nel.org,
Will Deacon <will@...nel.org>, Marc Zyngier <maz@...nel.org>,
Michael Ellerman <mpe@...erman.id.au>,
Petr Mladek <pmladek@...e.com>
Subject: Re: [PATCH v3 01/22] hardirq/nmi: Allow nested nmi_enter()
On Wed, 19 Feb 2020 15:47:25 +0100
Peter Zijlstra <peterz@...radead.org> wrote:
> Since there are already a number of sites (ARM64, PowerPC) that
> effectively nest nmi_enter(), lets make the primitive support this
> before adding even more.
>
> void SMIException(struct pt_regs *regs)
> --- a/include/linux/hardirq.h
> +++ b/include/linux/hardirq.h
> @@ -71,7 +71,7 @@ extern void irq_exit(void);
> 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(); \
> trace_hardirq_enter(); \
> --- a/include/linux/preempt.h
> +++ b/include/linux/preempt.h
> @@ -26,13 +26,13 @@
> * PREEMPT_MASK: 0x000000ff
> * SOFTIRQ_MASK: 0x0000ff00
> * HARDIRQ_MASK: 0x000f0000
> - * NMI_MASK: 0x00100000
> + * NMI_MASK: 0x00f00000
> * PREEMPT_NEED_RESCHED: 0x80000000
> */
> #define PREEMPT_BITS 8
> #define SOFTIRQ_BITS 8
> #define HARDIRQ_BITS 4
> -#define NMI_BITS 1
> +#define NMI_BITS 4
>
Probably should document somewhere (in a comment above nmi_enter()?)
that we allow nmi_enter() to nest up to 15 times.
-- Steve
Powered by blists - more mailing lists