From fa5e8001f77952ed9c9786036685353ff8e6ce23 Mon Sep 17 00:00:00 2001 From: Alexander Martinz Date: Tue, 3 Jun 2025 17:29:23 +0200 Subject: [PATCH] Revert "BACKPORT: crypto: arch - conditionalize crypto api in arch glue for lib code" This reverts commit 47c8de47e12546b5f5e019927a10d8429c6095bf. This will be reapplied later. Change-Id: I2181874ef8de0e64007c2daf8a6f480cdeca97ac Signed-off-by: Alexander Martinz --- arch/x86/crypto/blake2s-glue.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/x86/crypto/blake2s-glue.c b/arch/x86/crypto/blake2s-glue.c index 42feb2f70f26..40b89dcb7534 100644 --- a/arch/x86/crypto/blake2s-glue.c +++ b/arch/x86/crypto/blake2s-glue.c @@ -69,7 +69,13 @@ static int __init blake2s_mod_init(void) XFEATURE_MASK_AVX512, NULL)) static_branch_enable(&blake2s_use_avx512); - return 0; + return crypto_register_shashes(blake2s_algs, ARRAY_SIZE(blake2s_algs)); +} + +static void __exit blake2s_mod_exit(void) +{ + if (boot_cpu_has(X86_FEATURE_SSSE3)) + crypto_unregister_shashes(blake2s_algs, ARRAY_SIZE(blake2s_algs)); } module_init(blake2s_mod_init);