Skip to content

Commit 52668ba

Browse files
jpoimboePeter Zijlstra
authored andcommitted
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@intel.com> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/ce1407c4bf88b1334fe40413126343792a77ca50.1681342859.git.jpoimboe@kernel.org
1 parent 09c5ae3 commit 52668ba

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

arch/x86/include/asm/smp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ int native_cpu_up(unsigned int cpunum, struct task_struct *tidle);
125125
int native_cpu_disable(void);
126126
int common_cpu_die(unsigned int cpu);
127127
void native_cpu_die(unsigned int cpu);
128-
void hlt_play_dead(void);
128+
void __noreturn hlt_play_dead(void);
129129
void native_play_dead(void);
130130
void play_dead_common(void);
131131
void wbinvd_on_cpu(int cpu);

arch/x86/kernel/smpboot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,7 @@ static inline void mwait_play_dead(void)
18161816
}
18171817
}
18181818

1819-
void hlt_play_dead(void)
1819+
void __noreturn hlt_play_dead(void)
18201820
{
18211821
if (__this_cpu_read(cpu_info.x86) >= 4)
18221822
wbinvd();

arch/x86/power/cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ EXPORT_SYMBOL(restore_processor_state);
288288
#endif
289289

290290
#if defined(CONFIG_HIBERNATION) && defined(CONFIG_HOTPLUG_CPU)
291-
static void resume_play_dead(void)
291+
static void __noreturn resume_play_dead(void)
292292
{
293293
play_dead_common();
294294
tboot_shutdown(TB_SHUTDOWN_WFS);

tools/objtool/check.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
212212
"do_task_dead",
213213
"ex_handler_msr_mce",
214214
"fortify_panic",
215+
"hlt_play_dead",
215216
"kthread_complete_and_exit",
216217
"kthread_exit",
217218
"kunit_try_catch_throw",
@@ -222,6 +223,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
222223
"panic",
223224
"panic_smp_self_stop",
224225
"rest_init",
226+
"resume_play_dead",
225227
"rewind_stack_and_make_dead",
226228
"sev_es_terminate",
227229
"snp_abort",

0 commit comments

Comments
 (0)