Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

s390/smp: Mark pcpu_delegate() and smp_call_ipl_cpu() as __noreturn

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.

Also annotate smp_call_ipl_cpu() accordingly since it always calls
pcpu_delegate().

[hca: Merge two patches from Thorsten Blum]

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

authored by

Thorsten Blum and committed by
Heiko Carstens
eb3a9b40 f07ebfa5

+5 -5
+1 -1
arch/s390/include/asm/smp.h
··· 43 43 extern void arch_send_call_function_single_ipi(int cpu); 44 44 extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); 45 45 46 - extern void smp_call_ipl_cpu(void (*func)(void *), void *); 46 + extern void __noreturn smp_call_ipl_cpu(void (*func)(void *), void *data); 47 47 extern void smp_emergency_stop(void); 48 48 49 49 extern int smp_find_processor_id(u16 address);
+4 -4
arch/s390/kernel/smp.c
··· 305 305 func(data); /* should not return */ 306 306 } 307 307 308 - static void pcpu_delegate(struct pcpu *pcpu, int cpu, 309 - pcpu_delegate_fn *func, 310 - void *data, unsigned long stack) 308 + static void __noreturn pcpu_delegate(struct pcpu *pcpu, int cpu, 309 + pcpu_delegate_fn *func, 310 + void *data, unsigned long stack) 311 311 { 312 312 struct lowcore *lc, *abs_lc; 313 313 unsigned int source_cpu; ··· 370 370 /* 371 371 * Call function on the ipl CPU. 372 372 */ 373 - void smp_call_ipl_cpu(void (*func)(void *), void *data) 373 + void __noreturn smp_call_ipl_cpu(void (*func)(void *), void *data) 374 374 { 375 375 struct lowcore *lc = lowcore_ptr[0]; 376 376