Commit eb3a9b40 authored by Thorsten Blum's avatar Thorsten Blum Committed by Heiko Carstens
Browse files

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: default avatarThorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent f07ebfa5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+4 −4
Original line number Diff line number Diff line
@@ -305,7 +305,7 @@ static void __pcpu_delegate(pcpu_delegate_fn *func, void *data)
	func(data);	/* should not return */
}

static void pcpu_delegate(struct pcpu *pcpu, int cpu,
static void __noreturn pcpu_delegate(struct pcpu *pcpu, int cpu,
				     pcpu_delegate_fn *func,
				     void *data, unsigned long stack)
{
@@ -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];