acrn-kernel/arch/x86/crypto
Roxana Nicolescu f0732c646a crypto: x86/sha - load modules based on CPU features
commit 1c43c0f1f84aa59dfc98ce66f0a67b2922aa7f9d upstream.

x86 optimized crypto modules are built as modules rather than build-in and
they are not loaded when the crypto API is initialized, resulting in the
generic builtin module (sha1-generic) being used instead.

It was discovered when creating a sha1/sha256 checksum of a 2Gb file by
using kcapi-tools because it would take significantly longer than creating
a sha512 checksum of the same file. trace-cmd showed that for sha1/256 the
generic module was used, whereas for sha512 the optimized module was used
instead.

Add module aliases() for these x86 optimized crypto modules based on CPU
feature bits so udev gets a chance to load them later in the boot
process. This resulted in ~3x decrease in the real-time execution of
kcapi-dsg.

Fix is inspired from commit
aa031b8f70 ("crypto: x86/sha512 - load based on CPU features")
where a similar fix was done for sha512.

Cc: stable@vger.kernel.org # 5.15+
Suggested-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Suggested-by: Julian Andres Klode <julian.klode@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 17:07:07 +00:00
..
.gitignore
Kconfig crypto: aria-avx - add AES-NI/AVX/x86_64/GFNI assembler implementation of aria cipher 2022-09-24 16:14:44 +08:00
Makefile crypto: aria-avx - add AES-NI/AVX/x86_64/GFNI assembler implementation of aria cipher 2022-09-24 16:14:44 +08:00
aegis128-aesni-asm.S crypto: x86/aegis128 - fix possible crash with CFI enabled 2022-12-31 13:32:34 +01:00
aegis128-aesni-glue.c
aes_ctrby8_avx-x86_64.S crypto: x86/aesni-xctr - Add accelerated implementation of XCTR 2022-06-10 16:40:17 +08:00
aesni-intel_asm.S
aesni-intel_avx-x86_64.S
aesni-intel_glue.c crypto: x86/aesni-xctr - Add accelerated implementation of XCTR 2022-06-10 16:40:17 +08:00
aria-aesni-avx-asm_64.S crypto: x86/aria - fix crash with CFI enabled 2022-12-31 13:32:34 +01:00
aria-avx.h crypto: aria-avx - add AES-NI/AVX/x86_64/GFNI assembler implementation of aria cipher 2022-09-24 16:14:44 +08:00
aria_aesni_avx_glue.c crypto: aria-avx - add AES-NI/AVX/x86_64/GFNI assembler implementation of aria cipher 2022-09-24 16:14:44 +08:00
blake2s-core.S
blake2s-glue.c crypto: blake2s - remove shash module 2022-06-10 16:43:49 +08:00
blowfish-x86_64-asm_64.S x86: Add types to indirectly called assembly functions 2022-09-26 10:13:15 -07:00
blowfish_glue.c crypto: x86/blowfish - remove redundant assignment to variable nytes 2022-07-15 16:43:22 +08:00
camellia-aesni-avx-asm_64.S
camellia-aesni-avx2-asm_64.S
camellia-x86_64-asm_64.S
camellia.h
camellia_aesni_avx2_glue.c
camellia_aesni_avx_glue.c
camellia_glue.c
cast5-avx-x86_64-asm_64.S
cast5_avx_glue.c
cast6-avx-x86_64-asm_64.S
cast6_avx_glue.c
chacha-avx2-x86_64.S
chacha-avx512vl-x86_64.S
chacha-ssse3-x86_64.S
chacha_glue.c
crc32-pclmul_asm.S x86/crypto: Remove stray comment terminator 2022-06-13 09:47:58 +02:00
crc32-pclmul_glue.c
crc32c-intel_glue.c
crc32c-pcl-intel-asm_64.S
crct10dif-pcl-asm_64.S
crct10dif-pclmul_glue.c
curve25519-x86_64.c
des3_ede-asm_64.S
des3_ede_glue.c
ecb_cbc_helpers.h
ghash-clmulni-intel_asm.S
ghash-clmulni-intel_glue.c crypto: x86/ghash - fix unaligned access in ghash_setkey() 2023-03-10 09:32:51 +01:00
glue_helper-asm-avx.S
glue_helper-asm-avx2.S
nh-avx2-x86_64.S
nh-sse2-x86_64.S
nhpoly1305-avx2-glue.c
nhpoly1305-sse2-glue.c
poly1305-x86_64-cryptogams.pl
poly1305_glue.c
polyval-clmulni_asm.S crypto: x86/polyval - Add PCLMULQDQ accelerated implementation of POLYVAL 2022-06-10 16:40:17 +08:00
polyval-clmulni_glue.c crypto: x86/polyval - Fix crashes when keys are not 16-byte aligned 2022-10-21 19:05:05 +08:00
serpent-avx-x86_64-asm_64.S
serpent-avx.h
serpent-avx2-asm_64.S
serpent-sse2-i586-asm_32.S
serpent-sse2-x86_64-asm_64.S
serpent-sse2.h
serpent_avx2_glue.c
serpent_avx_glue.c
serpent_sse2_glue.c
sha1_avx2_x86_64_asm.S
sha1_ni_asm.S crypto: x86/sha1 - fix possible crash with CFI enabled 2022-12-31 13:32:34 +01:00
sha1_ssse3_asm.S crypto: x86/sha1 - fix possible crash with CFI enabled 2022-12-31 13:32:34 +01:00
sha1_ssse3_glue.c crypto: x86/sha - load modules based on CPU features 2023-11-28 17:07:07 +00:00
sha256-avx-asm.S crypto: x86/sha256 - fix possible crash with CFI enabled 2022-12-31 13:32:34 +01:00
sha256-avx2-asm.S crypto: x86/sha256 - fix possible crash with CFI enabled 2022-12-31 13:32:34 +01:00
sha256-ssse3-asm.S crypto: x86/sha256 - fix possible crash with CFI enabled 2022-12-31 13:32:34 +01:00
sha256_ni_asm.S crypto: x86/sha256 - fix possible crash with CFI enabled 2022-12-31 13:32:34 +01:00
sha256_ssse3_glue.c crypto: x86/sha - load modules based on CPU features 2023-11-28 17:07:07 +00:00
sha512-avx-asm.S crypto: x86/sha512 - fix possible crash with CFI enabled 2022-12-31 13:32:34 +01:00
sha512-avx2-asm.S crypto: x86/sha512 - fix possible crash with CFI enabled 2022-12-31 13:32:34 +01:00
sha512-ssse3-asm.S crypto: x86/sha512 - fix possible crash with CFI enabled 2022-12-31 13:32:34 +01:00
sha512_ssse3_glue.c crypto: x86/sha512 - load based on CPU features 2022-08-19 18:39:39 +08:00
sm3-avx-asm_64.S crypto: x86/sm3 - fix possible crash with CFI enabled 2022-12-31 13:32:34 +01:00
sm3_avx_glue.c
sm4-aesni-avx-asm_64.S crypto: x86/sm4 - fix crash with CFI enabled 2022-12-31 13:32:34 +01:00
sm4-aesni-avx2-asm_64.S crypto: x86/sm4 - fix crash with CFI enabled 2022-12-31 13:32:34 +01:00
sm4-avx.h
sm4_aesni_avx2_glue.c
sm4_aesni_avx_glue.c
twofish-avx-x86_64-asm_64.S
twofish-i586-asm_32.S
twofish-x86_64-asm_64-3way.S
twofish-x86_64-asm_64.S
twofish.h
twofish_avx_glue.c
twofish_glue.c
twofish_glue_3way.c