diff options
author | Namhyung Kim <[email protected]> | 2023-12-08 17:52:11 -0800 |
---|---|---|
committer | Borislav Petkov (AMD) <[email protected]> | 2024-01-25 17:29:06 +0100 |
commit | e2fbc857d3c677ce96d9260577491e0d8f21b6f7 (patch) | |
tree | 1b135f44febcafeae474296964065ddc01ae9a1c | |
parent | 49527ca264341f9b6278089e274012a2db367ebf (diff) |
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 <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Acked-by: Ravi Bangoria <[email protected]>
Acked-by: Guilherme Amadio <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
-rw-r--r-- | arch/x86/kernel/nmi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c index 17e955ab69fe..d23867901186 100644 --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c @@ -303,13 +303,13 @@ unknown_nmi_error(unsigned char reason, struct pt_regs *regs) __this_cpu_add(nmi_stats.unknown, 1); - pr_emerg("Uhhuh. NMI received for unknown reason %02x on CPU %d.\n", - reason, smp_processor_id()); + pr_emerg_ratelimited("Uhhuh. NMI received for unknown reason %02x on CPU %d.\n", + reason, smp_processor_id()); if (unknown_nmi_panic || panic_on_unrecovered_nmi) nmi_panic(regs, "NMI: Not continuing"); - pr_emerg("Dazed and confused, but trying to continue\n"); + pr_emerg_ratelimited("Dazed and confused, but trying to continue\n"); } NOKPROBE_SYMBOL(unknown_nmi_error); |