Re: linux-next: build warning after merge of the tip tree

From: Peter Zijlstra
Date: Mon Oct 24 2022 - 05:00:58 EST


On Mon, Oct 24, 2022 at 11:28:45AM +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the tip tree, today's linux-next build (x86_64 allmodconfig)
> produced this warning:
>
> vmlinux.o: warning: objtool: get_cpu_entry_area+0x4: call to cea_offset() leaves .noinstr.text section
>
> Presumably something to do with commit
>
> 1248fb6a8201 ("x86/mm: Randomize per-cpu entry area")

Thanks, and yesh Boris said the same late on Friday... all the *SAN
stuff tickled the compiler's stupid bone again.

The below cures it, Dave, do we fold it in or mash on top?


diff --git a/arch/x86/mm/cpu_entry_area.c b/arch/x86/mm/cpu_entry_area.c
index ad1f750517a1..a8f18e613190 100644
--- a/arch/x86/mm/cpu_entry_area.c
+++ b/arch/x86/mm/cpu_entry_area.c
@@ -18,7 +18,7 @@ DEFINE_PER_CPU(struct cea_exception_stacks*, cea_exception_stacks);

static DEFINE_PER_CPU_READ_MOSTLY(unsigned long, _cea_offset);

-static inline unsigned int cea_offset(unsigned int cpu)
+static __always_inline unsigned int cea_offset(unsigned int cpu)
{
return per_cpu(_cea_offset, cpu);
}
@@ -52,7 +52,7 @@ static __init void init_cea_offsets(void)
#else /* !X86_64 */
DECLARE_PER_CPU_PAGE_ALIGNED(struct doublefault_stack, doublefault_stack);

-static inline unsigned int cea_offset(unsigned int cpu)
+static __always_inline unsigned int cea_offset(unsigned int cpu)
{
return cpu;
}