[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200221134215.793377175@infradead.org>
Date: Fri, 21 Feb 2020 14:34:29 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
rostedt@...dmis.org
Cc: peterz@...radead.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
Subject: [PATCH v4 13/27] x86,tracing: Add comments to do_nmi()
Add a few comments to do_nmi() as a result of the audit.
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
---
arch/x86/kernel/nmi.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -529,11 +529,14 @@ do_nmi(struct pt_regs *regs, long error_
* continue to use the NMI stack.
*/
if (unlikely(is_debug_stack(regs->sp))) {
- debug_stack_set_zero();
+ debug_stack_set_zero(); /* notrace due to Makefile */
this_cpu_write(update_debug_stack, 1);
}
#endif
+ /*
+ * It is important that no tracing happens before nmi_enter()!
+ */
nmi_enter();
inc_irq_stat(__nmi_count);
@@ -542,10 +545,13 @@ do_nmi(struct pt_regs *regs, long error_
default_do_nmi(regs);
nmi_exit();
+ /*
+ * No tracing after nmi_exit()!
+ */
#ifdef CONFIG_X86_64
if (unlikely(this_cpu_read(update_debug_stack))) {
- debug_stack_reset();
+ debug_stack_reset(); /* notrace due to Makefile */
this_cpu_write(update_debug_stack, 0);
}
#endif
Powered by blists - more mailing lists