From 1aa777a10d1dfe0a16071714f5ed697ce67c12f1 Mon Sep 17 00:00:00 2001 From: LeoLiu-oc Date: Mon, 29 Mar 2021 19:07:47 +0800 Subject: [PATCH 2897/2944] ck: crypto: x86/crc32c-intel Exclude low performance CRC32C instruction CPUs Low performance CRC32C instruction CPUs expect to use the driver crc32c-generic. So remove these CPUs support from crc32c-intel. Signed-off-by: LeoLiu-oc Reviewed-by: Artie Ding --- arch/x86/crypto/crc32c-intel_glue.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/crypto/crc32c-intel_glue.c b/arch/x86/crypto/crc32c-intel_glue.c index 5773e11..7fbec9c 100644 --- a/arch/x86/crypto/crc32c-intel_glue.c +++ b/arch/x86/crypto/crc32c-intel_glue.c @@ -244,6 +244,11 @@ static int __init crc32c_intel_mod_init(void) { if (!x86_match_cpu(crc32c_cpu_id)) return -ENODEV; + + /* Don't merit use low performance CRC32C instruction */ + if (boot_cpu_has(X86_FEATURE_CRC32C_LOW_PERF)) + return -ENODEV; + #ifdef CONFIG_X86_64 if (boot_cpu_has(X86_FEATURE_PCLMULQDQ)) { alg.update = crc32c_pcl_intel_update; -- 1.8.3.1