Skip to content

Commit 2028a25

Browse files
suryasaimadhuPeter Zijlstra
authored andcommitted
x86/extable: Annotate ex_handler_msr_mce() as a dead end
Fix vmlinux.o: warning: objtool: fixup_exception+0x2d6: unreachable instruction Signed-off-by: Borislav Petkov <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 620f8d3 commit 2028a25

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

arch/x86/include/asm/extable.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ extern int ex_get_fixup_type(unsigned long ip);
4242
extern void early_fixup_exception(struct pt_regs *regs, int trapnr);
4343

4444
#ifdef CONFIG_X86_MCE
45-
extern void ex_handler_msr_mce(struct pt_regs *regs, bool wrmsr);
45+
extern void __noreturn ex_handler_msr_mce(struct pt_regs *regs, bool wrmsr);
4646
#else
47-
static inline void ex_handler_msr_mce(struct pt_regs *regs, bool wrmsr) { }
47+
static inline void __noreturn ex_handler_msr_mce(struct pt_regs *regs, bool wrmsr)
48+
{
49+
for (;;)
50+
cpu_relax();
51+
}
4852
#endif
4953

5054
#if defined(CONFIG_BPF_JIT) && defined(CONFIG_X86_64)

tools/objtool/check.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
187187
"__invalid_creds",
188188
"cpu_startup_entry",
189189
"__ubsan_handle_builtin_unreachable",
190+
"ex_handler_msr_mce",
190191
};
191192

192193
if (!func)

0 commit comments

Comments
 (0)