aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/crypto/chacha20poly1305.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-20 19:00:50 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-31 17:22:49 +0100
commitd467551e7983673472d3f8b6fbddb467104d4422 (patch)
tree0c6755c1b031ec4dcd41702568efb62527dca404 /src/crypto/chacha20poly1305.c
parentblake2: include headers for macros (diff)
downloadwireguard-monolithic-historical-d467551e7983673472d3f8b6fbddb467104d4422.tar.xz
wireguard-monolithic-historical-d467551e7983673472d3f8b6fbddb467104d4422.zip
crypto/avx: make sure we can actually use ymm registers
Diffstat (limited to '')
-rw-r--r--src/crypto/chacha20poly1305.c2
1 files changed, 1 insertions, 1 deletions
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>