[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250620191952.1867578-1-arnd@kernel.org>
Date: Fri, 20 Jun 2025 21:19:40 +0200
From: Arnd Bergmann <arnd@...nel.org>
To: Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>
Cc: Arnd Bergmann <arnd@...db.de>,
Eric Biggers <ebiggers@...gle.com>,
linux-crypto@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] crypto: sha256 - mark sha256_choose_blocks as __always_inline
From: Arnd Bergmann <arnd@...db.de>
When the compiler chooses to not inline sha256_choose_blocks() in
the purgatory code, it fails to link against the missing CPU
specific version:
x86_64-linux-ld: arch/x86/purgatory/purgatory.ro: in function `sha256_choose_blocks.part.0':
sha256.c:(.text+0x6a6): undefined reference to `irq_fpu_usable'
sha256.c:(.text+0x6c7): undefined reference to `sha256_blocks_arch'
sha256.c:(.text+0x6cc): undefined reference to `sha256_blocks_simd'
Mark this function as __always_inline to prevent this, same as sha256_finup().
Fixes: ff8f037d394f ("crypto: sha256 - Use the partial block API for generic")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
This is likely compiler specific, I found it in randconfig testing using
gcc-9.5 on x86.
---
include/crypto/internal/sha2.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/crypto/internal/sha2.h b/include/crypto/internal/sha2.h
index b9bccd3ff57f..21a27fd5e198 100644
--- a/include/crypto/internal/sha2.h
+++ b/include/crypto/internal/sha2.h
@@ -25,7 +25,7 @@ void sha256_blocks_arch(u32 state[SHA256_STATE_WORDS],
void sha256_blocks_simd(u32 state[SHA256_STATE_WORDS],
const u8 *data, size_t nblocks);
-static inline void sha256_choose_blocks(
+static __always_inline void sha256_choose_blocks(
u32 state[SHA256_STATE_WORDS], const u8 *data, size_t nblocks,
bool force_generic, bool force_simd)
{
--
2.39.5
Powered by blists - more mailing lists