* [PATCH 01/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CAST5_AVX_X86_64 and CONFIG_CRYPTO_CAST6_AVX_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
@ 2026-02-12 3:14 ` Jay Wang
2026-02-12 3:15 ` [PATCH 02/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_TWOFISH_X86_64 crypto Jay Wang
` (19 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:14 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_CAST5_AVX_X86_64- and CONFIG_CRYPTO_CAST6_AVX_X86_64-
related crypto to convert them into pluggable interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 4 ++--
arch/x86/crypto/cast5_avx_glue.c | 4 ++--
arch/x86/crypto/cast6_avx_glue.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index ab248a1beb00..27010cb2326c 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -33,10 +33,10 @@ camellia-aesni-avx2-y := camellia-aesni-avx2-asm_64.o camellia_aesni_avx2_glue.o
obj-$(CONFIG_CRYPTO_BLOWFISH_X86_64) += blowfish-x86_64.o
blowfish-x86_64-y := blowfish-x86_64-asm_64.o blowfish_glue.o
-obj-$(CONFIG_CRYPTO_CAST5_AVX_X86_64) += cast5-avx-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_CAST5_AVX_X86_64) += cast5-avx-x86_64.o
cast5-avx-x86_64-y := cast5-avx-x86_64-asm_64.o cast5_avx_glue.o
-obj-$(CONFIG_CRYPTO_CAST6_AVX_X86_64) += cast6-avx-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_CAST6_AVX_X86_64) += cast6-avx-x86_64.o
cast6-avx-x86_64-y := cast6-avx-x86_64-asm_64.o cast6_avx_glue.o
obj-$(CONFIG_CRYPTO_AEGIS128_AESNI_SSE2) += aegis128-aesni.o
diff --git a/arch/x86/crypto/cast5_avx_glue.c b/arch/x86/crypto/cast5_avx_glue.c
index 3aca04d43b34..267fc2948288 100644
--- a/arch/x86/crypto/cast5_avx_glue.c
+++ b/arch/x86/crypto/cast5_avx_glue.c
@@ -109,8 +109,8 @@ static void __exit cast5_exit(void)
crypto_unregister_skciphers(cast5_algs, ARRAY_SIZE(cast5_algs));
}
-module_init(cast5_init);
-module_exit(cast5_exit);
+crypto_module_init(cast5_init);
+crypto_module_exit(cast5_exit);
MODULE_DESCRIPTION("Cast5 Cipher Algorithm, AVX optimized");
MODULE_LICENSE("GPL");
diff --git a/arch/x86/crypto/cast6_avx_glue.c b/arch/x86/crypto/cast6_avx_glue.c
index c4dd28c30303..5ab35cf5817a 100644
--- a/arch/x86/crypto/cast6_avx_glue.c
+++ b/arch/x86/crypto/cast6_avx_glue.c
@@ -108,8 +108,8 @@ static void __exit cast6_exit(void)
crypto_unregister_skciphers(cast6_algs, ARRAY_SIZE(cast6_algs));
}
-module_init(cast6_init);
-module_exit(cast6_exit);
+crypto_module_init(cast6_init);
+crypto_module_exit(cast6_exit);
MODULE_DESCRIPTION("Cast6 Cipher Algorithm, AVX optimized");
MODULE_LICENSE("GPL");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 02/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_TWOFISH_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
2026-02-12 3:14 ` [PATCH 01/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CAST5_AVX_X86_64 and CONFIG_CRYPTO_CAST6_AVX_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 03/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_TWOFISH_X86_64_3WAY crypto Jay Wang
` (18 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_TWOFISH_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/fips140/fips140-api.c | 11 +++++++++++
arch/x86/crypto/twofish.h | 9 +++++++--
arch/x86/crypto/twofish_glue.c | 4 ++--
4 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index 27010cb2326c..ed8958bffbc9 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -4,7 +4,7 @@
obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o
twofish-i586-y := twofish-i586-asm_32.o twofish_glue.o
-obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o
twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o
obj-$(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY) += twofish-x86_64-3way.o
twofish-x86_64-3way-y := twofish-x86_64-asm_64-3way.o twofish_glue_3way.o
diff --git a/arch/x86/crypto/fips140/fips140-api.c b/arch/x86/crypto/fips140/fips140-api.c
index e69de29bb2d1..bb8ca949caef 100644
--- a/arch/x86/crypto/fips140/fips140-api.c
+++ b/arch/x86/crypto/fips140/fips140-api.c
@@ -0,0 +1,11 @@
+/*
+ * arch/x86/crypto/twofish_glue.c
+ */
+#if IS_BUILTIN(CONFIG_CRYPTO_TWOFISH_X86_64)
+
+#include <arch/x86/crypto/twofish.h>
+
+DEFINE_CRYPTO_API_STUB(twofish_enc_blk);
+DEFINE_CRYPTO_API_STUB(twofish_dec_blk);
+
+#endif
\ No newline at end of file
diff --git a/arch/x86/crypto/twofish.h b/arch/x86/crypto/twofish.h
index 12df400e6d53..c44d2f53ee11 100644
--- a/arch/x86/crypto/twofish.h
+++ b/arch/x86/crypto/twofish.h
@@ -2,13 +2,18 @@
#ifndef ASM_X86_TWOFISH_H
#define ASM_X86_TWOFISH_H
+#include <crypto/api.h>
#include <linux/crypto.h>
#include <crypto/twofish.h>
#include <crypto/b128ops.h>
/* regular block cipher functions from twofish_x86_64 module */
-asmlinkage void twofish_enc_blk(const void *ctx, u8 *dst, const u8 *src);
-asmlinkage void twofish_dec_blk(const void *ctx, u8 *dst, const u8 *src);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_TWOFISH_X86_64, twofish_enc_blk, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_TWOFISH_X86_64, twofish_dec_blk, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
/* 3-way parallel cipher functions */
asmlinkage void __twofish_enc_blk_3way(const void *ctx, u8 *dst, const u8 *src,
diff --git a/arch/x86/crypto/twofish_glue.c b/arch/x86/crypto/twofish_glue.c
index 8e9906d36902..8787a1d2cec4 100644
--- a/arch/x86/crypto/twofish_glue.c
+++ b/arch/x86/crypto/twofish_glue.c
@@ -91,8 +91,8 @@ static void __exit twofish_glue_fini(void)
crypto_unregister_alg(&alg);
}
-module_init(twofish_glue_init);
-module_exit(twofish_glue_fini);
+crypto_module_init(twofish_glue_init);
+crypto_module_exit(twofish_glue_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION ("Twofish Cipher Algorithm, asm optimized");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 03/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_TWOFISH_X86_64_3WAY crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
2026-02-12 3:14 ` [PATCH 01/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CAST5_AVX_X86_64 and CONFIG_CRYPTO_CAST6_AVX_X86_64 crypto Jay Wang
2026-02-12 3:15 ` [PATCH 02/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_TWOFISH_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 04/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_TWOFISH_AVX_X86_64 crypto Jay Wang
` (17 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/fips140/fips140-api.c | 13 +++++++++++++
arch/x86/crypto/twofish.h | 13 +++++++++----
arch/x86/crypto/twofish_glue_3way.c | 4 ++--
4 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index ed8958bffbc9..f224f5206bbb 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -6,7 +6,7 @@ obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o
twofish-i586-y := twofish-i586-asm_32.o twofish_glue.o
crypto-objs-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o
twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o
-obj-$(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY) += twofish-x86_64-3way.o
+crypto-objs-$(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY) += twofish-x86_64-3way.o
twofish-x86_64-3way-y := twofish-x86_64-asm_64-3way.o twofish_glue_3way.o
obj-$(CONFIG_CRYPTO_TWOFISH_AVX_X86_64) += twofish-avx-x86_64.o
twofish-avx-x86_64-y := twofish-avx-x86_64-asm_64.o twofish_avx_glue.o
diff --git a/arch/x86/crypto/fips140/fips140-api.c b/arch/x86/crypto/fips140/fips140-api.c
index bb8ca949caef..a1a207fa34cd 100644
--- a/arch/x86/crypto/fips140/fips140-api.c
+++ b/arch/x86/crypto/fips140/fips140-api.c
@@ -8,4 +8,17 @@
DEFINE_CRYPTO_API_STUB(twofish_enc_blk);
DEFINE_CRYPTO_API_STUB(twofish_dec_blk);
+#endif
+
+/*
+ * arch/x86/crypto/twofish_glue_3way.c
+ */
+#if IS_BUILTIN(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY)
+
+#include <arch/x86/crypto/twofish.h>
+
+DEFINE_CRYPTO_API_STUB(__twofish_enc_blk_3way);
+DEFINE_CRYPTO_API_STUB(twofish_dec_blk_3way);
+DEFINE_CRYPTO_API_STUB(twofish_dec_blk_cbc_3way);
+
#endif
\ No newline at end of file
diff --git a/arch/x86/crypto/twofish.h b/arch/x86/crypto/twofish.h
index c44d2f53ee11..3ee4caa05428 100644
--- a/arch/x86/crypto/twofish.h
+++ b/arch/x86/crypto/twofish.h
@@ -16,11 +16,16 @@ DECLARE_CRYPTO_API(CONFIG_CRYPTO_TWOFISH_X86_64, twofish_dec_blk, asmlinkage voi
(ctx, dst, src));
/* 3-way parallel cipher functions */
-asmlinkage void __twofish_enc_blk_3way(const void *ctx, u8 *dst, const u8 *src,
- bool xor);
-asmlinkage void twofish_dec_blk_3way(const void *ctx, u8 *dst, const u8 *src);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY, __twofish_enc_blk_3way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src, bool xor),
+ (ctx, dst, src, xor));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY, twofish_dec_blk_3way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
/* helpers from twofish_x86_64-3way module */
-extern void twofish_dec_blk_cbc_3way(const void *ctx, u8 *dst, const u8 *src);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY, twofish_dec_blk_cbc_3way, void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
#endif /* ASM_X86_TWOFISH_H */
diff --git a/arch/x86/crypto/twofish_glue_3way.c b/arch/x86/crypto/twofish_glue_3way.c
index 8ad77725bf60..996753732402 100644
--- a/arch/x86/crypto/twofish_glue_3way.c
+++ b/arch/x86/crypto/twofish_glue_3way.c
@@ -161,8 +161,8 @@ static void __exit twofish_3way_fini(void)
crypto_unregister_skciphers(tf_skciphers, ARRAY_SIZE(tf_skciphers));
}
-module_init(twofish_3way_init);
-module_exit(twofish_3way_fini);
+crypto_module_init(twofish_3way_init);
+crypto_module_exit(twofish_3way_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Twofish Cipher Algorithm, 3-way parallel asm optimized");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 04/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_TWOFISH_AVX_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (2 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 03/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_TWOFISH_X86_64_3WAY crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 05/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SERPENT_SSE2_X86_64 crypto Jay Wang
` (16 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_TWOFISH_AVX_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/twofish_avx_glue.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index f224f5206bbb..c1236012784d 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -8,7 +8,7 @@ crypto-objs-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o
twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o
crypto-objs-$(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY) += twofish-x86_64-3way.o
twofish-x86_64-3way-y := twofish-x86_64-asm_64-3way.o twofish_glue_3way.o
-obj-$(CONFIG_CRYPTO_TWOFISH_AVX_X86_64) += twofish-avx-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_TWOFISH_AVX_X86_64) += twofish-avx-x86_64.o
twofish-avx-x86_64-y := twofish-avx-x86_64-asm_64.o twofish_avx_glue.o
obj-$(CONFIG_CRYPTO_SERPENT_SSE2_586) += serpent-sse2-i586.o
diff --git a/arch/x86/crypto/twofish_avx_glue.c b/arch/x86/crypto/twofish_avx_glue.c
index 9e20db013750..0446ce446634 100644
--- a/arch/x86/crypto/twofish_avx_glue.c
+++ b/arch/x86/crypto/twofish_avx_glue.c
@@ -118,8 +118,8 @@ static void __exit twofish_exit(void)
crypto_unregister_skciphers(twofish_algs, ARRAY_SIZE(twofish_algs));
}
-module_init(twofish_init);
-module_exit(twofish_exit);
+crypto_module_init(twofish_init);
+crypto_module_exit(twofish_exit);
MODULE_DESCRIPTION("Twofish Cipher Algorithm, AVX optimized");
MODULE_LICENSE("GPL");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 05/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SERPENT_SSE2_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (3 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 04/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_TWOFISH_AVX_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 06/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SERPENT_AVX_X86_64 crypto Jay Wang
` (15 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_SERPENT_SSE2_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/serpent_sse2_glue.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index c1236012784d..986ed1d64b51 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -13,7 +13,7 @@ twofish-avx-x86_64-y := twofish-avx-x86_64-asm_64.o twofish_avx_glue.o
obj-$(CONFIG_CRYPTO_SERPENT_SSE2_586) += serpent-sse2-i586.o
serpent-sse2-i586-y := serpent-sse2-i586-asm_32.o serpent_sse2_glue.o
-obj-$(CONFIG_CRYPTO_SERPENT_SSE2_X86_64) += serpent-sse2-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_SERPENT_SSE2_X86_64) += serpent-sse2-x86_64.o
serpent-sse2-x86_64-y := serpent-sse2-x86_64-asm_64.o serpent_sse2_glue.o
obj-$(CONFIG_CRYPTO_SERPENT_AVX_X86_64) += serpent-avx-x86_64.o
serpent-avx-x86_64-y := serpent-avx-x86_64-asm_64.o serpent_avx_glue.o
diff --git a/arch/x86/crypto/serpent_sse2_glue.c b/arch/x86/crypto/serpent_sse2_glue.c
index 80ee17ec21b4..0091c88d26cf 100644
--- a/arch/x86/crypto/serpent_sse2_glue.c
+++ b/arch/x86/crypto/serpent_sse2_glue.c
@@ -116,8 +116,8 @@ static void __exit serpent_sse2_exit(void)
crypto_unregister_skciphers(serpent_algs, ARRAY_SIZE(serpent_algs));
}
-module_init(serpent_sse2_init);
-module_exit(serpent_sse2_exit);
+crypto_module_init(serpent_sse2_init);
+crypto_module_exit(serpent_sse2_exit);
MODULE_DESCRIPTION("Serpent Cipher Algorithm, SSE2 optimized");
MODULE_LICENSE("GPL");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 06/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SERPENT_AVX_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (4 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 05/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SERPENT_SSE2_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 07/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SERPENT_AVX2_X86_64 crypto Jay Wang
` (14 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_SERPENT_AVX_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/fips140/fips140-api.c | 13 +++++++++++++
arch/x86/crypto/serpent-avx.h | 17 ++++++++++-------
arch/x86/crypto/serpent_avx_glue.c | 4 ++--
4 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index 986ed1d64b51..8be124f5e05d 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -15,7 +15,7 @@ obj-$(CONFIG_CRYPTO_SERPENT_SSE2_586) += serpent-sse2-i586.o
serpent-sse2-i586-y := serpent-sse2-i586-asm_32.o serpent_sse2_glue.o
crypto-objs-$(CONFIG_CRYPTO_SERPENT_SSE2_X86_64) += serpent-sse2-x86_64.o
serpent-sse2-x86_64-y := serpent-sse2-x86_64-asm_64.o serpent_sse2_glue.o
-obj-$(CONFIG_CRYPTO_SERPENT_AVX_X86_64) += serpent-avx-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_SERPENT_AVX_X86_64) += serpent-avx-x86_64.o
serpent-avx-x86_64-y := serpent-avx-x86_64-asm_64.o serpent_avx_glue.o
obj-$(CONFIG_CRYPTO_SERPENT_AVX2_X86_64) += serpent-avx2.o
serpent-avx2-y := serpent-avx2-asm_64.o serpent_avx2_glue.o
diff --git a/arch/x86/crypto/fips140/fips140-api.c b/arch/x86/crypto/fips140/fips140-api.c
index a1a207fa34cd..15a60258d4ee 100644
--- a/arch/x86/crypto/fips140/fips140-api.c
+++ b/arch/x86/crypto/fips140/fips140-api.c
@@ -21,4 +21,17 @@ DEFINE_CRYPTO_API_STUB(__twofish_enc_blk_3way);
DEFINE_CRYPTO_API_STUB(twofish_dec_blk_3way);
DEFINE_CRYPTO_API_STUB(twofish_dec_blk_cbc_3way);
+#endif
+
+/*
+ * arch/x86/crypto/serpent_avx_glue.c
+ */
+#if IS_BUILTIN(CONFIG_CRYPTO_SERPENT_AVX_X86_64)
+
+#include <arch/x86/crypto/serpent-avx.h>
+
+DEFINE_CRYPTO_API_STUB(serpent_ecb_enc_8way_avx);
+DEFINE_CRYPTO_API_STUB(serpent_ecb_dec_8way_avx);
+DEFINE_CRYPTO_API_STUB(serpent_cbc_dec_8way_avx);
+
#endif
\ No newline at end of file
diff --git a/arch/x86/crypto/serpent-avx.h b/arch/x86/crypto/serpent-avx.h
index 23f3361a0e72..8e7f285273ca 100644
--- a/arch/x86/crypto/serpent-avx.h
+++ b/arch/x86/crypto/serpent-avx.h
@@ -2,6 +2,7 @@
#ifndef ASM_X86_SERPENT_AVX_H
#define ASM_X86_SERPENT_AVX_H
+#include <crypto/api.h>
#include <crypto/b128ops.h>
#include <crypto/serpent.h>
#include <linux/types.h>
@@ -10,12 +11,14 @@ struct crypto_skcipher;
#define SERPENT_PARALLEL_BLOCKS 8
-asmlinkage void serpent_ecb_enc_8way_avx(const void *ctx, u8 *dst,
- const u8 *src);
-asmlinkage void serpent_ecb_dec_8way_avx(const void *ctx, u8 *dst,
- const u8 *src);
-
-asmlinkage void serpent_cbc_dec_8way_avx(const void *ctx, u8 *dst,
- const u8 *src);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_SERPENT_AVX_X86_64, serpent_ecb_enc_8way_avx, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_SERPENT_AVX_X86_64, serpent_ecb_dec_8way_avx, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_SERPENT_AVX_X86_64, serpent_cbc_dec_8way_avx, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
#endif
diff --git a/arch/x86/crypto/serpent_avx_glue.c b/arch/x86/crypto/serpent_avx_glue.c
index 9c8b3a335d5c..43c877a2fc7e 100644
--- a/arch/x86/crypto/serpent_avx_glue.c
+++ b/arch/x86/crypto/serpent_avx_glue.c
@@ -117,8 +117,8 @@ static void __exit serpent_exit(void)
crypto_unregister_skciphers(serpent_algs, ARRAY_SIZE(serpent_algs));
}
-module_init(serpent_init);
-module_exit(serpent_exit);
+crypto_module_init(serpent_init);
+crypto_module_exit(serpent_exit);
MODULE_DESCRIPTION("Serpent Cipher Algorithm, AVX optimized");
MODULE_LICENSE("GPL");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 07/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SERPENT_AVX2_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (5 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 06/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SERPENT_AVX_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 08/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_DES3_EDE_X86_64 crypto Jay Wang
` (13 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_SERPENT_AVX2_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/serpent_avx2_glue.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index 8be124f5e05d..5f7d35f8d313 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -17,7 +17,7 @@ crypto-objs-$(CONFIG_CRYPTO_SERPENT_SSE2_X86_64) += serpent-sse2-x86_64.o
serpent-sse2-x86_64-y := serpent-sse2-x86_64-asm_64.o serpent_sse2_glue.o
crypto-objs-$(CONFIG_CRYPTO_SERPENT_AVX_X86_64) += serpent-avx-x86_64.o
serpent-avx-x86_64-y := serpent-avx-x86_64-asm_64.o serpent_avx_glue.o
-obj-$(CONFIG_CRYPTO_SERPENT_AVX2_X86_64) += serpent-avx2.o
+crypto-objs-$(CONFIG_CRYPTO_SERPENT_AVX2_X86_64) += serpent-avx2.o
serpent-avx2-y := serpent-avx2-asm_64.o serpent_avx2_glue.o
obj-$(CONFIG_CRYPTO_DES3_EDE_X86_64) += des3_ede-x86_64.o
diff --git a/arch/x86/crypto/serpent_avx2_glue.c b/arch/x86/crypto/serpent_avx2_glue.c
index f5f2121b7956..dbcddbaac233 100644
--- a/arch/x86/crypto/serpent_avx2_glue.c
+++ b/arch/x86/crypto/serpent_avx2_glue.c
@@ -114,8 +114,8 @@ static void __exit serpent_avx2_fini(void)
crypto_unregister_skciphers(serpent_algs, ARRAY_SIZE(serpent_algs));
}
-module_init(serpent_avx2_init);
-module_exit(serpent_avx2_fini);
+crypto_module_init(serpent_avx2_init);
+crypto_module_exit(serpent_avx2_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Serpent Cipher Algorithm, AVX2 optimized");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 08/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_DES3_EDE_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (6 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 07/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SERPENT_AVX2_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 09/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CAMELLIA_X86_64 crypto Jay Wang
` (12 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_DES3_EDE_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/des3_ede_glue.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index 5f7d35f8d313..7118a7dba3c6 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -20,7 +20,7 @@ serpent-avx-x86_64-y := serpent-avx-x86_64-asm_64.o serpent_avx_glue.o
crypto-objs-$(CONFIG_CRYPTO_SERPENT_AVX2_X86_64) += serpent-avx2.o
serpent-avx2-y := serpent-avx2-asm_64.o serpent_avx2_glue.o
-obj-$(CONFIG_CRYPTO_DES3_EDE_X86_64) += des3_ede-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_DES3_EDE_X86_64) += des3_ede-x86_64.o
des3_ede-x86_64-y := des3_ede-asm_64.o des3_ede_glue.o
obj-$(CONFIG_CRYPTO_CAMELLIA_X86_64) += camellia-x86_64.o
diff --git a/arch/x86/crypto/des3_ede_glue.c b/arch/x86/crypto/des3_ede_glue.c
index 34600f90d8a6..1d1ce0f862ff 100644
--- a/arch/x86/crypto/des3_ede_glue.c
+++ b/arch/x86/crypto/des3_ede_glue.c
@@ -381,8 +381,8 @@ static void __exit des3_ede_x86_fini(void)
ARRAY_SIZE(des3_ede_skciphers));
}
-module_init(des3_ede_x86_init);
-module_exit(des3_ede_x86_fini);
+crypto_module_init(des3_ede_x86_init);
+crypto_module_exit(des3_ede_x86_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Triple DES EDE Cipher Algorithm, asm optimized");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 09/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CAMELLIA_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (7 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 08/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_DES3_EDE_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 10/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_AES_NI_INTEL crypto Jay Wang
` (11 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_CAMELLIA_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/camellia.h | 29 ++++++++++++++++++---------
arch/x86/crypto/camellia_glue.c | 4 ++--
arch/x86/crypto/fips140/fips140-api.c | 16 +++++++++++++++
4 files changed, 38 insertions(+), 13 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index 7118a7dba3c6..8751154e1328 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -23,7 +23,7 @@ serpent-avx2-y := serpent-avx2-asm_64.o serpent_avx2_glue.o
crypto-objs-$(CONFIG_CRYPTO_DES3_EDE_X86_64) += des3_ede-x86_64.o
des3_ede-x86_64-y := des3_ede-asm_64.o des3_ede_glue.o
-obj-$(CONFIG_CRYPTO_CAMELLIA_X86_64) += camellia-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_CAMELLIA_X86_64) += camellia-x86_64.o
camellia-x86_64-y := camellia-x86_64-asm_64.o camellia_glue.o
obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64) += camellia-aesni-avx-x86_64.o
camellia-aesni-avx-x86_64-y := camellia-aesni-avx-asm_64.o camellia_aesni_avx_glue.o
diff --git a/arch/x86/crypto/camellia.h b/arch/x86/crypto/camellia.h
index 1dcea79e8f8e..bca0b64ab8d7 100644
--- a/arch/x86/crypto/camellia.h
+++ b/arch/x86/crypto/camellia.h
@@ -2,6 +2,7 @@
#ifndef ASM_X86_CAMELLIA_H
#define ASM_X86_CAMELLIA_H
+#include <crypto/api.h>
#include <crypto/b128ops.h>
#include <linux/crypto.h>
#include <linux/kernel.h>
@@ -19,19 +20,25 @@ struct camellia_ctx {
u32 key_length;
};
-extern int __camellia_setkey(struct camellia_ctx *cctx,
- const unsigned char *key,
- unsigned int key_len);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CAMELLIA_X86_64, __camellia_setkey, int,
+ (struct camellia_ctx *cctx, const unsigned char *key, unsigned int key_len),
+ (cctx, key, key_len));
/* regular block cipher functions */
-asmlinkage void __camellia_enc_blk(const void *ctx, u8 *dst, const u8 *src,
- bool xor);
-asmlinkage void camellia_dec_blk(const void *ctx, u8 *dst, const u8 *src);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CAMELLIA_X86_64, __camellia_enc_blk, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src, bool xor),
+ (ctx, dst, src, xor));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CAMELLIA_X86_64, camellia_dec_blk, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
/* 2-way parallel cipher functions */
-asmlinkage void __camellia_enc_blk_2way(const void *ctx, u8 *dst, const u8 *src,
- bool xor);
-asmlinkage void camellia_dec_blk_2way(const void *ctx, u8 *dst, const u8 *src);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CAMELLIA_X86_64, __camellia_enc_blk_2way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src, bool xor),
+ (ctx, dst, src, xor));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CAMELLIA_X86_64, camellia_dec_blk_2way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
/* 16-way parallel cipher functions (avx/aes-ni) */
asmlinkage void camellia_ecb_enc_16way(const void *ctx, u8 *dst, const u8 *src);
@@ -62,6 +69,8 @@ static inline void camellia_enc_blk_xor_2way(const void *ctx, u8 *dst,
}
/* glue helpers */
-extern void camellia_decrypt_cbc_2way(const void *ctx, u8 *dst, const u8 *src);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CAMELLIA_X86_64, camellia_decrypt_cbc_2way, void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
#endif /* ASM_X86_CAMELLIA_H */
diff --git a/arch/x86/crypto/camellia_glue.c b/arch/x86/crypto/camellia_glue.c
index cbede120e5f2..e545da7c8530 100644
--- a/arch/x86/crypto/camellia_glue.c
+++ b/arch/x86/crypto/camellia_glue.c
@@ -1408,8 +1408,8 @@ static void __exit camellia_fini(void)
ARRAY_SIZE(camellia_skcipher_algs));
}
-module_init(camellia_init);
-module_exit(camellia_fini);
+crypto_module_init(camellia_init);
+crypto_module_exit(camellia_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Camellia Cipher Algorithm, asm optimized");
diff --git a/arch/x86/crypto/fips140/fips140-api.c b/arch/x86/crypto/fips140/fips140-api.c
index 15a60258d4ee..57a1625219e0 100644
--- a/arch/x86/crypto/fips140/fips140-api.c
+++ b/arch/x86/crypto/fips140/fips140-api.c
@@ -34,4 +34,20 @@ DEFINE_CRYPTO_API_STUB(serpent_ecb_enc_8way_avx);
DEFINE_CRYPTO_API_STUB(serpent_ecb_dec_8way_avx);
DEFINE_CRYPTO_API_STUB(serpent_cbc_dec_8way_avx);
+#endif
+
+/*
+ * arch/x86/crypto/camellia_glue.c
+ */
+#if IS_BUILTIN(CONFIG_CRYPTO_CAMELLIA_X86_64)
+
+#include <arch/x86/crypto/camellia.h>
+
+DEFINE_CRYPTO_API_STUB(__camellia_setkey);
+DEFINE_CRYPTO_API_STUB(__camellia_enc_blk);
+DEFINE_CRYPTO_API_STUB(camellia_dec_blk);
+DEFINE_CRYPTO_API_STUB(__camellia_enc_blk_2way);
+DEFINE_CRYPTO_API_STUB(camellia_dec_blk_2way);
+DEFINE_CRYPTO_API_STUB(camellia_decrypt_cbc_2way);
+
#endif
\ No newline at end of file
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 10/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_AES_NI_INTEL crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (8 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 09/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CAMELLIA_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 11/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 crypto Jay Wang
` (10 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_AES_NI_INTEL-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/aesni-intel_glue.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index 8751154e1328..a3af66c98760 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -42,7 +42,7 @@ cast6-avx-x86_64-y := cast6-avx-x86_64-asm_64.o cast6_avx_glue.o
obj-$(CONFIG_CRYPTO_AEGIS128_AESNI_SSE2) += aegis128-aesni.o
aegis128-aesni-y := aegis128-aesni-asm.o aegis128-aesni-glue.o
-obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o
+crypto-objs-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o
aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o
aesni-intel-$(CONFIG_64BIT) += aes-ctr-avx-x86_64.o \
aes-gcm-aesni-x86_64.o \
diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c
index e6c38d1d8a92..57bee257365a 100644
--- a/arch/x86/crypto/aesni-intel_glue.c
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -1664,8 +1664,8 @@ static void __exit aesni_exit(void)
unregister_avx_algs();
}
-module_init(aesni_init);
-module_exit(aesni_exit);
+crypto_module_init(aesni_init);
+crypto_module_exit(aesni_exit);
MODULE_DESCRIPTION("AES cipher and modes, optimized with AES-NI or VAES instructions");
MODULE_LICENSE("GPL");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 11/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (9 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 10/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_AES_NI_INTEL crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 12/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 crypto Jay Wang
` (9 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/camellia.h | 13 +++++++++----
arch/x86/crypto/camellia_aesni_avx_glue.c | 4 ++--
arch/x86/crypto/fips140/fips140-api.c | 13 +++++++++++++
4 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index a3af66c98760..205b4467ab79 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -25,7 +25,7 @@ des3_ede-x86_64-y := des3_ede-asm_64.o des3_ede_glue.o
crypto-objs-$(CONFIG_CRYPTO_CAMELLIA_X86_64) += camellia-x86_64.o
camellia-x86_64-y := camellia-x86_64-asm_64.o camellia_glue.o
-obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64) += camellia-aesni-avx-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64) += camellia-aesni-avx-x86_64.o
camellia-aesni-avx-x86_64-y := camellia-aesni-avx-asm_64.o camellia_aesni_avx_glue.o
obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64) += camellia-aesni-avx2.o
camellia-aesni-avx2-y := camellia-aesni-avx2-asm_64.o camellia_aesni_avx2_glue.o
diff --git a/arch/x86/crypto/camellia.h b/arch/x86/crypto/camellia.h
index bca0b64ab8d7..6cfe3dd134ae 100644
--- a/arch/x86/crypto/camellia.h
+++ b/arch/x86/crypto/camellia.h
@@ -41,10 +41,15 @@ DECLARE_CRYPTO_API(CONFIG_CRYPTO_CAMELLIA_X86_64, camellia_dec_blk_2way, asmlink
(ctx, dst, src));
/* 16-way parallel cipher functions (avx/aes-ni) */
-asmlinkage void camellia_ecb_enc_16way(const void *ctx, u8 *dst, const u8 *src);
-asmlinkage void camellia_ecb_dec_16way(const void *ctx, u8 *dst, const u8 *src);
-
-asmlinkage void camellia_cbc_dec_16way(const void *ctx, u8 *dst, const u8 *src);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64, camellia_ecb_enc_16way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64, camellia_ecb_dec_16way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64, camellia_cbc_dec_16way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
static inline void camellia_enc_blk(const void *ctx, u8 *dst, const u8 *src)
{
diff --git a/arch/x86/crypto/camellia_aesni_avx_glue.c b/arch/x86/crypto/camellia_aesni_avx_glue.c
index 5c321f255eb7..14e70c0f6fb7 100644
--- a/arch/x86/crypto/camellia_aesni_avx_glue.c
+++ b/arch/x86/crypto/camellia_aesni_avx_glue.c
@@ -122,8 +122,8 @@ static void __exit camellia_aesni_fini(void)
crypto_unregister_skciphers(camellia_algs, ARRAY_SIZE(camellia_algs));
}
-module_init(camellia_aesni_init);
-module_exit(camellia_aesni_fini);
+crypto_module_init(camellia_aesni_init);
+crypto_module_exit(camellia_aesni_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Camellia Cipher Algorithm, AES-NI/AVX optimized");
diff --git a/arch/x86/crypto/fips140/fips140-api.c b/arch/x86/crypto/fips140/fips140-api.c
index 57a1625219e0..8048f1568852 100644
--- a/arch/x86/crypto/fips140/fips140-api.c
+++ b/arch/x86/crypto/fips140/fips140-api.c
@@ -50,4 +50,17 @@ DEFINE_CRYPTO_API_STUB(__camellia_enc_blk_2way);
DEFINE_CRYPTO_API_STUB(camellia_dec_blk_2way);
DEFINE_CRYPTO_API_STUB(camellia_decrypt_cbc_2way);
+#endif
+
+/*
+ * arch/x86/crypto/camellia_aesni_avx_glue.c
+ */
+#if IS_BUILTIN(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64)
+
+#include <arch/x86/crypto/camellia.h>
+
+DEFINE_CRYPTO_API_STUB(camellia_ecb_enc_16way);
+DEFINE_CRYPTO_API_STUB(camellia_ecb_dec_16way);
+DEFINE_CRYPTO_API_STUB(camellia_cbc_dec_16way);
+
#endif
\ No newline at end of file
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 12/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (10 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 11/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 13/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_BLOWFISH_X86_64 crypto Jay Wang
` (8 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/camellia_aesni_avx2_glue.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index 205b4467ab79..7e68f6bcfa29 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -27,7 +27,7 @@ crypto-objs-$(CONFIG_CRYPTO_CAMELLIA_X86_64) += camellia-x86_64.o
camellia-x86_64-y := camellia-x86_64-asm_64.o camellia_glue.o
crypto-objs-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64) += camellia-aesni-avx-x86_64.o
camellia-aesni-avx-x86_64-y := camellia-aesni-avx-asm_64.o camellia_aesni_avx_glue.o
-obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64) += camellia-aesni-avx2.o
+crypto-objs-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64) += camellia-aesni-avx2.o
camellia-aesni-avx2-y := camellia-aesni-avx2-asm_64.o camellia_aesni_avx2_glue.o
obj-$(CONFIG_CRYPTO_BLOWFISH_X86_64) += blowfish-x86_64.o
diff --git a/arch/x86/crypto/camellia_aesni_avx2_glue.c b/arch/x86/crypto/camellia_aesni_avx2_glue.c
index 2d2f4e16537c..4b270dc2b9f5 100644
--- a/arch/x86/crypto/camellia_aesni_avx2_glue.c
+++ b/arch/x86/crypto/camellia_aesni_avx2_glue.c
@@ -122,8 +122,8 @@ static void __exit camellia_aesni_fini(void)
crypto_unregister_skciphers(camellia_algs, ARRAY_SIZE(camellia_algs));
}
-module_init(camellia_aesni_init);
-module_exit(camellia_aesni_fini);
+crypto_module_init(camellia_aesni_init);
+crypto_module_exit(camellia_aesni_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Camellia Cipher Algorithm, AES-NI/AVX2 optimized");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 13/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_BLOWFISH_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (11 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 12/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 14/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_AEGIS128_AESNI_SSE2 crypto Jay Wang
` (7 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_BLOWFISH_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/blowfish_glue.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index 7e68f6bcfa29..cfef8fbfba8f 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -30,7 +30,7 @@ camellia-aesni-avx-x86_64-y := camellia-aesni-avx-asm_64.o camellia_aesni_avx_gl
crypto-objs-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64) += camellia-aesni-avx2.o
camellia-aesni-avx2-y := camellia-aesni-avx2-asm_64.o camellia_aesni_avx2_glue.o
-obj-$(CONFIG_CRYPTO_BLOWFISH_X86_64) += blowfish-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_BLOWFISH_X86_64) += blowfish-x86_64.o
blowfish-x86_64-y := blowfish-x86_64-asm_64.o blowfish_glue.o
crypto-objs-$(CONFIG_CRYPTO_CAST5_AVX_X86_64) += cast5-avx-x86_64.o
diff --git a/arch/x86/crypto/blowfish_glue.c b/arch/x86/crypto/blowfish_glue.c
index 26c5f2ee5d10..48b20bc3bd54 100644
--- a/arch/x86/crypto/blowfish_glue.c
+++ b/arch/x86/crypto/blowfish_glue.c
@@ -187,8 +187,8 @@ static void __exit blowfish_fini(void)
ARRAY_SIZE(bf_skcipher_algs));
}
-module_init(blowfish_init);
-module_exit(blowfish_fini);
+crypto_module_init(blowfish_init);
+crypto_module_exit(blowfish_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Blowfish Cipher Algorithm, asm optimized");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 14/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_AEGIS128_AESNI_SSE2 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (12 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 13/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_BLOWFISH_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 15/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL crypto Jay Wang
` (6 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_AEGIS128_AESNI_SSE2-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/aegis128-aesni-glue.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index cfef8fbfba8f..601e4c8a9e7c 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -39,7 +39,7 @@ cast5-avx-x86_64-y := cast5-avx-x86_64-asm_64.o cast5_avx_glue.o
crypto-objs-$(CONFIG_CRYPTO_CAST6_AVX_X86_64) += cast6-avx-x86_64.o
cast6-avx-x86_64-y := cast6-avx-x86_64-asm_64.o cast6_avx_glue.o
-obj-$(CONFIG_CRYPTO_AEGIS128_AESNI_SSE2) += aegis128-aesni.o
+crypto-objs-$(CONFIG_CRYPTO_AEGIS128_AESNI_SSE2) += aegis128-aesni.o
aegis128-aesni-y := aegis128-aesni-asm.o aegis128-aesni-glue.o
crypto-objs-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o
diff --git a/arch/x86/crypto/aegis128-aesni-glue.c b/arch/x86/crypto/aegis128-aesni-glue.c
index f1adfba1a76e..b3f2e99f02b1 100644
--- a/arch/x86/crypto/aegis128-aesni-glue.c
+++ b/arch/x86/crypto/aegis128-aesni-glue.c
@@ -277,8 +277,8 @@ static void __exit crypto_aegis128_aesni_module_exit(void)
crypto_unregister_aead(&crypto_aegis128_aesni_alg);
}
-module_init(crypto_aegis128_aesni_module_init);
-module_exit(crypto_aegis128_aesni_module_exit);
+crypto_module_init(crypto_aegis128_aesni_module_init);
+crypto_module_exit(crypto_aegis128_aesni_module_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Ondrej Mosnacek <omosnacek@gmail.com>");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 15/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (13 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 14/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_AEGIS128_AESNI_SSE2 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 16/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SM3_AVX_X86_64 crypto Jay Wang
` (5 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/ghash-clmulni-intel_glue.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index 601e4c8a9e7c..b65f66577ffe 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -50,7 +50,7 @@ aesni-intel-$(CONFIG_64BIT) += aes-ctr-avx-x86_64.o \
aes-gcm-vaes-avx512.o \
aes-xts-avx-x86_64.o
-obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o
+crypto-objs-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o
ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o
obj-$(CONFIG_CRYPTO_SM3_AVX_X86_64) += sm3-avx-x86_64.o
diff --git a/arch/x86/crypto/ghash-clmulni-intel_glue.c b/arch/x86/crypto/ghash-clmulni-intel_glue.c
index aea5d4d06be7..02301df7fef3 100644
--- a/arch/x86/crypto/ghash-clmulni-intel_glue.c
+++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c
@@ -155,8 +155,8 @@ static void __exit ghash_pclmulqdqni_mod_exit(void)
crypto_unregister_shash(&ghash_alg);
}
-module_init(ghash_pclmulqdqni_mod_init);
-module_exit(ghash_pclmulqdqni_mod_exit);
+crypto_module_init(ghash_pclmulqdqni_mod_init);
+crypto_module_exit(ghash_pclmulqdqni_mod_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("GHASH hash function, accelerated by PCLMULQDQ-NI");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 16/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SM3_AVX_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (14 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 15/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 17/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64 crypto Jay Wang
` (4 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_SM3_AVX_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/sm3_avx_glue.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index b65f66577ffe..ffe37f4d4a7b 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -53,7 +53,7 @@ aesni-intel-$(CONFIG_64BIT) += aes-ctr-avx-x86_64.o \
crypto-objs-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o
ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o
-obj-$(CONFIG_CRYPTO_SM3_AVX_X86_64) += sm3-avx-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_SM3_AVX_X86_64) += sm3-avx-x86_64.o
sm3-avx-x86_64-y := sm3-avx-asm_64.o sm3_avx_glue.o
obj-$(CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64) += sm4-aesni-avx-x86_64.o
diff --git a/arch/x86/crypto/sm3_avx_glue.c b/arch/x86/crypto/sm3_avx_glue.c
index 6e8c42b9dc8e..42a9b5d43fe1 100644
--- a/arch/x86/crypto/sm3_avx_glue.c
+++ b/arch/x86/crypto/sm3_avx_glue.c
@@ -90,8 +90,8 @@ static void __exit sm3_avx_mod_exit(void)
crypto_unregister_shash(&sm3_avx_alg);
}
-module_init(sm3_avx_mod_init);
-module_exit(sm3_avx_mod_exit);
+crypto_module_init(sm3_avx_mod_init);
+crypto_module_exit(sm3_avx_mod_exit);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Tianjia Zhang <tianjia.zhang@linux.alibaba.com>");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 17/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (15 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 16/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SM3_AVX_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 18/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64 crypto Jay Wang
` (3 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/fips140/fips140-api.c | 15 +++++++++++++++
arch/x86/crypto/sm4-avx.h | 26 +++++++++++++++++---------
arch/x86/crypto/sm4_aesni_avx_glue.c | 4 ++--
4 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index ffe37f4d4a7b..ce00d3e0e451 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -56,7 +56,7 @@ ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o
crypto-objs-$(CONFIG_CRYPTO_SM3_AVX_X86_64) += sm3-avx-x86_64.o
sm3-avx-x86_64-y := sm3-avx-asm_64.o sm3_avx_glue.o
-obj-$(CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64) += sm4-aesni-avx-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64) += sm4-aesni-avx-x86_64.o
sm4-aesni-avx-x86_64-y := sm4-aesni-avx-asm_64.o sm4_aesni_avx_glue.o
obj-$(CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64) += sm4-aesni-avx2-x86_64.o
diff --git a/arch/x86/crypto/fips140/fips140-api.c b/arch/x86/crypto/fips140/fips140-api.c
index 8048f1568852..1333b1ce6cdf 100644
--- a/arch/x86/crypto/fips140/fips140-api.c
+++ b/arch/x86/crypto/fips140/fips140-api.c
@@ -63,4 +63,19 @@ DEFINE_CRYPTO_API_STUB(camellia_ecb_enc_16way);
DEFINE_CRYPTO_API_STUB(camellia_ecb_dec_16way);
DEFINE_CRYPTO_API_STUB(camellia_cbc_dec_16way);
+#endif
+
+/*
+ * arch/x86/crypto/sm4_aesni_avx_glue.c
+ */
+#if IS_BUILTIN(CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64)
+
+#include <arch/x86/crypto/sm4-avx.h>
+
+DEFINE_CRYPTO_API_STUB(sm4_avx_ecb_encrypt);
+DEFINE_CRYPTO_API_STUB(sm4_avx_ecb_decrypt);
+DEFINE_CRYPTO_API_STUB(sm4_cbc_encrypt);
+DEFINE_CRYPTO_API_STUB(sm4_avx_cbc_decrypt);
+DEFINE_CRYPTO_API_STUB(sm4_avx_ctr_crypt);
+
#endif
\ No newline at end of file
diff --git a/arch/x86/crypto/sm4-avx.h b/arch/x86/crypto/sm4-avx.h
index b5b5e67e40ed..2a8c05e6f255 100644
--- a/arch/x86/crypto/sm4-avx.h
+++ b/arch/x86/crypto/sm4-avx.h
@@ -2,19 +2,27 @@
#ifndef ASM_X86_SM4_AVX_H
#define ASM_X86_SM4_AVX_H
+#include <crypto/api.h>
#include <linux/types.h>
#include <crypto/sm4.h>
typedef void (*sm4_crypt_func)(const u32 *rk, u8 *dst, const u8 *src, u8 *iv);
-int sm4_avx_ecb_encrypt(struct skcipher_request *req);
-int sm4_avx_ecb_decrypt(struct skcipher_request *req);
-
-int sm4_cbc_encrypt(struct skcipher_request *req);
-int sm4_avx_cbc_decrypt(struct skcipher_request *req,
- unsigned int bsize, sm4_crypt_func func);
-
-int sm4_avx_ctr_crypt(struct skcipher_request *req,
- unsigned int bsize, sm4_crypt_func func);
+struct skcipher_request;
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64, sm4_avx_ecb_encrypt, int,
+ (struct skcipher_request *req),
+ (req));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64, sm4_avx_ecb_decrypt, int,
+ (struct skcipher_request *req),
+ (req));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64, sm4_cbc_encrypt, int,
+ (struct skcipher_request *req),
+ (req));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64, sm4_avx_cbc_decrypt, int,
+ (struct skcipher_request *req, unsigned int bsize, sm4_crypt_func func),
+ (req, bsize, func));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64, sm4_avx_ctr_crypt, int,
+ (struct skcipher_request *req, unsigned int bsize, sm4_crypt_func func),
+ (req, bsize, func));
#endif
diff --git a/arch/x86/crypto/sm4_aesni_avx_glue.c b/arch/x86/crypto/sm4_aesni_avx_glue.c
index 88caf418a06f..787468f9dcf2 100644
--- a/arch/x86/crypto/sm4_aesni_avx_glue.c
+++ b/arch/x86/crypto/sm4_aesni_avx_glue.c
@@ -339,8 +339,8 @@ static void __exit sm4_exit(void)
ARRAY_SIZE(sm4_aesni_avx_skciphers));
}
-module_init(sm4_init);
-module_exit(sm4_exit);
+crypto_module_init(sm4_init);
+crypto_module_exit(sm4_exit);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Tianjia Zhang <tianjia.zhang@linux.alibaba.com>");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 18/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (16 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 17/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 19/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64 crypto Jay Wang
` (2 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/sm4_aesni_avx2_glue.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index ce00d3e0e451..103a49fbbac8 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -59,7 +59,7 @@ sm3-avx-x86_64-y := sm3-avx-asm_64.o sm3_avx_glue.o
crypto-objs-$(CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64) += sm4-aesni-avx-x86_64.o
sm4-aesni-avx-x86_64-y := sm4-aesni-avx-asm_64.o sm4_aesni_avx_glue.o
-obj-$(CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64) += sm4-aesni-avx2-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64) += sm4-aesni-avx2-x86_64.o
sm4-aesni-avx2-x86_64-y := sm4-aesni-avx2-asm_64.o sm4_aesni_avx2_glue.o
obj-$(CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64) += aria-aesni-avx-x86_64.o
diff --git a/arch/x86/crypto/sm4_aesni_avx2_glue.c b/arch/x86/crypto/sm4_aesni_avx2_glue.c
index fec0ab7a63dd..4b7afdc383d9 100644
--- a/arch/x86/crypto/sm4_aesni_avx2_glue.c
+++ b/arch/x86/crypto/sm4_aesni_avx2_glue.c
@@ -124,8 +124,8 @@ static void __exit sm4_exit(void)
ARRAY_SIZE(sm4_aesni_avx2_skciphers));
}
-module_init(sm4_init);
-module_exit(sm4_exit);
+crypto_module_init(sm4_init);
+crypto_module_exit(sm4_exit);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Tianjia Zhang <tianjia.zhang@linux.alibaba.com>");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 19/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (17 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 18/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 20/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64 crypto Jay Wang
2026-02-12 3:15 ` [PATCH 21/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_ARIA_GFNI_AVX512_X86_64 crypto Jay Wang
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/aria-avx.h | 35 ++++++++++++++++-----------
arch/x86/crypto/aria_aesni_avx_glue.c | 4 +--
arch/x86/crypto/fips140/fips140-api.c | 18 ++++++++++++++
4 files changed, 42 insertions(+), 17 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index 103a49fbbac8..bda4e9cd5e2c 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -62,7 +62,7 @@ sm4-aesni-avx-x86_64-y := sm4-aesni-avx-asm_64.o sm4_aesni_avx_glue.o
crypto-objs-$(CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64) += sm4-aesni-avx2-x86_64.o
sm4-aesni-avx2-x86_64-y := sm4-aesni-avx2-asm_64.o sm4_aesni_avx2_glue.o
-obj-$(CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64) += aria-aesni-avx-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64) += aria-aesni-avx-x86_64.o
aria-aesni-avx-x86_64-y := aria-aesni-avx-asm_64.o aria_aesni_avx_glue.o
obj-$(CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64) += aria-aesni-avx2-x86_64.o
diff --git a/arch/x86/crypto/aria-avx.h b/arch/x86/crypto/aria-avx.h
index 6e1b2d8a31ed..e4109e67a640 100644
--- a/arch/x86/crypto/aria-avx.h
+++ b/arch/x86/crypto/aria-avx.h
@@ -2,6 +2,7 @@
#ifndef ASM_X86_ARIA_AVX_H
#define ASM_X86_ARIA_AVX_H
+#include <crypto/api.h>
#include <linux/types.h>
#define ARIA_AESNI_PARALLEL_BLOCKS 16
@@ -13,20 +14,26 @@
#define ARIA_GFNI_AVX512_PARALLEL_BLOCKS 64
#define ARIA_GFNI_AVX512_PARALLEL_BLOCK_SIZE (ARIA_BLOCK_SIZE * ARIA_GFNI_AVX512_PARALLEL_BLOCKS)
-asmlinkage void aria_aesni_avx_encrypt_16way(const void *ctx, u8 *dst,
- const u8 *src);
-asmlinkage void aria_aesni_avx_decrypt_16way(const void *ctx, u8 *dst,
- const u8 *src);
-asmlinkage void aria_aesni_avx_ctr_crypt_16way(const void *ctx, u8 *dst,
- const u8 *src,
- u8 *keystream, u8 *iv);
-asmlinkage void aria_aesni_avx_gfni_encrypt_16way(const void *ctx, u8 *dst,
- const u8 *src);
-asmlinkage void aria_aesni_avx_gfni_decrypt_16way(const void *ctx, u8 *dst,
- const u8 *src);
-asmlinkage void aria_aesni_avx_gfni_ctr_crypt_16way(const void *ctx, u8 *dst,
- const u8 *src,
- u8 *keystream, u8 *iv);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64, aria_aesni_avx_encrypt_16way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64, aria_aesni_avx_decrypt_16way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64, aria_aesni_avx_ctr_crypt_16way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src, u8 *keystream, u8 *iv),
+ (ctx, dst, src, keystream, iv));
+#ifdef CONFIG_AS_GFNI
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64, aria_aesni_avx_gfni_encrypt_16way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64, aria_aesni_avx_gfni_decrypt_16way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64, aria_aesni_avx_gfni_ctr_crypt_16way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src, u8 *keystream, u8 *iv),
+ (ctx, dst, src, keystream, iv));
+#endif /* CONFIG_AS_GFNI */
asmlinkage void aria_aesni_avx2_encrypt_32way(const void *ctx, u8 *dst,
const u8 *src);
diff --git a/arch/x86/crypto/aria_aesni_avx_glue.c b/arch/x86/crypto/aria_aesni_avx_glue.c
index e4e3d78915a5..4a0bb385515a 100644
--- a/arch/x86/crypto/aria_aesni_avx_glue.c
+++ b/arch/x86/crypto/aria_aesni_avx_glue.c
@@ -215,8 +215,8 @@ static void __exit aria_avx_exit(void)
crypto_unregister_skciphers(aria_algs, ARRAY_SIZE(aria_algs));
}
-module_init(aria_avx_init);
-module_exit(aria_avx_exit);
+crypto_module_init(aria_avx_init);
+crypto_module_exit(aria_avx_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Taehee Yoo <ap420073@gmail.com>");
diff --git a/arch/x86/crypto/fips140/fips140-api.c b/arch/x86/crypto/fips140/fips140-api.c
index 1333b1ce6cdf..ed7a2ad31f24 100644
--- a/arch/x86/crypto/fips140/fips140-api.c
+++ b/arch/x86/crypto/fips140/fips140-api.c
@@ -78,4 +78,22 @@ DEFINE_CRYPTO_API_STUB(sm4_cbc_encrypt);
DEFINE_CRYPTO_API_STUB(sm4_avx_cbc_decrypt);
DEFINE_CRYPTO_API_STUB(sm4_avx_ctr_crypt);
+#endif
+
+/*
+ * arch/x86/crypto/aria_aesni_avx_glue.c
+ */
+#if IS_BUILTIN(CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64)
+
+#include <arch/x86/crypto/aria-avx.h>
+
+DEFINE_CRYPTO_API_STUB(aria_aesni_avx_encrypt_16way);
+DEFINE_CRYPTO_API_STUB(aria_aesni_avx_decrypt_16way);
+DEFINE_CRYPTO_API_STUB(aria_aesni_avx_ctr_crypt_16way);
+#ifdef CONFIG_AS_GFNI
+DEFINE_CRYPTO_API_STUB(aria_aesni_avx_gfni_encrypt_16way);
+DEFINE_CRYPTO_API_STUB(aria_aesni_avx_gfni_decrypt_16way);
+DEFINE_CRYPTO_API_STUB(aria_aesni_avx_gfni_ctr_crypt_16way);
+#endif /* CONFIG_AS_GFNI */
+
#endif
\ No newline at end of file
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 20/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (18 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 19/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
2026-02-12 3:15 ` [PATCH 21/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_ARIA_GFNI_AVX512_X86_64 crypto Jay Wang
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/aria-avx.h | 34 +++++++++++++++-----------
arch/x86/crypto/aria_aesni_avx2_glue.c | 4 +--
arch/x86/crypto/fips140/fips140-api.c | 18 ++++++++++++++
4 files changed, 41 insertions(+), 17 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index bda4e9cd5e2c..28ed31e7d6e3 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -65,7 +65,7 @@ sm4-aesni-avx2-x86_64-y := sm4-aesni-avx2-asm_64.o sm4_aesni_avx2_glue.o
crypto-objs-$(CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64) += aria-aesni-avx-x86_64.o
aria-aesni-avx-x86_64-y := aria-aesni-avx-asm_64.o aria_aesni_avx_glue.o
-obj-$(CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64) += aria-aesni-avx2-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64) += aria-aesni-avx2-x86_64.o
aria-aesni-avx2-x86_64-y := aria-aesni-avx2-asm_64.o aria_aesni_avx2_glue.o
obj-$(CONFIG_CRYPTO_ARIA_GFNI_AVX512_X86_64) += aria-gfni-avx512-x86_64.o
diff --git a/arch/x86/crypto/aria-avx.h b/arch/x86/crypto/aria-avx.h
index e4109e67a640..9804d3f43fce 100644
--- a/arch/x86/crypto/aria-avx.h
+++ b/arch/x86/crypto/aria-avx.h
@@ -35,20 +35,26 @@ DECLARE_CRYPTO_API(CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64, aria_aesni_avx_gfni_ctr_
(ctx, dst, src, keystream, iv));
#endif /* CONFIG_AS_GFNI */
-asmlinkage void aria_aesni_avx2_encrypt_32way(const void *ctx, u8 *dst,
- const u8 *src);
-asmlinkage void aria_aesni_avx2_decrypt_32way(const void *ctx, u8 *dst,
- const u8 *src);
-asmlinkage void aria_aesni_avx2_ctr_crypt_32way(const void *ctx, u8 *dst,
- const u8 *src,
- u8 *keystream, u8 *iv);
-asmlinkage void aria_aesni_avx2_gfni_encrypt_32way(const void *ctx, u8 *dst,
- const u8 *src);
-asmlinkage void aria_aesni_avx2_gfni_decrypt_32way(const void *ctx, u8 *dst,
- const u8 *src);
-asmlinkage void aria_aesni_avx2_gfni_ctr_crypt_32way(const void *ctx, u8 *dst,
- const u8 *src,
- u8 *keystream, u8 *iv);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64, aria_aesni_avx2_encrypt_32way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64, aria_aesni_avx2_decrypt_32way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64, aria_aesni_avx2_ctr_crypt_32way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src, u8 *keystream, u8 *iv),
+ (ctx, dst, src, keystream, iv));
+#ifdef CONFIG_AS_GFNI
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64, aria_aesni_avx2_gfni_encrypt_32way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64, aria_aesni_avx2_gfni_decrypt_32way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src),
+ (ctx, dst, src));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64, aria_aesni_avx2_gfni_ctr_crypt_32way, asmlinkage void,
+ (const void *ctx, u8 *dst, const u8 *src, u8 *keystream, u8 *iv),
+ (ctx, dst, src, keystream, iv));
+#endif /* CONFIG_AS_GFNI */
struct aria_avx_ops {
void (*aria_encrypt_16way)(const void *ctx, u8 *dst, const u8 *src);
diff --git a/arch/x86/crypto/aria_aesni_avx2_glue.c b/arch/x86/crypto/aria_aesni_avx2_glue.c
index 1487a49bfbac..26f9f10913a7 100644
--- a/arch/x86/crypto/aria_aesni_avx2_glue.c
+++ b/arch/x86/crypto/aria_aesni_avx2_glue.c
@@ -235,8 +235,8 @@ static void __exit aria_avx2_exit(void)
crypto_unregister_skciphers(aria_algs, ARRAY_SIZE(aria_algs));
}
-module_init(aria_avx2_init);
-module_exit(aria_avx2_exit);
+crypto_module_init(aria_avx2_init);
+crypto_module_exit(aria_avx2_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Taehee Yoo <ap420073@gmail.com>");
diff --git a/arch/x86/crypto/fips140/fips140-api.c b/arch/x86/crypto/fips140/fips140-api.c
index ed7a2ad31f24..ced6b58fcb81 100644
--- a/arch/x86/crypto/fips140/fips140-api.c
+++ b/arch/x86/crypto/fips140/fips140-api.c
@@ -96,4 +96,22 @@ DEFINE_CRYPTO_API_STUB(aria_aesni_avx_gfni_decrypt_16way);
DEFINE_CRYPTO_API_STUB(aria_aesni_avx_gfni_ctr_crypt_16way);
#endif /* CONFIG_AS_GFNI */
+#endif
+
+/*
+ * arch/x86/crypto/aria_aesni_avx2_glue.c
+ */
+#if IS_BUILTIN(CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64)
+
+#include <arch/x86/crypto/aria-avx.h>
+
+DEFINE_CRYPTO_API_STUB(aria_aesni_avx2_encrypt_32way);
+DEFINE_CRYPTO_API_STUB(aria_aesni_avx2_decrypt_32way);
+DEFINE_CRYPTO_API_STUB(aria_aesni_avx2_ctr_crypt_32way);
+#ifdef CONFIG_AS_GFNI
+DEFINE_CRYPTO_API_STUB(aria_aesni_avx2_gfni_encrypt_32way);
+DEFINE_CRYPTO_API_STUB(aria_aesni_avx2_gfni_decrypt_32way);
+DEFINE_CRYPTO_API_STUB(aria_aesni_avx2_gfni_ctr_crypt_32way);
+#endif /* CONFIG_AS_GFNI */
+
#endif
\ No newline at end of file
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread* [PATCH 21/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_ARIA_GFNI_AVX512_X86_64 crypto
2026-02-12 3:14 [PATCH v1 00/21] crypto: Standalone crypto module (Series 3/4): x86_64 crypto Jay Wang
` (19 preceding siblings ...)
2026-02-12 3:15 ` [PATCH 20/21] x86: crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64 crypto Jay Wang
@ 2026-02-12 3:15 ` Jay Wang
20 siblings, 0 replies; 22+ messages in thread
From: Jay Wang @ 2026-02-12 3:15 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_ARIA_GFNI_AVX512_X86_64-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/aria_gfni_avx512_glue.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index 28ed31e7d6e3..c23ad85ebe12 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -68,7 +68,7 @@ aria-aesni-avx-x86_64-y := aria-aesni-avx-asm_64.o aria_aesni_avx_glue.o
crypto-objs-$(CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64) += aria-aesni-avx2-x86_64.o
aria-aesni-avx2-x86_64-y := aria-aesni-avx2-asm_64.o aria_aesni_avx2_glue.o
-obj-$(CONFIG_CRYPTO_ARIA_GFNI_AVX512_X86_64) += aria-gfni-avx512-x86_64.o
+crypto-objs-$(CONFIG_CRYPTO_ARIA_GFNI_AVX512_X86_64) += aria-gfni-avx512-x86_64.o
aria-gfni-avx512-x86_64-y := aria-gfni-avx512-asm_64.o aria_gfni_avx512_glue.o
# FIPS 140 kernel module
diff --git a/arch/x86/crypto/aria_gfni_avx512_glue.c b/arch/x86/crypto/aria_gfni_avx512_glue.c
index 363cbf4399cc..d11615352bf4 100644
--- a/arch/x86/crypto/aria_gfni_avx512_glue.c
+++ b/arch/x86/crypto/aria_gfni_avx512_glue.c
@@ -232,8 +232,8 @@ static void __exit aria_avx512_exit(void)
crypto_unregister_skciphers(aria_algs, ARRAY_SIZE(aria_algs));
}
-module_init(aria_avx512_init);
-module_exit(aria_avx512_exit);
+crypto_module_init(aria_avx512_init);
+crypto_module_exit(aria_avx512_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Taehee Yoo <ap420073@gmail.com>");
--
2.47.3
^ permalink raw reply related [flat|nested] 22+ messages in thread