* [PATCH 1/2] s390/smp: Mark pcpu_delegate as __noreturn
@ 2025-10-30 13:42 Thorsten Blum
2025-10-30 13:42 ` [PATCH 2/2] s390/smp: Mark smp_call_ipl_cpu " Thorsten Blum
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2025-10-30 13:42 UTC (permalink / raw)
To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Mete Durlu, Guo Weikang
Cc: Thorsten Blum, linux-s390, linux-kernel
pcpu_delegate() never returns to its caller. If the target CPU is the
current CPU, it calls __pcpu_delegate(), whose delegate function is not
supposed to return. In any case, even if __pcpu_delegate() unexpectedly
returns, pcpu_delegate() sends SIGP_STOP to the current CPU and waits
in an infinite loop. Annotate pcpu_delegate() with the __noreturn
attribute to improve compiler optimizations.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
arch/s390/kernel/smp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index da84c0dc6b7e..93ac451db6f9 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -305,9 +305,9 @@ static void __pcpu_delegate(pcpu_delegate_fn *func, void *data)
func(data); /* should not return */
}
-static void pcpu_delegate(struct pcpu *pcpu, int cpu,
- pcpu_delegate_fn *func,
- void *data, unsigned long stack)
+static void __noreturn pcpu_delegate(struct pcpu *pcpu, int cpu,
+ pcpu_delegate_fn *func,
+ void *data, unsigned long stack)
{
struct lowcore *lc, *abs_lc;
unsigned int source_cpu;
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH 2/2] s390/smp: Mark smp_call_ipl_cpu as __noreturn
2025-10-30 13:42 [PATCH 1/2] s390/smp: Mark pcpu_delegate as __noreturn Thorsten Blum
@ 2025-10-30 13:42 ` Thorsten Blum
0 siblings, 0 replies; 2+ messages in thread
From: Thorsten Blum @ 2025-10-30 13:42 UTC (permalink / raw)
To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Guo Weikang
Cc: Thorsten Blum, Mete Durlu, linux-s390, linux-kernel
smp_call_ipl_cpu() ends by calling the non-returning function
pcpu_delegate() and therefore also never returns. Annotate it with the
__noreturn attribute to improve compiler optimizations.
Add an identifier name to the function declaration to silence a
checkpatch warning.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
arch/s390/include/asm/smp.h | 2 +-
arch/s390/kernel/smp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h
index 03f4d01664f8..fb2bdbf35da5 100644
--- a/arch/s390/include/asm/smp.h
+++ b/arch/s390/include/asm/smp.h
@@ -43,7 +43,7 @@ extern int __cpu_up(unsigned int cpu, struct task_struct *tidle);
extern void arch_send_call_function_single_ipi(int cpu);
extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
-extern void smp_call_ipl_cpu(void (*func)(void *), void *);
+extern void __noreturn smp_call_ipl_cpu(void (*func)(void *), void *data);
extern void smp_emergency_stop(void);
extern int smp_find_processor_id(u16 address);
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 93ac451db6f9..49c8cb718210 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -370,7 +370,7 @@ static int pcpu_set_smt(unsigned int mtid)
/*
* Call function on the ipl CPU.
*/
-void smp_call_ipl_cpu(void (*func)(void *), void *data)
+void __noreturn smp_call_ipl_cpu(void (*func)(void *), void *data)
{
struct lowcore *lc = lowcore_ptr[0];
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-30 13:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-30 13:42 [PATCH 1/2] s390/smp: Mark pcpu_delegate as __noreturn Thorsten Blum
2025-10-30 13:42 ` [PATCH 2/2] s390/smp: Mark smp_call_ipl_cpu " Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox