panic: add panic_force_cpu= parameter to redirect panic to a specific CPU
PATCH v8 1/1 panic: add panic_force_cpu= parameter to redirect panic to a specific CPU
Some platforms require panic handling to execute on a specific CPU for crash dump to work reliably. This can be due to firmware limitations, interrupt routing constraints, or platform-specific requirements where only a single CPU is able to safely enter the crash kernel.
Add the panic_force_cpu= kernel command-line parameter to redirect panic execution to a designated CPU. When the parameter is provided, the CPU that initially triggers panic forwards the panic context to the target CPU via IPI, which then proceeds with the normal panic and kexec flow.
The IPI delivery is implemented as a weak function (panic_smp_redirect_cpu) so architectures with NMI support can override it for more reliable delivery.
If the specified CPU is invalid, offline, or a panic is already in progress on another CPU, the redirection is skipped and panic continues on the current CPU.
---
Changes since v7:
- Fix buffer race via deferred allocation (late_initcall + kmalloc)
- Add fallback message for early boot panic or allocation failure
- Add nr_cpu_ids validation in boot parameter parsing
- Add warning when target CPU is offline or redirect fails
- Remove console flush from redirect path
- link to v7: https://lore.kernel.org/all/[email protected]/
Changes since v6:
(addressing review comments from Petr Mladek)
- Renamed panic_force_target_cpu() to panic_try_force_cpu()
- Inverted return value logic: now returns true if redirected, false otherwise
- Added atomic panic_redirect_cpu variable to synchronize buffer access and prevent races when multiple CPUs call panic() in parallel
- Use panic_redirect_cpu to track original CPU and skip duplicate stack dump on target CPU
- Added set_cpu_online(false) before panic_smp_self_stop() to prevent panic_other_cpus_shutdown() from waiting for the redirecting CPU
- Moved panic_force_cpu declaration outside #ifdef block for use in vpanic()
- link to v6: https://lore.kernel.org/all/[email protected]/
Changes since v5:
- Restore (char *) cast in do_panic_on_target_cpu() to fix -Wformat warning
- link to v5: https://lore.kernel.org/all/[email protected]/
Changes since v4:
- Make IPI delivery an overridable weak function (panic_smp_redirect_cpu)
so architectures can use NMI where available
- Add declaration on include/linux/smp.h alongside other panic SMP functions
- Add warning to documentation about reduced reliability
- Address review comments from Andrew Morton (remove unnecessary cast,
add missing kernel-doc parameters)
- link to v4: https://lore.kernel.org/all/[email protected]/
Changes since v3:
- Dump original CPU's stack before redirecting to preserve debug info
- Add Documentation/admin-guide/kernel-parameters.txt entry
- Use smp_call_function_single_async() to avoid blocking in csd_lock()
- Add CONFIG_CRASH_DUMP dependency
- Reuse vpanic()'s static buffer instead of separate allocation
- Remove verbose warning messages
- link to v3: https://lore.kernel.org/all/[email protected]/
Changes since v2:
- Make panic redirection warnings generic and platform-agnostic
- link to v2: https://lore.kernel.org/all/[email protected]/
Changes since v1:
- Replace Kconfig option with a kernel command-line parameter
- Fix clang format warning reported by kernel test robot
- link to v1: https://lore.kernel.org/all/[email protected]/
--- .../admin-guide/kernel-parameters.txt | 15 ++ include/linux/panic.h | 8 + include/linux/smp.h | 1 + kernel/panic.c | 163 +++++++++++++++++- 4 files changed, 185 insertions(+), 2 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +15 -0
@@ -4753,6 +4753,21 @@ Kernel parameters panic_on_warn=1 panic() instead of WARN(). Useful to cause kdump on a WARN(). + panic_force_cpu= + [KNL,SMP] Force panic handling to execute on a specific CPU. + Format: <cpu number> + Some platforms require panic handling to occur on a + specific CPU for the crash kernel to function correctly. + This can be due to firmware limitations, interrupt routing + constraints, or platform-specific requirements where only + a particular CPU can safely enter the crash kernel. + When set, panic() will redirect execution to the specified + CPU before proceeding with the normal panic and kexec flow. + If the target CPU is offline or unavailable, panic proceeds + on the current CPU. + This option should only be used for systems with the above + constraints as it might cause the panic operation to be less reliable. + panic_print= Bitmask for printing system info when panic happens. User can chose combination of the following bits: bit 0: print all tasks info
include/linux/panic.h +8 -0
@@ -41,6 +41,14 @@ void abort(void);* PANIC_CPU_INVALID means no CPU has entered panic() or crash_kexec(). */ extern atomic_t panic_cpu; + +/* +* panic_redirect_cpu is used when panic is redirected to a specific CPU via +* the panic_force_cpu= boot parameter. It holds the CPU number that originally +* triggered the panic before redirection. A value of PANIC_CPU_INVALID means +* no redirection has occurred. +*/ +extern atomic_t panic_redirect_cpu;#define PANIC_CPU_INVALID -1bool panic_try_start (void );
include/linux/smp.h +1 -0
@@ -62,6 +62,7 @@ int smp_call_function_single_async(int cpu, call_single_data_t *csd);void __noreturn panic_smp_self_stop (void );void __noreturn nmi_panic_self_stop (struct pt_regs *regs);void crash_smp_send_stop (void ); +int panic_smp_redirect_cpu (int target_cpu,void *msg);/* * Call a function on all processors
kernel/panic.c +161 -2
199 lines not on this page · raw message
Signature · 1 line
2.43.0
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi Pnina,
kernel test robot noticed the following build warnings:
[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master v6.19-rc6 next-20260122] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Pnina-Feder/panic-add-panic_force_cpu-parameter-to-redirect-panic-to-a-specific-CPU/20260122-182657 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20260122102457.1154599-1-pnina.feder%40mobileye.com patch subject: [PATCH v8] panic: add panic_force_cpu= parameter to redirect panic to a specific CPU config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260122/[email protected]/config) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260122/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> kernel/panic.c:79:14: warning: unused variable 'panic_force_buf' [-Wunused-variable]
79 | static char *panic_force_buf;
| ^~~~~~~~~~~~~~~1 warning generated.
vim +/panic_force_buf +79 kernel/panic.c
77
78 static int panic_force_cpu = -1;
> 79 static char *panic_force_buf;
80 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi Pnina,
kernel test robot noticed the following build warnings:
[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master v6.19-rc6 next-20260122] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Pnina-Feder/panic-add-panic_force_cpu-parameter-to-redirect-panic-to-a-specific-CPU/20260122-182657 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20260122102457.1154599-1-pnina.feder%40mobileye.com patch subject: [PATCH v8] panic: add panic_force_cpu= parameter to redirect panic to a specific CPU config: openrisc-allnoconfig (https://download.01.org/0day-ci/archive/20260123/[email protected]/config) compiler: or1k-linux-gcc (GCC) 15.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260123/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> kernel/panic.c:79:14: warning: 'panic_force_buf' defined but not used [-Wunused-variable]
79 | static char *panic_force_buf;
| ^~~~~~~~~~~~~~~vim +/panic_force_buf +79 kernel/panic.c
77
78 static int panic_force_cpu = -1;
> 79 static char *panic_force_buf;
80 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi Pnina,
kernel test robot noticed the following build warnings:
[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master v6.19-rc6 next-20260122] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Pnina-Feder/panic-add-panic_force_cpu-parameter-to-redirect-panic-to-a-specific-CPU/20260122-182657 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20260122102457.1154599-1-pnina.feder%40mobileye.com patch subject: [PATCH v8] panic: add panic_force_cpu= parameter to redirect panic to a specific CPU config: s390-allnoconfig (https://download.01.org/0day-ci/archive/20260123/[email protected]/config) compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260123/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> kernel/panic.c:79:14: warning: unused variable 'panic_force_buf' [-Wunused-variable]
79 | static char *panic_force_buf;
| ^~~~~~~~~~~~~~~1 warning generated.
vim +/panic_force_buf +79 kernel/panic.c
77
78 static int panic_force_cpu = -1;
> 79 static char *panic_force_buf;
80 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Quoted 38 lines · On Thu, 22 Jan 2026 12:24:57 +0200 Pnina Feder <[email protected]> wrote:
Some platforms require panic handling to execute on a specific CPU for crash dump to work reliably. This can be due to firmware limitations, interrupt routing constraints, or platform-specific requirements where only a single CPU is able to safely enter the crash kernel.
Add the panic_force_cpu= kernel command-line parameter to redirect panic execution to a designated CPU. When the parameter is provided, the CPU that initially triggers panic forwards the panic context to the target CPU via IPI, which then proceeds with the normal panic and kexec flow.
The IPI delivery is implemented as a weak function (
panic_smp_redirect_cpu) so architectures with NMI support can override it for more reliable delivery.If the specified CPU is invalid, offline, or a panic is already in progress on another CPU, the redirection is skipped and panic continues on the current CPU.
...
kernel/panic.c +19
-0+ +#if defined(CONFIG_SMP ) && defined(CONFIG_CRASH_DUMP ) +static int __init panic_force_cpu_setup (char *str) +{ +int cpu; + +if (!str) +return -EINVAL ; + +if (kstrtoint (str,0 , &cpu) || cpu <0 || cpu >= nr_cpu_ids) { +pr_warn ("panic_force_cpu: invalid value '%s'\n" , str); +return -EINVAL ; + } + + panic_force_cpu = cpu; +return 0 ; +} +early_param ("panic_force_cpu" , panic_force_cpu_setup); +
kernel/panic.c void __weak crash_smp_send_stop(void) · line 335
Quoted 10 lines
kernel/panic.c +10
-0+static int __init panic_force_cpu_late_init (void ) +{ +if (panic_force_cpu <0 ) +return 0 ; + + panic_force_buf =kmalloc (PANIC_MSG_BUFSZ ,GFP_KERNEL ); + +return 0 ; +} +late_initcall (panic_force_cpu_late_init);
early_param vs late_initcall leaves a window where panic_force_cpu!=0&&panic_force_buf==NULL.
Quoted 15 lines
kernel/panic.c +12
-0+static void do_panic_on_target_cpu (void *info) +{ +panic ("%s" , (char *)info); +} + +/* +* Only one CPU can do the redirect. Use atomic cmpxchg to ensure +* we don't race with another CPU also trying to redirect. +*/ +if (!atomic_try_cmpxchg (&panic_redirect_cpu, &old_cpu, this_cpu)) +return false; +
kernel/panic.c void __weak crash_smp_send_stop(void) · line 416
Quoted 10 lines
kernel/panic.c +10
-0+/* +* Use dynamically allocated buffer if available, otherwise +* fall back to static message for early boot panics or allocation failure. +*/ +if (panic_force_buf) { +vsnprintf (panic_force_buf,PANIC_MSG_BUFSZ , fmt, args); + msg = panic_force_buf; + }else { + msg ="Redirected panic (buffer unavailable)" ; + }
which is handled here. Just showing that I'm paying attention ;)
kernel/panic.c void __weak crash_smp_send_stop(void) · line 426
Quoted 9 lines
kernel/panic.c +9
-0+console_verbose (); +bust_spinlocks (1 ); + +pr_emerg ("panic: Redirecting from CPU %d to CPU %d for crash kernel.\n" , + this_cpu, panic_force_cpu); + +/* Dump original CPU before redirecting */ + if (!test_taint(TAINT_DIE) && + oops_in_progress <= 1 &&
Well look at that. When I invented oops_in_progress (dinosaurs were roaming the earth) it was a boolean. iirc, we didn't have `bool' then.
Now I see that kdb_msg_write() is playing games and appears to be treating it as a scalar. Without, of course, documenting that anywhere.
And then there's this:
./kernel/panic.c: if (test_taint(TAINT_DIE) || oops_in_progress > 1) {
which I assume is connected to kdb_msg_write()'s games.
Anyway, it would be great if someone could figure this out and add a description of this new interpretation at the oops_in_progress definition site.
Also, your test of <= seems inappropriate. 99% of sites treat it as a boolean. </nit>
kernel/panic.c void vpanic(const char *fmt, va_list args) · line 644
Quoted 9 lines
kernel/panic.c +4
-1@@ -483,7 +638,11 @@ void vpanic(const char *fmt, va_list args)/* * Avoid nested stack-dumping if a panic occurs during oops processing */ -if (test_taint (TAINT_DIE ) || oops_in_progress >1 ) { +if (atomic_read (&panic_redirect_cpu) !=PANIC_CPU_INVALID && + panic_force_cpu ==raw_smp_processor_id ()) { +pr_emerg ("panic: Redirected from CPU %d, skipping stack dump.\n" , +atomic_read (&panic_redirect_cpu));
No stack dump because it's the wrong stack, right? Users might wonder where their stack dump went.
kernel/panic.c void vpanic(const char *fmt, va_list args) · line 648
Quoted 4 lines
kernel/panic.c +1
-0+ }else if (test_taint (TAINT_DIE ) || oops_in_progress >1 ) { panic_this_cpu_backtrace_printed = true; }else if (IS_ENABLED (CONFIG_DEBUG_BUGVERBOSE )) {dump_stack ();
Anyway, Looks Nice To Me. I'll queue it in mm.git's non-mm branches and shall probably upstream it for 6.19, but additional review is sought, please.
Hi,
thanks for the review and for queueing this.
Quoted 69 lines · On Thu, 22 Jan 2026 12:24:57 +0200 Pnina Feder <[email protected]> wrote:
Quoted 37 lines
Some platforms require panic handling to execute on a specific CPU for crash dump to work reliably. This can be due to firmware limitations, interrupt routing constraints, or platform-specific requirements where only a single CPU is able to safely enter the crash kernel.
Add the panic_force_cpu= kernel command-line parameter to redirect panic execution to a designated CPU. When the parameter is provided, the CPU that initially triggers panic forwards the panic context to the target CPU via IPI, which then proceeds with the normal panic and kexec flow.
The IPI delivery is implemented as a weak function
(panic_smp_redirect_cpu) so architectures with NMI support can override it for more reliable delivery.If the specified CPU is invalid, offline, or a panic is already in progress on another CPU, the redirection is skipped and panic continues on the current CPU.
...
kernel/panic.c +17
-0+ +#if defined(CONFIG_SMP) && defined(CONFIG_CRASH_DUMP) static int +__init panic_force_cpu_setup (char *str) { +int cpu; + +if (!str) +return -EINVAL ; + +if (kstrtoint (str,0 , &cpu) || cpu <0 || cpu >= nr_cpu_ids) { +pr_warn ("panic_force_cpu: invalid value '%s'\n" , str); +return -EINVAL ; + } + + panic_force_cpu = cpu; +return 0 ; +} +early_param ("panic_force_cpu" , panic_force_cpu_setup);kernel/panic.c void __weak crash_smp_send_stop(void) · line 335
Quoted 10 lines
kernel/panic.c +10
-0+ +static int __init panic_force_cpu_late_init (void ) { +if (panic_force_cpu <0 ) +return 0 ; + + panic_force_buf =kmalloc (PANIC_MSG_BUFSZ ,GFP_KERNEL ); + +return 0 ; +} +late_initcall (panic_force_cpu_late_init);
early_paramvslate_initcallleaves a window where panic_force_cpu!=0&&panic_force_buf==NULL.Quoted 18 lines
kernel/panic.c +15
-0+static void do_panic_on_target_cpu (void *info) { +panic ("%s" , (char *)info); +} + +/* +* Only one CPU can do the redirect. Use atomic cmpxchg to ensure +* we don't race with another CPU also trying to redirect. +*/ +if (!atomic_try_cmpxchg (&panic_redirect_cpu, &old_cpu, this_cpu)) +return false; + +/* +* Use dynamically allocated buffer if available, otherwise +* fall back to static message for early boot panics or allocation failure. +*/
Quoted 8 lines
kernel/panic.c void __weak crash_smp_send_stop(void) · line 416
Quoted 6 lines
kernel/panic.c +6
-0+if (panic_force_buf) { +vsnprintf (panic_force_buf,PANIC_MSG_BUFSZ , fmt, args); + msg = panic_force_buf; + }else { + msg ="Redirected panic (buffer unavailable)" ; + }which is handled here. Just showing that I'm paying attention ;)
Yes indeed, thanks for the attention :)
Quoted 16 lines
kernel/panic.c void __weak crash_smp_send_stop(void) · line 426
Quoted 9 lines
kernel/panic.c +9
-0+console_verbose (); +bust_spinlocks (1 ); + +pr_emerg ("panic: Redirecting from CPU %d to CPU %d for crash kernel.\n" , + this_cpu, panic_force_cpu); + +/* Dump original CPU before redirecting */ + if (!test_taint(TAINT_DIE) && + oops_in_progress <= 1 &&Well look at that. When I invented
oops_in_progress(dinosaurs were roaming the earth) it was a boolean. iirc, we didn't have `bool' then.Now I see that
kdb_msg_write()is playing games and appears to be treating it as a scalar. Without, of course, documenting that anywhere.And then there's this:
Quoted 8 lines
./kernel/panic.c: if (test_taint(TAINT_DIE)||oops_in_progress> 1) {which I assume is connected to kdb_msg_write()'s games.
Anyway, it would be great if someone could figure this out and add a description of this new interpretation at the
oops_in_progressdefinition site.Also, your test of <= seems inappropriate. 99% of sites treat it as a boolean. </nit>
I inverted the existing oops_in_progress > 1 check from vpanic() - so it's the same logic, just the opposite condition. I can change it to !(oops_in_progress > 1) if preferred, but <= 1 seemed cleaner.
Quoted 11 lines
kernel/panic.c void vpanic(const char *fmt, va_list args) · line 644
Quoted 9 lines
kernel/panic.c +4
-1@@ -483,7 +638,11 @@ void vpanic(const char *fmt, va_list args)/* * Avoid nested stack-dumping if a panic occurs during oops processing */ -if (test_taint (TAINT_DIE ) || oops_in_progress >1 ) { +if (atomic_read (&panic_redirect_cpu) !=PANIC_CPU_INVALID && + panic_force_cpu ==raw_smp_processor_id ()) { +pr_emerg ("panic: Redirected from CPU %d, skipping stack dump.\n" , +atomic_read (&panic_redirect_cpu));No stack dump because it's the wrong stack, right? Users might wonder where their stack dump went.
Yes, the stack was already dumped on the original CPU before redirecting, so the user should see it a few lines above. For example:
[ 76.974516] panic: Redirecting from CPU 5 to CPU 0 for crash kernel. [ 76.974524] CPU: 5 UID: 0 PID: 370 Comm: sh Kdump: loaded Not tainted 6.18.0 #1 PREEMPT_RT [ 76.974534] Call Trace: [ 76.974538] [<ffffffff8001437e>] dump_backtrace+0x1c/0x24 [ 76.974551] [<ffffffff800014be>] show_stack+0x28/0x34 [ 76.974557] [<ffffffff8000d3aa>] dump_stack_lvl+0x5e/0x86 [ 76.974563] [<ffffffff8000d3e6>] dump_stack+0x14/0x1c [ 76.974568] [<ffffffff80001b08>] vpanic+0x12e/0x40e [ 76.974573] [<ffffffff80001e18>] do_panic_on_target_cpu+0x0/0x16 [ 76.974579] [<ffffffff80038024>] get_signal+0x874/0x894 [ 76.974588] [<ffffffff80011b5a>] arch_do_signal_or_restart+0x3e/0x922 [ 76.974594] [<ffffffff8072c40a>] irqentry_exit_to_user_mode+0x154/0x232 [ 76.974603] [<ffffffff8072c534>] irqentry_exit+0x4c/0x92 [ 76.974608] [<ffffffff8072bf78>] do_page_fault+0x32/0x48 [ 76.974614] [<ffffffff80738ad4>] handle_exception+0x158/0x164 [ 76.974626] Kernel panic - not syncing: user process fatal error. [ 76.974630] panic: Redirected from CPU 5, skipping stack dump.
Quoted 6 lines
kernel/panic.c void vpanic(const char *fmt, va_list args) · line 648
Quoted 4 lines
kernel/panic.c +1
-0+ }else if (test_taint (TAINT_DIE ) || oops_in_progress >1 ) { panic_this_cpu_backtrace_printed = true; }else if (IS_ENABLED (CONFIG_DEBUG_BUGVERBOSE )) {dump_stack ();Anyway, Looks Nice To Me. I'll queue it in mm.git's non-mm branches and shall probably upstream it for 6.19, but additional review is sought, please.
Thanks a lot,
Pnina
PATCH 1/1 panic: fix unused variable warning when SMP or CRASH_DUMP disabled
In reply to Pnina FederFix for pending patch:
"panic: add panic_force_cpu= parameter to redirect panic to a specific CPU"
Move panic_force_buf inside the #ifdef block to fix unused variable warning when CONFIG_SMP or CONFIG_CRASH_DUMP is not enabled.
--- kernel/panic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/panic.c +2 -1
@@ -76,7 +76,6 @@ EXPORT_SYMBOL_GPL(panic_timeout);unsigned long panic_print;static int panic_force_cpu =-1 ; -static char *panic_force_buf;ATOMIC_NOTIFIER_HEAD (panic_notifier_list);
@@ -306,6 +305,8 @@ atomic_t panic_cpu = ATOMIC_INIT(PANIC_CPU_INVALID);atomic_t panic_redirect_cpu =ATOMIC_INIT (PANIC_CPU_INVALID );#if defined(CONFIG_SMP ) && defined(CONFIG_CRASH_DUMP ) +static char *panic_force_buf; +static int __init panic_force_cpu_setup (char *str) {int cpu;
Signature · 1 line
2.43.0
Quoted 10 lines · Pnina Feder
Some platforms require panic handling to execute on a specific CPU for crash dump to work reliably. This can be due to firmware limitations, interrupt routing constraints, or platform-specific requirements where only a single CPU is able to safely enter the crash kernel.
Add the panic_force_cpu= kernel command-line parameter to redirect panic execution to a designated CPU. When the parameter is provided, the CPU that initially triggers panic forwards the panic context to the target CPU via IPI, which then proceeds with the normal panic and kexec flow.
Quoted 8 lines
The IPI delivery is implemented as a weak function (
panic_smp_redirect_cpu) so architectures with NMI support can override it for more reliable delivery.If the specified CPU is invalid, offline, or a panic is already in progress on another CPU, the redirection is skipped and panic continues on the current CPU.
Signed-off-by Pnina Feder <[email protected]>
I can't see any obvious problem any longer ;-)
Feel free to use:
Best Regards,
Petr