Skip to content

Commit 27dea14

Browse files
jpoimboePeter Zijlstra
authored and
Peter Zijlstra
committed
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: Josh Poimboeuf <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/316fc6dfab5a8c4e024c7185484a1ee5fb0afb79.1681342859.git.jpoimboe@kernel.org
1 parent 7412a60 commit 27dea14

File tree

5 files changed

+4
-4
lines changed

5 files changed

+4
-4
lines changed

arch/x86/include/asm/reboot.h

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ void __noreturn machine_real_restart(unsigned int type);
2828
void cpu_emergency_disable_virtualization(void);
2929

3030
typedef void (*nmi_shootdown_cb)(int, struct pt_regs*);
31-
void nmi_panic_self_stop(struct pt_regs *regs);
3231
void nmi_shootdown_cpus(nmi_shootdown_cb callback);
3332
void run_crash_ipi_callback(struct pt_regs *regs);
3433

arch/x86/kernel/reboot.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ void run_crash_ipi_callback(struct pt_regs *regs)
920920
}
921921

922922
/* Override the weak function in kernel/panic.c */
923-
void nmi_panic_self_stop(struct pt_regs *regs)
923+
void __noreturn nmi_panic_self_stop(struct pt_regs *regs)
924924
{
925925
while (1) {
926926
/* If no CPU is preparing crash dump, we simply loop here. */

include/linux/smp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int smp_call_function_single_async(int cpu, struct __call_single_data *csd);
6060
* Architecture-dependent code may override them.
6161
*/
6262
void __noreturn panic_smp_self_stop(void);
63-
void nmi_panic_self_stop(struct pt_regs *regs);
63+
void __noreturn nmi_panic_self_stop(struct pt_regs *regs);
6464
void crash_smp_send_stop(void);
6565

6666
/*

kernel/panic.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void __weak __noreturn panic_smp_self_stop(void)
151151
* Stop ourselves in NMI context if another CPU has already panicked. Arch code
152152
* may override this to prepare for crash dumping, e.g. save regs info.
153153
*/
154-
void __weak nmi_panic_self_stop(struct pt_regs *regs)
154+
void __weak __noreturn nmi_panic_self_stop(struct pt_regs *regs)
155155
{
156156
panic_smp_self_stop();
157157
}

tools/objtool/check.c

+1
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
217217
"lbug_with_loc",
218218
"machine_real_restart",
219219
"make_task_dead",
220+
"nmi_panic_self_stop",
220221
"panic",
221222
"panic_smp_self_stop",
222223
"rest_init",

0 commit comments

Comments
 (0)