Skip to contentSkip to conversation

lib/crypto: x86/chacha: Drop redundant check for AVX

PATCH Applied Eric Biggers 2 participants 3 messages Nov 11 – Nov 14

Subsystems (2)
lore
Share & tools
lore

Eric Biggers

author maintainer
#0 lore raw

PATCH 1/1 lib/crypto: x86/chacha: Drop redundant check for AVX

X86_FEATURE_AVX2 implies X86_FEATURE_AVX. Simplify chacha_mod_init_arch() accordingly.

(Note: as usual, arch/x86/kernel/cpu/cpuid-deps.c is non-enforcing: if a dependency isn't met, it warns and doesn't prevent booting. However, that case doesn't occur in real CPUs and is unsupported.)

---
 lib/crypto/x86/chacha.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
lib/crypto/x86/chacha.h +1 -2
index 76cddc522fa04..3e465184ca87b 100644
@@ -188,8 +188,7 @@ static void chacha_mod_init_arch(void)
 
 	static_branch_enable(&chacha_use_simd);
 
-	if (boot_cpu_has(X86_FEATURE_AVX) &&
-	    boot_cpu_has(X86_FEATURE_AVX2)) {
+	if (boot_cpu_has(X86_FEATURE_AVX2)) {
 		static_branch_enable(&chacha_use_avx2);
 
 		if (boot_cpu_has(X86_FEATURE_AVX512VL) &&

base-commit: 33b4f31b1aea3f62b61c892daefc0e6a77859032

Signature · 1 line
2.56.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Eric Biggers

X86_FEATURE_AVX2 implies X86_FEATURE_AVX. Simplify chacha_mod_init_arch() accordingly.

(Note: as usual, arch/x86/kernel/cpu/cpuid-deps.c is non-enforcing: if a dependency isn't met, it warns and doesn't prevent booting. However, that case doesn't occur in real CPUs and is unsupported.)

---
 lib/crypto/x86/chacha.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
author maintainer Applied
#2 lore raw
In reply to Eric Biggers
Quoted 11 lines · Eric Biggers

X86_FEATURE_AVX2 implies X86_FEATURE_AVX. Simplify chacha_mod_init_arch() accordingly.

(Note: as usual, arch/x86/kernel/cpu/cpuid-deps.c is non-enforcing: if a dependency isn't met, it warns and doesn't prevent booting. However, that case doesn't occur in real CPUs and is unsupported.)

---
 lib/crypto/x86/chacha.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-next

- Eric