Skip to content

Commit 16c0c4e

Browse files
Oliver Neukumherbertx
authored andcommitted
crypto: sha256_ssse3 - also test for BMI2
The AVX2 implementation also uses BMI2 instructions, but doesn't test for their availability. The assumption that AVX2 and BMI2 always go together is false. Some Haswells have AVX2 but not BMI2. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 165c70f commit 16c0c4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/crypto/sha256_ssse3_glue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static int __init sha256_ssse3_mod_init(void)
281281
/* allow AVX to override SSSE3, it's a little faster */
282282
if (avx_usable()) {
283283
#ifdef CONFIG_AS_AVX2
284-
if (boot_cpu_has(X86_FEATURE_AVX2))
284+
if (boot_cpu_has(X86_FEATURE_AVX2) && boot_cpu_has(X86_FEATURE_BMI2))
285285
sha256_transform_asm = sha256_transform_rorx;
286286
else
287287
#endif

0 commit comments

Comments
 (0)