[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMj1kXGBs_rRTOw+Ejh78LU4d9NXeSs6a_HajmxmM-hxLsNuJw@mail.gmail.com>
Date: Tue, 8 Jul 2025 11:39:53 +1000
From: Ard Biesheuvel <ardb@...nel.org>
To: Eric Biggers <ebiggers@...nel.org>
Cc: linux-crypto@...r.kernel.org, x86@...nel.org, linux-kernel@...r.kernel.org,
"Jason A . Donenfeld" <Jason@...c4.com>
Subject: Re: [PATCH] lib/crypto: x86/sha512: Drop unnecessary ANNOTATE_NOENDBR
On Sat, 28 Jun 2025 at 05:11, Eric Biggers <ebiggers@...nel.org> wrote:
>
> When migrating the x86 SHA-512 assembly code to lib/crypto/, I replaced
> SYM_TYPED_FUNC_START with ANNOTATE_NOENDBR. This was intended to match
> a change in the caller from an indirect call to a static call, like what
> I did for SHA-256. However, for SHA-512 I actually decided to bring the
> static call up a level; see DEFINE_X86_SHA512_FN in
> lib/crypto/x86/sha512.h. Therefore, now the assembly functions are just
> called via normal direct calls. At least for SHA this seems to be the
> better way to do it, and it means using ANNOTATE_NOENDBR is unnecessary.
>
> Fixes: b82535bf96da ("lib/crypto: x86/sha512: Migrate optimized SHA-512 code to library")
> Signed-off-by: Eric Biggers <ebiggers@...nel.org>
> ---
>
> This patch is targeting libcrypto-next.
>
> lib/crypto/x86/sha512-avx-asm.S | 2 --
> lib/crypto/x86/sha512-avx2-asm.S | 2 --
> lib/crypto/x86/sha512-ssse3-asm.S | 2 --
> 3 files changed, 6 deletions(-)
>
Acked-by: Ard Biesheuvel <ardb@...nel.org>
> diff --git a/lib/crypto/x86/sha512-avx-asm.S b/lib/crypto/x86/sha512-avx-asm.S
> index af7ea311cc945..7732aa8fd8506 100644
> --- a/lib/crypto/x86/sha512-avx-asm.S
> +++ b/lib/crypto/x86/sha512-avx-asm.S
> @@ -46,11 +46,10 @@
> # and search for that title.
> #
> ########################################################################
>
> #include <linux/linkage.h>
> -#include <linux/objtool.h>
>
> .text
>
> # Virtual Registers
> # ARG1
> @@ -274,11 +273,10 @@ frame_size = frame_WK + WK_SIZE
> # The size of the message pointed to by "data" must be an integer multiple
> # of SHA512 message blocks.
> # "nblocks" is the message length in SHA512 blocks. Must be >= 1.
> ########################################################################
> SYM_FUNC_START(sha512_transform_avx)
> - ANNOTATE_NOENDBR # since this is called only via static_call
>
> # Save GPRs
> push %rbx
> push %r12
> push %r13
> diff --git a/lib/crypto/x86/sha512-avx2-asm.S b/lib/crypto/x86/sha512-avx2-asm.S
> index 1302ddb5ec8cc..22bdbfd899d0f 100644
> --- a/lib/crypto/x86/sha512-avx2-asm.S
> +++ b/lib/crypto/x86/sha512-avx2-asm.S
> @@ -48,11 +48,10 @@
> ########################################################################
> # This code schedules 1 blocks at a time, with 4 lanes per block
> ########################################################################
>
> #include <linux/linkage.h>
> -#include <linux/objtool.h>
>
> .text
>
> # Virtual Registers
> Y_0 = %ymm4
> @@ -566,11 +565,10 @@ frame_size = frame_CTX + CTX_SIZE
> # The size of the message pointed to by "data" must be an integer multiple
> # of SHA512 message blocks.
> # "nblocks" is the message length in SHA512 blocks. Must be >= 1.
> ########################################################################
> SYM_FUNC_START(sha512_transform_rorx)
> - ANNOTATE_NOENDBR # since this is called only via static_call
>
> # Save GPRs
> push %rbx
> push %r12
> push %r13
> diff --git a/lib/crypto/x86/sha512-ssse3-asm.S b/lib/crypto/x86/sha512-ssse3-asm.S
> index 108f1accc6bc7..4cae7445b2a86 100644
> --- a/lib/crypto/x86/sha512-ssse3-asm.S
> +++ b/lib/crypto/x86/sha512-ssse3-asm.S
> @@ -46,11 +46,10 @@
> # and search for that title.
> #
> ########################################################################
>
> #include <linux/linkage.h>
> -#include <linux/objtool.h>
>
> .text
>
> # Virtual Registers
> # ARG1
> @@ -273,11 +272,10 @@ frame_size = frame_WK + WK_SIZE
> # The size of the message pointed to by "data" must be an integer multiple
> # of SHA512 message blocks.
> # "nblocks" is the message length in SHA512 blocks. Must be >= 1.
> ########################################################################
> SYM_FUNC_START(sha512_transform_ssse3)
> - ANNOTATE_NOENDBR # since this is called only via static_call
>
> # Save GPRs
> push %rbx
> push %r12
> push %r13
>
> base-commit: d74152ec2b5106263c2a502380acfaf5954f9898
> --
> 2.50.0
>
Powered by blists - more mailing lists