summaryrefslogtreecommitdiffstats
path: root/src/plugins/crypto_native/main.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2023-03-14 13:15:58 +0100
committerDave Wallace <dwallacelf@gmail.com>2023-03-14 16:00:14 +0000
commit8ade308e1724ac87a9d57f97152cf3f9a91c6373 (patch)
treed5355f905ade97b1d51916da19b025981cddf7cc /src/plugins/crypto_native/main.c
parentf6d3abd0d18038c872b1c91cad2631463dfe97ec (diff)
crypto-native: avoid crash on 12th and 13th gen Intel client CPUs
Those CPUs are announcing VAES capability but they don't support AVX512. Type: fix Fixes: 73a60b2 Change-Id: I7b4be95e91bb6f367cd71461f1126690f3ecd988 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/crypto_native/main.c')
-rw-r--r--src/plugins/crypto_native/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/crypto_native/main.c b/src/plugins/crypto_native/main.c
index 712c333bce9..2eedcd7357a 100644
--- a/src/plugins/crypto_native/main.c
+++ b/src/plugins/crypto_native/main.c
@@ -75,7 +75,8 @@ crypto_native_init (vlib_main_t * vm)
if (0);
#if __x86_64__
- else if (crypto_native_aes_cbc_init_icl && clib_cpu_supports_vaes ())
+ else if (crypto_native_aes_cbc_init_icl && clib_cpu_supports_vaes () &&
+ clib_cpu_supports_avx512f ())
error = crypto_native_aes_cbc_init_icl (vm);
else if (crypto_native_aes_cbc_init_skx && clib_cpu_supports_avx512f ())
error = crypto_native_aes_cbc_init_skx (vm);
@@ -97,7 +98,8 @@ crypto_native_init (vlib_main_t * vm)
#if __x86_64__
if (clib_cpu_supports_pclmulqdq ())
{
- if (crypto_native_aes_gcm_init_icl && clib_cpu_supports_vaes ())
+ if (crypto_native_aes_gcm_init_icl && clib_cpu_supports_vaes () &&
+ clib_cpu_supports_avx512f ())
error = crypto_native_aes_gcm_init_icl (vm);
else if (crypto_native_aes_gcm_init_skx && clib_cpu_supports_avx512f ())
error = crypto_native_aes_gcm_init_skx (vm);