Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: api - move crypto_simd_disabled_for_test to lib

Move crypto_simd_disabled_for_test to lib/ so that crypto_simd_usable()
can be used by library code.

This was discussed previously
(https://lore.kernel.org/linux-crypto/20220716062920.210381-4-ebiggers@kernel.org/)
but was not done because there was no use case yet. However, this is
now needed for the arm64 CRC32 library code.

Tested with:
export ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
echo CONFIG_CRC32=y > .config
echo CONFIG_MODULES=y >> .config
echo CONFIG_CRYPTO=m >> .config
echo CONFIG_DEBUG_KERNEL=y >> .config
echo CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=n >> .config
echo CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y >> .config
make olddefconfig
make -j$(nproc)

Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
4964a1d9 53d91ca7

+13 -6
-6
crypto/algapi.c
··· 6 6 */ 7 7 8 8 #include <crypto/algapi.h> 9 - #include <crypto/internal/simd.h> 10 9 #include <linux/err.h> 11 10 #include <linux/errno.h> 12 11 #include <linux/fips.h> ··· 21 22 #include "internal.h" 22 23 23 24 static LIST_HEAD(crypto_template_list); 24 - 25 - #ifdef CONFIG_CRYPTO_MANAGER_EXTRA_TESTS 26 - DEFINE_PER_CPU(bool, crypto_simd_disabled_for_test); 27 - EXPORT_PER_CPU_SYMBOL_GPL(crypto_simd_disabled_for_test); 28 - #endif 29 25 30 26 static inline void crypto_check_module_sig(struct module *mod) 31 27 {
+2
lib/crypto/Makefile
··· 58 58 endif 59 59 60 60 obj-$(CONFIG_MPILIB) += mpi/ 61 + 62 + obj-$(CONFIG_CRYPTO_MANAGER_EXTRA_TESTS) += simd.o
+11
lib/crypto/simd.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-or-later 2 + /* 3 + * SIMD testing utility functions 4 + * 5 + * Copyright 2024 Google LLC 6 + */ 7 + 8 + #include <crypto/internal/simd.h> 9 + 10 + DEFINE_PER_CPU(bool, crypto_simd_disabled_for_test); 11 + EXPORT_PER_CPU_SYMBOL_GPL(crypto_simd_disabled_for_test);