Re: [PATCH] static_call: Use single copy of static_call_return0

From: Peter Zijlstra
Date: Mon Apr 26 2021 - 04:17:57 EST


On Sun, Apr 25, 2021 at 02:11:40PM -0700, Andi Kleen wrote:
> With the inline version of static calls it is trying to use
> all static call functions inline. But this doesn't work for
> __static_call_return0, because its address is always taken,
> which forces the compiler to generate a out of line copy.
>
> If it only exists as a static inline this means there are
> many copies generated. Instead use the out of line in static_call.c
> for this.
>
> This fixes another bug. When _INLINE is set static_inline.c was
> not compiled at all, which disabled the self test even when
> it was enabled in the configuration.
>
> This fixes a build problem with gcc LTO. __static_call_return0
> is referenced from assembler, which requires making it global
> because the assembler can end in a different file than the other
> C code. But that's not possible for a static inline function.

This is ARCH=i386 only afaict, why do we care?