@@ -828,10 +828,8 @@ static struct skcipher_alg skcipher_algs_##suffix[] = {{ \
828828}}
829829
830830DEFINE_AVX_SKCIPHER_ALGS (aesni_avx , "aesni-avx" , 500 );
831- #if defined(CONFIG_AS_VPCLMULQDQ )
832831DEFINE_AVX_SKCIPHER_ALGS (vaes_avx2 , "vaes-avx2" , 600 );
833832DEFINE_AVX_SKCIPHER_ALGS (vaes_avx512 , "vaes-avx512" , 800 );
834- #endif
835833
836834/* The common part of the x86_64 AES-GCM key struct */
837835struct aes_gcm_key {
@@ -912,17 +910,8 @@ struct aes_gcm_key_avx10 {
912910#define FLAG_RFC4106 BIT(0)
913911#define FLAG_ENC BIT(1)
914912#define FLAG_AVX BIT(2)
915- #if defined(CONFIG_AS_VPCLMULQDQ )
916- # define FLAG_AVX10_256 BIT(3)
917- # define FLAG_AVX10_512 BIT(4)
918- #else
919- /*
920- * This should cause all calls to the AVX10 assembly functions to be
921- * optimized out, avoiding the need to ifdef each call individually.
922- */
923- # define FLAG_AVX10_256 0
924- # define FLAG_AVX10_512 0
925- #endif
913+ #define FLAG_AVX10_256 BIT(3)
914+ #define FLAG_AVX10_512 BIT(4)
926915
927916static inline struct aes_gcm_key *
928917aes_gcm_key_get (struct crypto_aead * tfm , int flags )
@@ -1519,7 +1508,6 @@ DEFINE_GCM_ALGS(aesni_avx, FLAG_AVX,
15191508 "generic-gcm-aesni-avx" , "rfc4106-gcm-aesni-avx" ,
15201509 AES_GCM_KEY_AESNI_SIZE , 500 );
15211510
1522- #if defined(CONFIG_AS_VPCLMULQDQ )
15231511/* aes_gcm_algs_vaes_avx10_256 */
15241512DEFINE_GCM_ALGS (vaes_avx10_256 , FLAG_AVX10_256 ,
15251513 "generic-gcm-vaes-avx10_256" , "rfc4106-gcm-vaes-avx10_256" ,
@@ -1529,7 +1517,6 @@ DEFINE_GCM_ALGS(vaes_avx10_256, FLAG_AVX10_256,
15291517DEFINE_GCM_ALGS (vaes_avx10_512 , FLAG_AVX10_512 ,
15301518 "generic-gcm-vaes-avx10_512" , "rfc4106-gcm-vaes-avx10_512" ,
15311519 AES_GCM_KEY_AVX10_SIZE , 800 );
1532- #endif /* CONFIG_AS_VPCLMULQDQ */
15331520
15341521static int __init register_avx_algs (void )
15351522{
@@ -1551,7 +1538,6 @@ static int __init register_avx_algs(void)
15511538 * Similarly, the assembler support was added at about the same time.
15521539 * For simplicity, just always check for VAES and VPCLMULQDQ together.
15531540 */
1554- #if defined(CONFIG_AS_VPCLMULQDQ )
15551541 if (!boot_cpu_has (X86_FEATURE_AVX2 ) ||
15561542 !boot_cpu_has (X86_FEATURE_VAES ) ||
15571543 !boot_cpu_has (X86_FEATURE_VPCLMULQDQ ) ||
@@ -1592,7 +1578,7 @@ static int __init register_avx_algs(void)
15921578 ARRAY_SIZE (aes_gcm_algs_vaes_avx10_512 ));
15931579 if (err )
15941580 return err ;
1595- #endif /* CONFIG_AS_VPCLMULQDQ */
1581+
15961582 return 0 ;
15971583}
15981584
@@ -1607,12 +1593,10 @@ static void unregister_avx_algs(void)
16071593{
16081594 unregister_skciphers (skcipher_algs_aesni_avx );
16091595 unregister_aeads (aes_gcm_algs_aesni_avx );
1610- #if defined(CONFIG_AS_VPCLMULQDQ )
16111596 unregister_skciphers (skcipher_algs_vaes_avx2 );
16121597 unregister_skciphers (skcipher_algs_vaes_avx512 );
16131598 unregister_aeads (aes_gcm_algs_vaes_avx10_256 );
16141599 unregister_aeads (aes_gcm_algs_vaes_avx10_512 );
1615- #endif
16161600}
16171601#else /* CONFIG_X86_64 */
16181602static struct aead_alg aes_gcm_algs_aesni [0 ];
0 commit comments