[tip: objtool/core] x86/cpu: Mark {hlt,resume}_play_dead() __noreturn

From: tip-bot2 for Josh Poimboeuf
Date: Mon Apr 17 2023 - 06:49:29 EST


The following commit has been merged into the objtool/core branch of tip:

Commit-ID: 52668badd34b4b346f32c33a9bcba069a06c3caa
Gitweb: https://git.kernel.org/tip/52668badd34b4b346f32c33a9bcba069a06c3caa
Author: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
AuthorDate: Wed, 12 Apr 2023 16:49:39 -07:00
Committer: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
CommitterDate: Fri, 14 Apr 2023 17:31:27 +02:00

x86/cpu: Mark {hlt,resume}_play_dead() __noreturn

Fixes the following warning:

vmlinux.o: warning: objtool: resume_play_dead+0x21: unreachable instruction

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/ce1407c4bf88b1334fe40413126343792a77ca50.1681342859.git.jpoimboe@xxxxxxxxxx
---
arch/x86/include/asm/smp.h | 2 +-
arch/x86/kernel/smpboot.c | 2 +-
arch/x86/power/cpu.c | 2 +-
tools/objtool/check.c | 2 ++
4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index e6d1d28..47ce4c7 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -125,7 +125,7 @@ int native_cpu_up(unsigned int cpunum, struct task_struct *tidle);
int native_cpu_disable(void);
int common_cpu_die(unsigned int cpu);
void native_cpu_die(unsigned int cpu);
-void hlt_play_dead(void);
+void __noreturn hlt_play_dead(void);
void native_play_dead(void);
void play_dead_common(void);
void wbinvd_on_cpu(int cpu);
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 9013bb2..a6da3f9 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1816,7 +1816,7 @@ static inline void mwait_play_dead(void)
}
}

-void hlt_play_dead(void)
+void __noreturn hlt_play_dead(void)
{
if (__this_cpu_read(cpu_info.x86) >= 4)
wbinvd();
diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
index 236447e..7a4d5e9 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
@@ -288,7 +288,7 @@ EXPORT_SYMBOL(restore_processor_state);
#endif

#if defined(CONFIG_HIBERNATION) && defined(CONFIG_HOTPLUG_CPU)
-static void resume_play_dead(void)
+static void __noreturn resume_play_dead(void)
{
play_dead_common();
tboot_shutdown(TB_SHUTDOWN_WFS);
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index ceb9848..724a63b 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -212,6 +212,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
"do_task_dead",
"ex_handler_msr_mce",
"fortify_panic",
+ "hlt_play_dead",
"kthread_complete_and_exit",
"kthread_exit",
"kunit_try_catch_throw",
@@ -222,6 +223,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
"panic",
"panic_smp_self_stop",
"rest_init",
+ "resume_play_dead",
"rewind_stack_and_make_dead",
"sev_es_terminate",
"snp_abort",