lkml.org 
[lkml]   [2020]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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@infradead.org>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.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

\
 
 \ /
  Last update: 2020-02-21 14:51    [W:0.397 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site