powerpc/crash: Fix non-smp kexec preparation
authorEddie James <eajames@linux.ibm.com>
Tue, 11 Feb 2025 16:20:54 +0000 (10:20 -0600)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Tue, 29 Apr 2025 06:10:46 +0000 (11:40 +0530)
In non-smp configurations, crash_kexec_prepare is never called in
the crash shutdown path. One result of this is that the crashing_cpu
variable is never set, preventing crash_save_cpu from storing the
NT_PRSTATUS elf note in the core dump.

Fixes: c7255058b543 ("powerpc/crash: save cpu register data in crash_smp_send_stop()")
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250211162054.857762-1-eajames@linux.ibm.com
arch/powerpc/kexec/crash.c

index 9ac3266e49652240c4ecdadb2095ee0a58442c38..a325c1c02f96dc8ca459406126e768d21ff87e8a 100644 (file)
@@ -359,7 +359,10 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
        if (TRAP(regs) == INTERRUPT_SYSTEM_RESET)
                is_via_system_reset = 1;
 
-       crash_smp_send_stop();
+       if (IS_ENABLED(CONFIG_SMP))
+               crash_smp_send_stop();
+       else
+               crash_kexec_prepare();
 
        crash_save_cpu(regs, crashing_cpu);