Skip to content

Commit

Permalink
x86/nmi: Rate limit unknown NMI messages
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
namhyung authored and bp3tk0v committed Jan 25, 2024
1 parent 49527ca commit e2fbc85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/x86/kernel/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e2fbc85

Please sign in to comment.