Skip to contentSkip to conversation

crypto: arm/aes-ce - stop using the SIMD helper

PATCH Superseded Ard Biesheuvel 2 participants 4 messages Apr 2, 2025

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 crypto: arm/aes-ce - stop using the SIMD helper

From: Ard Biesheuvel <[email protected]>

Now that ARM permits use of the NEON unit in softirq context as well as task context, there is no longer a need to rely on the SIMD helper module to construct async skciphers wrapping the sync ones, as the latter can always be called directly.

So remove these wrappers and the dependency on the SIMD helper. This permits the use of these algorithms by callers that only support synchronous use.

---
 arch/arm/crypto/Kconfig       |   1 -
 arch/arm/crypto/aes-ce-glue.c | 102 ++++------------------------------
 2 files changed, 11 insertions(+), 92 deletions(-)
arch/arm/crypto/Kconfig +0 -1
index 32650c8431d9..2fa8aba8dc12 100644
@@ -197,7 +197,6 @@ config CRYPTO_AES_ARM_CE
 	depends on KERNEL_MODE_NEON
 	select CRYPTO_SKCIPHER
 	select CRYPTO_LIB_AES
-	select CRYPTO_SIMD
 	help
 	  Length-preserving ciphers: AES cipher algorithms (FIPS-197)
 	   with block cipher modes:
arch/arm/crypto/aes-ce-glue.c +11 -91

156 lines not on this page · raw message

Signature · 1 line
2.49.0.472.ge94155a9ec-goog
#1 lore raw

PATCH 2/2 crypto: arm/aes-neonbs - stop using the SIMD helper

From: Ard Biesheuvel <[email protected]>

Now that ARM permits use of the NEON unit in softirq context as well as task context, there is no longer a need to rely on the SIMD helper module to construct async skciphers wrapping the sync ones, as the latter can always be called directly.

So remove these wrappers and the dependency on the SIMD helper. This permits the use of these algorithms by callers that only support synchronous use.

---
 arch/arm/crypto/Kconfig           |   1 -
 arch/arm/crypto/aes-neonbs-glue.c | 114 +++---------------------------
 2 files changed, 9 insertions(+), 106 deletions(-)
arch/arm/crypto/Kconfig +0 -1
index 2fa8aba8dc12..ba1d1b67c727 100644
@@ -169,7 +169,6 @@ config CRYPTO_AES_ARM_BS
 	select CRYPTO_AES_ARM
 	select CRYPTO_SKCIPHER
 	select CRYPTO_LIB_AES
-	select CRYPTO_SIMD
 	help
 	  Length-preserving ciphers: AES cipher algorithms (FIPS-197)
 	  with block cipher modes:
arch/arm/crypto/aes-neonbs-glue.c +9 -105

188 lines not on this page · raw message

Signature · 1 line
2.49.0.472.ge94155a9ec-goog
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] crypto: arm/aes-neonbs - stop using the SIMD helper

arch/arm/crypto/aes-neonbs-glue.c

Quoted 33 lines · Ard Biesheuvel

From: Ard Biesheuvel <[email protected]>

Now that ARM permits use of the NEON unit in softirq context as well as task context, there is no longer a need to rely on the SIMD helper module to construct async skciphers wrapping the sync ones, as the latter can always be called directly.

So remove these wrappers and the dependency on the SIMD helper. This permits the use of these algorithms by callers that only support synchronous use.

---
 arch/arm/crypto/Kconfig           |   1 -
 arch/arm/crypto/aes-neonbs-glue.c | 114 +++---------------------------
 2 files changed, 9 insertions(+), 106 deletions(-)
arch/arm/crypto/Kconfig +0 -1
index 2fa8aba8dc12..ba1d1b67c727 100644
@@ -169,7 +169,6 @@ config CRYPTO_AES_ARM_BS
 	select CRYPTO_AES_ARM
 	select CRYPTO_SKCIPHER
 	select CRYPTO_LIB_AES
-	select CRYPTO_SIMD
 	help
 	  Length-preserving ciphers: AES cipher algorithms (FIPS-197)
 	  with block cipher modes:
arch/arm/crypto/aes-neonbs-glue.c +0 -0
index f6be80b5938b..63800257a7ea 100644

The following includes can now be removed from this file:

    #include <crypto/ctr.h>
    #include <crypto/internal/simd.h>

Otherwise this patch looks good. Thanks!

- Eric

Reviewed-by on v1 1/2
#3 lore raw
In reply to Ard Biesheuvel

arch/arm/crypto/aes-ce-glue.c

Quoted 33 lines · Ard Biesheuvel

From: Ard Biesheuvel <[email protected]>

Now that ARM permits use of the NEON unit in softirq context as well as task context, there is no longer a need to rely on the SIMD helper module to construct async skciphers wrapping the sync ones, as the latter can always be called directly.

So remove these wrappers and the dependency on the SIMD helper. This permits the use of these algorithms by callers that only support synchronous use.

---
 arch/arm/crypto/Kconfig       |   1 -
 arch/arm/crypto/aes-ce-glue.c | 102 ++++------------------------------
 2 files changed, 11 insertions(+), 92 deletions(-)
arch/arm/crypto/Kconfig +0 -1
index 32650c8431d9..2fa8aba8dc12 100644
@@ -197,7 +197,6 @@ config CRYPTO_AES_ARM_CE
 	depends on KERNEL_MODE_NEON
 	select CRYPTO_SKCIPHER
 	select CRYPTO_LIB_AES
-	select CRYPTO_SIMD
 	help
 	  Length-preserving ciphers: AES cipher algorithms (FIPS-197)
 	   with block cipher modes:
arch/arm/crypto/aes-ce-glue.c +0 -0
index 21df5e7f51f9..c17d9e4ad8e6 100644

The following includes can now be removed from this file:

    #include <crypto/ctr.h>
    #include <crypto/internal/simd.h>

Otherwise this patch looks good. Thanks!

- Eric