From: Carlos Bilbao <carlos.bilbao@kernel.org>
Provide a priority-based mechanism to set the behavior of the kernel at
the post-panic stage -- the current default is a waste of CPU except for
cases with console that generate insightful output.
In v1 [1], I illustrated the potential to reduce unnecessary CPU usage
with an experiment with VMs. The main delta is that, instead of a weak
function that archs can overwrite, we provide a flexible priority-based
mechanism (following suggestions by Sean Christopherson),
panic_set_handling().
[1] https://lore.kernel.org/all/20250326151204.67898-1-carlos.bilbao@kernel.org/
Carlos:
panic: Allow for dynamic custom behavior after panic
x86/panic: Add x86_panic_handler as default post-panic behavior
---
arch/x86/kernel/setup.c | 12 ++++++++++++
include/linux/panic.h | 2 ++
kernel/panic.c | 27 +++++++++++++++++++++++++++
3 files changed, 41 insertions(+)