Skip to content

Commit 554eec0

Browse files
committed
x86/mce: Always inline old MCA stubs
The stubs for the ancient MCA support (CONFIG_X86_ANCIENT_MCE) are normally optimized away on 64-bit builds. However, an allmodconfig one causes the compiler to add sanitizer calls gunk into them and they exist as constprop calls. Which objtool then complains about: vmlinux.o: warning: objtool: do_machine_check+0xad8: call to \ pentium_machine_check.constprop.0() leaves .noinstr.text section due to them missing noinstr. One could tag them "noinstr" but what should really happen is, they should be forcefully inlined so that all that gunk gets optimized away and the warning doesn't even have a chance to fire. Do so. No functional changes. Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20230222191054.4701-1-bp@alien8.de
1 parent 7214b32 commit 554eec0

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

arch/x86/kernel/cpu/mce/internal.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,11 @@ noinstr void pentium_machine_check(struct pt_regs *regs);
244244
noinstr void winchip_machine_check(struct pt_regs *regs);
245245
static inline void enable_p5_mce(void) { mce_p5_enabled = 1; }
246246
#else
247-
static inline void intel_p5_mcheck_init(struct cpuinfo_x86 *c) {}
248-
static inline void winchip_mcheck_init(struct cpuinfo_x86 *c) {}
249-
static inline void enable_p5_mce(void) {}
250-
static inline void pentium_machine_check(struct pt_regs *regs) {}
251-
static inline void winchip_machine_check(struct pt_regs *regs) {}
247+
static __always_inline void intel_p5_mcheck_init(struct cpuinfo_x86 *c) {}
248+
static __always_inline void winchip_mcheck_init(struct cpuinfo_x86 *c) {}
249+
static __always_inline void enable_p5_mce(void) {}
250+
static __always_inline void pentium_machine_check(struct pt_regs *regs) {}
251+
static __always_inline void winchip_machine_check(struct pt_regs *regs) {}
252252
#endif
253253

254254
noinstr u64 mce_rdmsrl(u32 msr);

0 commit comments

Comments
 (0)