[PATCH v2] powerpc/crash: Fix non-smp kexec preparation

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE455d

3 messages, 3 authors, 2025-05-04 · open the first message on its own page

[PATCH v2] powerpc/crash: Fix non-smp kexec preparation

From: Eddie James <eajames@linux.ibm.com>
Date: 2025-02-11 16:21:12

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>
---
Changes since v1:
 - Use if (IS_ENABLED(CONFIG_SMP)) instead of #ifdef CONFIG_SMP

 arch/powerpc/kexec/crash.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kexec/crash.c b/arch/powerpc/kexec/crash.c
index 9ac3266e49652..a325c1c02f96d 100644
--- a/arch/powerpc/kexec/crash.c
+++ b/arch/powerpc/kexec/crash.c
@@ -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);
 
-- 
2.43.5

Re: [PATCH v2] powerpc/crash: Fix non-smp kexec preparation

From: Hari Bathini <hbathini@linux.ibm.com>
Date: 2025-02-17 06:34:09

Hi Eddie,

On 11/02/25 9:50 pm, Eddie James wrote:
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.
Thanks for fixing this.
Looks good to me.

Reviewed-by: Hari Bathini <hbathini@linux.ibm.com>
quoted hunk
Fixes: c7255058b543 ("powerpc/crash: save cpu register data in crash_smp_send_stop()")
Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
Changes since v1:
  - Use if (IS_ENABLED(CONFIG_SMP)) instead of #ifdef CONFIG_SMP

  arch/powerpc/kexec/crash.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kexec/crash.c b/arch/powerpc/kexec/crash.c
index 9ac3266e49652..a325c1c02f96d 100644
--- a/arch/powerpc/kexec/crash.c
+++ b/arch/powerpc/kexec/crash.c
@@ -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);
  

Re: [PATCH v2] powerpc/crash: Fix non-smp kexec preparation

From: Madhavan Srinivasan <maddy@linux.ibm.com>
Date: 2025-05-04 03:21:41

On Tue, 11 Feb 2025 10:20:54 -0600, Eddie James wrote:
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.
Applied to powerpc/next.

[1/1] powerpc/crash: Fix non-smp kexec preparation
      https://git.kernel.org/powerpc/c/882b25af265de8e05c66f72b9a29f6047102958f

Thanks
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help