Commit 7412a60d authored by Josh Poimboeuf's avatar Josh Poimboeuf Committed by Peter Zijlstra

cpu: Mark panic_smp_self_stop() __noreturn

In preparation for improving objtool's handling of weak noreturn
functions, mark panic_smp_self_stop() __noreturn.
Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/92d76ab5c8bf660f04fdcd3da1084519212de248.1681342859.git.jpoimboe@kernel.org
parent 5ab6876c
...@@ -779,7 +779,7 @@ void smp_send_stop(void) ...@@ -779,7 +779,7 @@ void smp_send_stop(void)
* kdump fails. So split out the panic_smp_self_stop() and add * kdump fails. So split out the panic_smp_self_stop() and add
* set_cpu_online(smp_processor_id(), false). * set_cpu_online(smp_processor_id(), false).
*/ */
void panic_smp_self_stop(void) void __noreturn panic_smp_self_stop(void)
{ {
pr_debug("CPU %u will stop doing anything useful since another CPU has paniced\n", pr_debug("CPU %u will stop doing anything useful since another CPU has paniced\n",
smp_processor_id()); smp_processor_id());
......
...@@ -143,7 +143,6 @@ bool cpus_are_stuck_in_kernel(void); ...@@ -143,7 +143,6 @@ bool cpus_are_stuck_in_kernel(void);
extern void crash_smp_send_stop(void); extern void crash_smp_send_stop(void);
extern bool smp_crash_stop_failed(void); extern bool smp_crash_stop_failed(void);
extern void panic_smp_self_stop(void);
#endif /* ifndef __ASSEMBLY__ */ #endif /* ifndef __ASSEMBLY__ */
......
...@@ -830,7 +830,7 @@ static void __noreturn local_cpu_stop(void) ...@@ -830,7 +830,7 @@ static void __noreturn local_cpu_stop(void)
* that cpu_online_mask gets correctly updated and smp_send_stop() can skip * that cpu_online_mask gets correctly updated and smp_send_stop() can skip
* CPUs that have already stopped themselves. * CPUs that have already stopped themselves.
*/ */
void panic_smp_self_stop(void) void __noreturn panic_smp_self_stop(void)
{ {
local_cpu_stop(); local_cpu_stop();
} }
......
...@@ -480,7 +480,7 @@ void early_setup_secondary(void) ...@@ -480,7 +480,7 @@ void early_setup_secondary(void)
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
void panic_smp_self_stop(void) void __noreturn panic_smp_self_stop(void)
{ {
hard_irq_disable(); hard_irq_disable();
spin_begin(); spin_begin();
......
...@@ -59,7 +59,7 @@ int smp_call_function_single_async(int cpu, struct __call_single_data *csd); ...@@ -59,7 +59,7 @@ int smp_call_function_single_async(int cpu, struct __call_single_data *csd);
* Cpus stopping functions in panic. All have default weak definitions. * Cpus stopping functions in panic. All have default weak definitions.
* Architecture-dependent code may override them. * Architecture-dependent code may override them.
*/ */
void panic_smp_self_stop(void); void __noreturn panic_smp_self_stop(void);
void nmi_panic_self_stop(struct pt_regs *regs); void nmi_panic_self_stop(struct pt_regs *regs);
void crash_smp_send_stop(void); void crash_smp_send_stop(void);
......
...@@ -141,7 +141,7 @@ EXPORT_SYMBOL(panic_blink); ...@@ -141,7 +141,7 @@ EXPORT_SYMBOL(panic_blink);
/* /*
* Stop ourself in panic -- architecture code may override this * Stop ourself in panic -- architecture code may override this
*/ */
void __weak panic_smp_self_stop(void) void __weak __noreturn panic_smp_self_stop(void)
{ {
while (1) while (1)
cpu_relax(); cpu_relax();
......
...@@ -218,6 +218,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func, ...@@ -218,6 +218,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
"machine_real_restart", "machine_real_restart",
"make_task_dead", "make_task_dead",
"panic", "panic",
"panic_smp_self_stop",
"rest_init", "rest_init",
"rewind_stack_and_make_dead", "rewind_stack_and_make_dead",
"sev_es_terminate", "sev_es_terminate",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment