Skip to contentSkip to conversation

lib/crc: arm64: use .arch_extension to enable CRC and crypto

PATCH Applied Emanuele Rocca 2 participants 2 messages Nov 11 – Nov 14

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 lib/crc: arm64: use .arch_extension to enable CRC and crypto

Use .arch_extension instead of .arch and .cpu in crc32-core.S and crc-t10dif-core.S.

.arch and .cpu reset the assembler's feature set, dropping extensions enabled via -march. See commit 9142c2f8f84b ("octeontx2: use arch_extension to enable LSE"), where this caused an actual build failure.

That is not a problem here: the instructions these files use are all covered by the CRC and crypto extensions. Switch anyway for consistency and to avoid surprises if the files later use instructions outside generic+crc+crypto.

.arch_extension is supported by binutils since 2.26 and by clang since 8.0.0, both older than the minimum versions currently required to build the kernel (2.30 and 17.0.1 respectively).

---
Changes in v2:
- Update crc-t10dif-core.S in addition to crc32-core.S
- Clarify in commit message that this is not a functional change

Link to v1:
https://lore.kernel.org/all/[email protected]/

---
 lib/crc/arm64/crc-t10dif-core.S | 2 +-
 lib/crc/arm64/crc32-core.S      | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
lib/crc/arm64/crc-t10dif-core.S +1 -1
index 71388466825b..e77af0aecf5e 100644
@@ -69,7 +69,7 @@
 #include <asm/assembler.h>
 
 	.text
-	.arch		armv8-a+crypto
+	.arch_extension	crypto
 
 	init_crc	.req	w0
 	buf		.req	x1
lib/crc/arm64/crc32-core.S +2 -1
index 49d02cc485b3..0877d07ed1bf 100644
@@ -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
Signature · 1 line
2.55.0
maintainer Applied
#1 lore raw
Quoted 23 lines · Emanuele Rocca

Use .arch_extension instead of .arch and .cpu in crc32-core.S and crc-t10dif-core.S.

.arch and .cpu reset the assembler's feature set, dropping extensions enabled via -march. See commit 9142c2f8f84b ("octeontx2: use arch_extension to enable LSE"), where this caused an actual build failure.

That is not a problem here: the instructions these files use are all covered by the CRC and crypto extensions. Switch anyway for consistency and to avoid surprises if the files later use instructions outside generic+crc+crypto.

.arch_extension is supported by binutils since 2.26 and by clang since 8.0.0, both older than the minimum versions currently required to build the kernel (2.30 and 17.0.1 respectively).

---
Changes in v2:
- Update crc-t10dif-core.S in addition to crc32-core.S
- Clarify in commit message that this is not a functional change

Quoted 6 lines

Link to v1:
https://lore.kernel.org/all/[email protected]/

---
 lib/crc/arm64/crc-t10dif-core.S | 2 +-
 lib/crc/arm64/crc32-core.S      | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=crc-next

- Eric