* [PATCH] powerpc/crash: Fix non-smp kexec preparation
@ 2025-02-10 19:52 Eddie James
2025-02-11 7:38 ` Christophe Leroy
0 siblings, 1 reply; 3+ messages in thread
From: Eddie James @ 2025-02-10 19:52 UTC (permalink / raw)
To: linuxppc-dev; +Cc: maddy, mpe, npiggin, christophe.leroy, naveen, hbathini
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>
---
arch/powerpc/kexec/crash.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/powerpc/kexec/crash.c b/arch/powerpc/kexec/crash.c
index 9ac3266e49652..8c11cfd19e734 100644
--- a/arch/powerpc/kexec/crash.c
+++ b/arch/powerpc/kexec/crash.c
@@ -359,7 +359,11 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
if (TRAP(regs) == INTERRUPT_SYSTEM_RESET)
is_via_system_reset = 1;
+#ifdef CONFIG_SMP
crash_smp_send_stop();
+#else
+ crash_kexec_prepare();
+#endif
crash_save_cpu(regs, crashing_cpu);
--
2.43.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/crash: Fix non-smp kexec preparation
2025-02-10 19:52 [PATCH] powerpc/crash: Fix non-smp kexec preparation Eddie James
@ 2025-02-11 7:38 ` Christophe Leroy
2025-02-11 16:08 ` Eddie James
0 siblings, 1 reply; 3+ messages in thread
From: Christophe Leroy @ 2025-02-11 7:38 UTC (permalink / raw)
To: Eddie James, linuxppc-dev
Cc: maddy, mpe, npiggin, christophe.leroy, naveen, hbathini
Le 10/02/2025 à 20:52, Eddie James a écrit :
> [Vous ne recevez pas souvent de courriers de eajames@linux.ibm.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
>
> 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>
> ---
> arch/powerpc/kexec/crash.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/powerpc/kexec/crash.c b/arch/powerpc/kexec/crash.c
> index 9ac3266e49652..8c11cfd19e734 100644
> --- a/arch/powerpc/kexec/crash.c
> +++ b/arch/powerpc/kexec/crash.c
> @@ -359,7 +359,11 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
> if (TRAP(regs) == INTERRUPT_SYSTEM_RESET)
> is_via_system_reset = 1;
>
> +#ifdef CONFIG_SMP
I see no obvious reason to use #ifdef instead of IS_ENABLED(CONFIG_SMP),
is there any ?
Ref
https://docs.kernel.org/process/coding-style.html#conditional-compilation
> crash_smp_send_stop();
> +#else
> + crash_kexec_prepare();
> +#endif
>
> crash_save_cpu(regs, crashing_cpu);
>
> --
> 2.43.5
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/crash: Fix non-smp kexec preparation
2025-02-11 7:38 ` Christophe Leroy
@ 2025-02-11 16:08 ` Eddie James
0 siblings, 0 replies; 3+ messages in thread
From: Eddie James @ 2025-02-11 16:08 UTC (permalink / raw)
To: Christophe Leroy, linuxppc-dev; +Cc: maddy, mpe, npiggin, naveen, hbathini
On 2/11/25 01:38, Christophe Leroy wrote:
>
>
> Le 10/02/2025 à 20:52, Eddie James a écrit :
>> [Vous ne recevez pas souvent de courriers de eajames@linux.ibm.com.
>> Découvrez pourquoi ceci est important à
>> https://aka.ms/LearnAboutSenderIdentification ]
>>
>> 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>
>> ---
>> arch/powerpc/kexec/crash.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/powerpc/kexec/crash.c b/arch/powerpc/kexec/crash.c
>> index 9ac3266e49652..8c11cfd19e734 100644
>> --- a/arch/powerpc/kexec/crash.c
>> +++ b/arch/powerpc/kexec/crash.c
>> @@ -359,7 +359,11 @@ void default_machine_crash_shutdown(struct
>> pt_regs *regs)
>> if (TRAP(regs) == INTERRUPT_SYSTEM_RESET)
>> is_via_system_reset = 1;
>>
>> +#ifdef CONFIG_SMP
>
> I see no obvious reason to use #ifdef instead of
> IS_ENABLED(CONFIG_SMP), is there any ?
>
> Ref
> https://docs.kernel.org/process/coding-style.html#conditional-compilation
Oops, no, just my habit. I'll change it.
Thanks,
Eddie
>
>> crash_smp_send_stop();
>> +#else
>> + crash_kexec_prepare();
>> +#endif
>>
>> crash_save_cpu(regs, crashing_cpu);
>>
>> --
>> 2.43.5
>>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-11 16:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-10 19:52 [PATCH] powerpc/crash: Fix non-smp kexec preparation Eddie James
2025-02-11 7:38 ` Christophe Leroy
2025-02-11 16:08 ` Eddie James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).