arm64: Mark functions using explicit register variables as '__always_inline'
authorWill Deacon <will@kernel.org>
Tue, 1 Oct 2019 10:43:13 +0000 (11:43 +0100)
committerWill Deacon <will@kernel.org>
Fri, 4 Oct 2019 10:15:42 +0000 (11:15 +0100)
commita48e61de758c6b45f080fabc6fed3f4ed42598dc
tree3fa60eb371d9149121d037f26bc5354c886aa701
parenta2b99dcac36c332d4a49184716fc2a67dc1bdbb1
arm64: Mark functions using explicit register variables as '__always_inline'

As of ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly"),
inline functions are no longer annotated with '__always_inline', which
allows the compiler to decide whether inlining is really a good idea or
not. Although this is a great idea on paper, the reality is that AArch64
GCC prior to 9.1 has been shown to get confused when creating an
out-of-line copy of a function passing explicit 'register' variables
into an inline assembly block:

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91111

It's not clear whether this is specific to arm64 or not but, for now,
ensure that all of our functions using 'register' variables are marked
as '__always_inline' so that the old behaviour is effectively preserved.

Hopefully other architectures are luckier with their compilers.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/atomic_lse.h