From: Eric Biggers <ebiggers@kernel.org>
To: linux-crypto@vger.kernel.org
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Ard Biesheuvel <ardb@kernel.org>,
"Jason A . Donenfeld" <Jason@zx2c4.com>,
Eric Biggers <ebiggers@kernel.org>
Subject: [PATCH] lib/crypto: x86/sha512: Drop unnecessary ANNOTATE_NOENDBR
Date: Fri, 27 Jun 2025 12:09:40 -0700 [thread overview]
Message-ID: <20250627190940.66756-1-ebiggers@kernel.org> (raw)
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@kernel.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(-)
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
next reply other threads:[~2025-06-27 19:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 19:09 Eric Biggers [this message]
2025-07-08 1:39 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250627190940.66756-1-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=Jason@zx2c4.com \
--cc=ardb@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®