From: Emanuele Rocca <emanuele.rocca@arm.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] lib/crc: arm64: use .arch_extension to enable CRC and crypto
Date: Thu, 5 Nov 2026 15:41:45 +0000 [thread overview]
Message-ID: <20261105154145.557042-1-emanuele.rocca@arm.com> (raw)
Instead of using ".cpu generic+crc+crypto", use ".arch_extension crc" and
".arch_extension crypto" to enable the required instructions.
The ".cpu generic+crc+crypto" directive replaces the assembler's current
feature set with generic+crc+crypto, dropping any other features that were
previously enabled, for example by -march or by a toolchain configured with
--with-arch=armv9-a. In contrast, ".arch_extension" enables the requested
extensions while preserving the current feature set.
This is not a functional change: crc32-core.S only uses base A64
instructions plus CRC32 and PMULL, which remain available, and BTI landing
pads are emitted as HINT instructions. However, using .arch_extension
avoids the pitfall of silently disabling features. See commit 9142c2f8f84b
("octeontx2: use arch_extension to enable LSE").
Signed-off-by: Emanuele Rocca <emanuele.rocca@arm.com>
---
lib/crc/arm64/crc32-core.S | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/crc/arm64/crc32-core.S b/lib/crc/arm64/crc32-core.S
index 49d02cc485b3..0877d07ed1bf 100644
--- a/lib/crc/arm64/crc32-core.S
+++ b/lib/crc/arm64/crc32-core.S
@@ -11,7 +11,8 @@
#include <linux/linkage.h>
#include <asm/assembler.h>
- .cpu generic+crc+crypto
+ .arch_extension crc
+ .arch_extension crypto
.macro bitle, reg
.endm
--
2.55.0
next reply other threads:[~2026-11-05 15:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 15:41 Emanuele Rocca [this message]
2026-11-05 19:42 ` Eric Biggers
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=20261105154145.557042-1-emanuele.rocca@arm.com \
--to=emanuele.rocca@arm.com \
--cc=ardb@kernel.org \
--cc=ebiggers@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.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®