Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <bp@suse.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20220520192729.23969-1-bp@alien8.de

authored by

Borislav Petkov and committed by
Peter Zijlstra
2028a255 620f8d3b

+7 -2
+6 -2
arch/x86/include/asm/extable.h
··· 42 42 extern void early_fixup_exception(struct pt_regs *regs, int trapnr); 43 43 44 44 #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); 46 46 #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 + } 48 52 #endif 49 53 50 54 #if defined(CONFIG_BPF_JIT) && defined(CONFIG_X86_64)
+1
tools/objtool/check.c
··· 187 187 "__invalid_creds", 188 188 "cpu_startup_entry", 189 189 "__ubsan_handle_builtin_unreachable", 190 + "ex_handler_msr_mce", 190 191 }; 191 192 192 193 if (!func)