summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-04-06 15:55:06 +0200
committerThomas Gleixner <tglx@linutronix.de>2020-06-11 15:14:58 +0200
commitf051f697955049c7cf10a635ab8149aa619243b2 (patch)
treef4d5678ab79116e38137bd3401d2847b20d2a321 /arch/x86/kernel/cpu
parent6271fef00b3489690e52ce95edbc378357513547 (diff)
downloadlinux-f051f697955049c7cf10a635ab8149aa619243b2.tar.bz2
x86/nmi: Protect NMI entry against instrumentation
Mark all functions in the fragile code parts noinstr or force inlining so they can't be instrumented. Also make the hardware latency tracer invocation explicit outside of non-instrumentable section. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Andy Lutomirski <luto@kernel.org> Link: https://lkml.kernel.org/r/20200505135314.716186134@linutronix.de
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r--arch/x86/kernel/cpu/common.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 8be042df12c3..f4645f9ff9cb 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1709,21 +1709,19 @@ void syscall_init(void)
DEFINE_PER_CPU(int, debug_stack_usage);
DEFINE_PER_CPU(u32, debug_idt_ctr);
-void debug_stack_set_zero(void)
+noinstr void debug_stack_set_zero(void)
{
this_cpu_inc(debug_idt_ctr);
load_current_idt();
}
-NOKPROBE_SYMBOL(debug_stack_set_zero);
-void debug_stack_reset(void)
+noinstr void debug_stack_reset(void)
{
if (WARN_ON(!this_cpu_read(debug_idt_ctr)))
return;
if (this_cpu_dec_return(debug_idt_ctr) == 0)
load_current_idt();
}
-NOKPROBE_SYMBOL(debug_stack_reset);
#else /* CONFIG_X86_64 */