Skip to content

Commit

Permalink
objtool: Fix for unreachable instruction warning
Browse files Browse the repository at this point in the history
On Sat, Jan 28, 2023 at 11:06:34AM -0800, Paul E. McKenney wrote:
> Sorry to be a nag, but I am still seeing this.  Not a huge problem because
> I now filter it out so that it does not get in the way of other bugs,
> but I figured that I should follow up.

Does this fix it? (works for me)

If so, I'll need to extend it for all arches.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
  • Loading branch information
jpoimboe authored and paulmckrcu committed Feb 22, 2023
1 parent 36de6b5 commit a680938
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions arch/x86/kernel/process.c
Expand Up @@ -712,6 +712,7 @@ void arch_cpu_idle_enter(void)
void arch_cpu_idle_dead(void)
{
play_dead();
BUG();
}

/*
Expand Down
2 changes: 1 addition & 1 deletion include/linux/cpu.h
Expand Up @@ -185,7 +185,7 @@ void arch_cpu_idle(void);
void arch_cpu_idle_prepare(void);
void arch_cpu_idle_enter(void);
void arch_cpu_idle_exit(void);
void arch_cpu_idle_dead(void);
void __noreturn arch_cpu_idle_dead(void);

int cpu_report_state(int cpu);
int cpu_check_up_prepare(int cpu);
Expand Down
2 changes: 1 addition & 1 deletion kernel/sched/idle.c
Expand Up @@ -71,7 +71,7 @@ static noinline int __cpuidle cpu_idle_poll(void)
void __weak arch_cpu_idle_prepare(void) { }
void __weak arch_cpu_idle_enter(void) { }
void __weak arch_cpu_idle_exit(void) { }
void __weak arch_cpu_idle_dead(void) { }
void __weak arch_cpu_idle_dead(void) { while (1); }
void __weak arch_cpu_idle(void)
{
cpu_idle_force_poll = 1;
Expand Down
1 change: 1 addition & 0 deletions tools/objtool/check.c
Expand Up @@ -167,6 +167,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
"__reiserfs_panic",
"__stack_chk_fail",
"__ubsan_handle_builtin_unreachable",
"arch_cpu_idle_dead",
"cpu_bringup_and_idle",
"cpu_startup_entry",
"do_exit",
Expand Down

0 comments on commit a680938

Please sign in to comment.