Commit 27dea14c authored by Josh Poimboeuf's avatar Josh Poimboeuf Committed by Peter Zijlstra

cpu: Mark nmi_panic_self_stop() __noreturn

In preparation for improving objtool's handling of weak noreturn
functions, mark nmi_panic_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/316fc6dfab5a8c4e024c7185484a1ee5fb0afb79.1681342859.git.jpoimboe@kernel.org
parent 7412a60d
...@@ -28,7 +28,6 @@ void __noreturn machine_real_restart(unsigned int type); ...@@ -28,7 +28,6 @@ void __noreturn machine_real_restart(unsigned int type);
void cpu_emergency_disable_virtualization(void); void cpu_emergency_disable_virtualization(void);
typedef void (*nmi_shootdown_cb)(int, struct pt_regs*); typedef void (*nmi_shootdown_cb)(int, struct pt_regs*);
void nmi_panic_self_stop(struct pt_regs *regs);
void nmi_shootdown_cpus(nmi_shootdown_cb callback); void nmi_shootdown_cpus(nmi_shootdown_cb callback);
void run_crash_ipi_callback(struct pt_regs *regs); void run_crash_ipi_callback(struct pt_regs *regs);
......
...@@ -920,7 +920,7 @@ void run_crash_ipi_callback(struct pt_regs *regs) ...@@ -920,7 +920,7 @@ void run_crash_ipi_callback(struct pt_regs *regs)
} }
/* Override the weak function in kernel/panic.c */ /* Override the weak function in kernel/panic.c */
void nmi_panic_self_stop(struct pt_regs *regs) void __noreturn nmi_panic_self_stop(struct pt_regs *regs)
{ {
while (1) { while (1) {
/* If no CPU is preparing crash dump, we simply loop here. */ /* If no CPU is preparing crash dump, we simply loop here. */
......
...@@ -60,7 +60,7 @@ int smp_call_function_single_async(int cpu, struct __call_single_data *csd); ...@@ -60,7 +60,7 @@ int smp_call_function_single_async(int cpu, struct __call_single_data *csd);
* Architecture-dependent code may override them. * Architecture-dependent code may override them.
*/ */
void __noreturn panic_smp_self_stop(void); void __noreturn panic_smp_self_stop(void);
void nmi_panic_self_stop(struct pt_regs *regs); void __noreturn nmi_panic_self_stop(struct pt_regs *regs);
void crash_smp_send_stop(void); void crash_smp_send_stop(void);
/* /*
......
...@@ -151,7 +151,7 @@ void __weak __noreturn panic_smp_self_stop(void) ...@@ -151,7 +151,7 @@ void __weak __noreturn panic_smp_self_stop(void)
* Stop ourselves in NMI context if another CPU has already panicked. Arch code * Stop ourselves in NMI context if another CPU has already panicked. Arch code
* may override this to prepare for crash dumping, e.g. save regs info. * may override this to prepare for crash dumping, e.g. save regs info.
*/ */
void __weak nmi_panic_self_stop(struct pt_regs *regs) void __weak __noreturn nmi_panic_self_stop(struct pt_regs *regs)
{ {
panic_smp_self_stop(); panic_smp_self_stop();
} }
......
...@@ -217,6 +217,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func, ...@@ -217,6 +217,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
"lbug_with_loc", "lbug_with_loc",
"machine_real_restart", "machine_real_restart",
"make_task_dead", "make_task_dead",
"nmi_panic_self_stop",
"panic", "panic",
"panic_smp_self_stop", "panic_smp_self_stop",
"rest_init", "rest_init",
......
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