Skip to content

Commit e2fbc85

Browse files
namhyungbp3tk0v
authored andcommitted
x86/nmi: Rate limit unknown NMI messages
On some AMD machines, unknown NMI messages were printed on the console continuously when using perf command with IBS. It was reported that it can slow down the kernel. Ratelimit the unknown NMI messages. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Acked-by: Ravi Bangoria <ravi.bangoria@amd.com> Acked-by: Guilherme Amadio <amadio@gentoo.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20231209015211.357983-1-namhyung@kernel.org
1 parent 49527ca commit e2fbc85

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/x86/kernel/nmi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,13 @@ unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
303303

304304
__this_cpu_add(nmi_stats.unknown, 1);
305305

306-
pr_emerg("Uhhuh. NMI received for unknown reason %02x on CPU %d.\n",
307-
reason, smp_processor_id());
306+
pr_emerg_ratelimited("Uhhuh. NMI received for unknown reason %02x on CPU %d.\n",
307+
reason, smp_processor_id());
308308

309309
if (unknown_nmi_panic || panic_on_unrecovered_nmi)
310310
nmi_panic(regs, "NMI: Not continuing");
311311

312-
pr_emerg("Dazed and confused, but trying to continue\n");
312+
pr_emerg_ratelimited("Dazed and confused, but trying to continue\n");
313313
}
314314
NOKPROBE_SYMBOL(unknown_nmi_error);
315315

0 commit comments

Comments
 (0)