Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp431223pxu; Fri, 11 Dec 2020 05:55:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwG9jgwhrKUtzjwOJqPgPaiunGWNXegGuuCy01sqHnatvMgVZY+CuBLFihme3ylv+MZ0a/G X-Received: by 2002:a05:6402:b9a:: with SMTP id cf26mr11722752edb.372.1607694949735; Fri, 11 Dec 2020 05:55:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607694949; cv=none; d=google.com; s=arc-20160816; b=nsBUSOITUiBtgqLEAVVrVkCjk4e7zpiGbI9aNn3uTGNB9obeB34H45TgioXftrkeOd yF3Ij95yQAlJtDZZq1BuNf6A+VT+a7m4mP4J+9MGMPijeAATHr7UQOM9HUZoX5BQBaK8 vIin/H53af4sTSKljPt1/Gt87OOXTUv6vABmDtvFLLlpsbSEebak00+ZjwbsfkM8JhU8 49l5Ed+VY6xxd/5TKuua/WJ0dw9cOgsWyVqqlWnhSpQEi93EyEyTj/99LorxYumkzqOI YWFWHqdDN6soVqfZP7qEVDC1avw0ppU3YuorJbl6Jy66RWnDn0qkm+5QKiJyS6RWr+GR Zd9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=WZjlybtXX1QnZJ4UDBXSftUsTFTAQLichijxR5G0R6M=; b=KOgUgsS8au2oka6CB+HxYmXQ01h6iz9uFf3QWSN5fkMaqyp8LwY8xOOJGz+GpcLonr 3AoxFdTjJa9oPRpn8tQ1PbnCgndxamrFEgRJUGj4qLdrjdc5r8ylQrKfWwONJEvkzx/N qBzAMOir4h6Xzrc6xekAfG+0yjITOcjHTsfvpWXJd2y+3isVi6L8b6oFISdU6fKWuL9I 3f4FQzDq516eho72vF1xh7xwPGHfBn3TiQKSTiRW/vE2tBxrZbimyLlR3Z1BodcnCw6m RsS4yMRwwGO48LyAHG5pl1jVaHOCqBkHFd+XfiW4Ww8Sr6iIBGUnMIvEukW19actDh4b SHUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v18si4738704edi.471.2020.12.11.05.55.20; Fri, 11 Dec 2020 05:55:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395111AbgLKLqL (ORCPT + 99 others); Fri, 11 Dec 2020 06:46:11 -0500 Received: from ZXSHCAS2.zhaoxin.com ([203.148.12.82]:24280 "EHLO ZXSHCAS2.zhaoxin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2395106AbgLKLps (ORCPT ); Fri, 11 Dec 2020 06:45:48 -0500 X-Greylist: delayed 953 seconds by postgrey-1.27 at vger.kernel.org; Fri, 11 Dec 2020 06:45:45 EST Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHCAS2.zhaoxin.com (10.28.252.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 11 Dec 2020 19:29:08 +0800 Received: from tony-HX002EA.zhaoxin.com (10.32.56.37) by zxbjmbx1.zhaoxin.com (10.29.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 11 Dec 2020 19:29:06 +0800 From: Tony W Wang-oc To: , , , , , , , , CC: , , , , , Subject: [PATCH] crypto: x86/crc32c-intel - Don't match some Zhaoxin CPUs Date: Fri, 11 Dec 2020 19:29:04 +0800 Message-ID: <1607686144-2604-1-git-send-email-TonyWWang-oc@zhaoxin.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.32.56.37] X-ClientProxiedBy: ZXSHCAS2.zhaoxin.com (10.28.252.162) To zxbjmbx1.zhaoxin.com (10.29.252.163) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The driver crc32c-intel match CPUs supporting X86_FEATURE_XMM4_2. On platforms with Zhaoxin CPUs supporting this X86 feature, When crc32c-intel and crc32c-generic are both registered, system will use crc32c-intel because its .cra_priority is greater than crc32c-generic. This case expect to use crc32c-generic driver for some Zhaoxin CPUs to get performance gain, So remove these Zhaoxin CPUs support from crc32c-intel. Signed-off-by: Tony W Wang-oc --- arch/x86/crypto/crc32c-intel_glue.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/x86/crypto/crc32c-intel_glue.c b/arch/x86/crypto/crc32c-intel_glue.c index feccb52..6dafdae 100644 --- a/arch/x86/crypto/crc32c-intel_glue.c +++ b/arch/x86/crypto/crc32c-intel_glue.c @@ -222,8 +222,16 @@ MODULE_DEVICE_TABLE(x86cpu, crc32c_cpu_id); static int __init crc32c_intel_mod_init(void) { + struct cpuinfo_x86 *c = &boot_cpu_data; + if (!x86_match_cpu(crc32c_cpu_id)) return -ENODEV; + + if (c->x86_vendor == X86_VENDOR_ZHAOXIN || c->x86_vendor == X86_VENDOR_CENTAUR) { + if (c->x86 == 0x6 || (c->x86 == 0x7 && c->x86_model <= 0x3b)) + return -ENODEV; + } + #ifdef CONFIG_X86_64 if (boot_cpu_has(X86_FEATURE_PCLMULQDQ)) { alg.update = crc32c_pcl_intel_update; -- 2.7.4