diff options
Diffstat (limited to 'src/crypto')
-rw-r--r-- | src/crypto/blake2s.c | 2 | ||||
-rw-r--r-- | src/crypto/chacha20poly1305.c | 2 | ||||
-rw-r--r-- | src/crypto/curve25519.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/crypto/blake2s.c b/src/crypto/blake2s.c index 1fe4600..ab37a0c 100644 --- a/src/crypto/blake2s.c +++ b/src/crypto/blake2s.c @@ -115,7 +115,7 @@ void blake2s_init_key(struct blake2s_state *state, const size_t outlen, const vo static bool blake2s_use_avx __read_mostly = false; void __init blake2s_fpu_init(void) { - blake2s_use_avx = boot_cpu_has(X86_FEATURE_AVX); + blake2s_use_avx = boot_cpu_has(X86_FEATURE_AVX) && cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL); } asmlinkage void blake2s_compress_avx(struct blake2s_state *state, const u8 * block, size_t nblocks, u32 inc); #else diff --git a/src/crypto/chacha20poly1305.c b/src/crypto/chacha20poly1305.c index 7227617..3163009 100644 --- a/src/crypto/chacha20poly1305.c +++ b/src/crypto/chacha20poly1305.c @@ -35,7 +35,7 @@ void chacha20poly1305_fpu_init(void) { chacha20poly1305_use_sse2 = boot_cpu_has(X86_FEATURE_XMM2); chacha20poly1305_use_ssse3 = boot_cpu_has(X86_FEATURE_SSSE3); - chacha20poly1305_use_avx2 = boot_cpu_has(X86_FEATURE_AVX) && boot_cpu_has(X86_FEATURE_AVX2); + chacha20poly1305_use_avx2 = boot_cpu_has(X86_FEATURE_AVX) && boot_cpu_has(X86_FEATURE_AVX2) && cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL); } #elif IS_ENABLED(CONFIG_KERNEL_MODE_NEON) #include <asm/hwcap.h> diff --git a/src/crypto/curve25519.c b/src/crypto/curve25519.c index f236cf5..a53841d 100644 --- a/src/crypto/curve25519.c +++ b/src/crypto/curve25519.c @@ -33,7 +33,7 @@ static const u8 null_point[CURVE25519_POINT_SIZE] = { 0 }; static bool curve25519_use_avx __read_mostly = false; void curve25519_fpu_init(void) { - curve25519_use_avx = boot_cpu_has(X86_FEATURE_AVX); + curve25519_use_avx = boot_cpu_has(X86_FEATURE_AVX) && cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL); } typedef u64 fe[10]; |