[PATCH] lib/crypto: arm64/sm3: Use assembler for sm3 instructions

Ard Biesheuvel ardb at kernel.org
Tue Nov 24 03:10:53 PST 2026


On Sat, 14 Nov 2026, at 22:10, Eric Biggers wrote:
> All supported assemblers (binutils 2.30 and later, and clang 17.0.1 and
> later) support the sm3 instructions now.
>
> Therefore, drop the use of '.inst' in sm3-ce-core.S and just have the
> assembler generate the instructions.
>
> This requires adding '.arch armv8.2-a+sm4'.  (Yes, the assemblers want
> sm4, not sm3.)  I also tried just '.arch_extension sm4', but that
> doesn't work with binutils 2.40 and earlier because they consider sm3 to
> depend on armv8.2-a or later (and this file isn't built with
> -march=armv8.2-a or later).  This was fixed in binutils 2.41 commit
> 205e4380c800, but the kernel currently supports binutils 2.30 and later.
>
> No change in the resulting .text section with either binutils or clang.
>
> Signed-off-by: Eric Biggers <ebiggers at kernel.org>
> ---
>
> This patch is intended to be taken through libcrypto-next
>

Acked-by: Ard Biesheuvel <ardb at kernel.org>



More information about the linux-arm-kernel mailing list