Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2172585pxb; Mon, 11 Jan 2021 02:57:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQ8dBbuGojsV/CzsjMJuqvujswRgzYyyKNpbSsYA6VKJ4/UwU5vBTtUhQQaCvY9YrApQp9 X-Received: by 2002:a17:906:7e0b:: with SMTP id e11mr10131466ejr.533.1610362643016; Mon, 11 Jan 2021 02:57:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610362643; cv=none; d=google.com; s=arc-20160816; b=vNneAUowcQVUY798xG4EDrY1oCy+MbvCf5oBO+B6mq20WPHDoNObnmvgFFT6G34c3A l5NSMbmEuK7Jzg2HKu2vhoIsVHd9ZxyPN5jqWUgJTTR5c2OmwcD7gyz+AmimankZ8yBF 7QekYWRgjkwkWzopZiPE4CTa2vBg0YxGw5yvnczxktDNZcBtV+2gfsmvbofyWguBr9dF XB8ArwXr4xmEOXUH5C3OVFo06EF6WQ3Vuk+zJEDGnjzHBjlRv87HXssyBjhbDIVvNoYy HhF1KlD/E90HRC6QudKafcE/WnQUNMD7JRlhX4GZ0kL3Mc+Kb0ZjIfnlFS2bqmeoUiGM OfmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=sMJbgtX8ovrg4bwyqNKCmcxFbYz9qEqvMaVab4pyFZ4=; b=HzbbcBkNk1LPvnh4CsWGZVHVOTvk7A6UJQ5euDc6xWfxKX+fX/dECWyoahaqJFGsMn A1ig4ou0a9C7Br2qx6n6bb5CIe0taleGYk/uV/MgKyHk576u4sf4sOfIU+LChKDaaG1U eYdeRVtNCQ16coLLsoNPCk5UgFpwrIqGrrGoZRBoDO/4Ncb+dLOo7vnyztJTP3XrM9Mx Zx84A6UwON8gDgwtscZaR98umY/gYpEcjQJWbdI9NstUaQasvzVPUC1N3wxI7/6o4ecJ XDsCxzYtKmlHBvySVBCm0buZL5PGVVHzJSAL2dXWRTaCVUtGG3EJ5eZqUt/ypPmLvLNd +rug== 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 b21si6763039ejz.649.2021.01.11.02.57.04; Mon, 11 Jan 2021 02:57:23 -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 S1729040AbhAKKzA (ORCPT + 99 others); Mon, 11 Jan 2021 05:55:00 -0500 Received: from ZXSHCAS2.zhaoxin.com ([203.148.12.82]:24162 "EHLO ZXSHCAS2.zhaoxin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726719AbhAKKzA (ORCPT ); Mon, 11 Jan 2021 05:55:00 -0500 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; Mon, 11 Jan 2021 18:54:16 +0800 Received: from [10.32.56.37] (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; Mon, 11 Jan 2021 18:54:13 +0800 Subject: Re: [PATCH v1 2/3] x86/cpu: Set low performance CRC32C flag on some Zhaoxin CPUs To: Dave Hansen , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , References: <1610000348-17316-1-git-send-email-TonyWWang-oc@zhaoxin.com> <1610000348-17316-3-git-send-email-TonyWWang-oc@zhaoxin.com> <607494aa-674a-fe93-50f6-2c45f385f7e9@intel.com> From: Tony W Wang-oc Message-ID: <6d2f1d21-635d-d359-ee2c-ce0665f519d7@zhaoxin.com> Date: Mon, 11 Jan 2021 18:54:12 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <607494aa-674a-fe93-50f6-2c45f385f7e9@intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.32.56.37] X-ClientProxiedBy: ZXSHCAS1.zhaoxin.com (10.28.252.161) To zxbjmbx1.zhaoxin.com (10.29.252.163) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 07/01/2021 23:52, Dave Hansen wrote: > On 1/6/21 10:19 PM, Tony W Wang-oc wrote: >> + /* >> + * These CPUs declare support SSE4.2 instruction sets but >> + * having low performance CRC32C instruction implementation. >> + */ >> + if (c->x86 == 0x6 || (c->x86 == 0x7 && c->x86_model <= 0x3b)) >> + set_cpu_cap(c, X86_FEATURE_CRC32C); >> } > > On the Intel side, we've tried to move away from open-coded model > numbers. Say another CPU is released that has a microarchitecture close > to 0x3b, but has a model of 0x3c. It's a *LOT* easier to grep for > INTEL_FAM6_NEHALEM (or whatever) than 0x3c. See: > > arch/x86/include/asm/intel-family.h > > for examples. > . > Got it, thanks for your suggestion. Sincerely Tonyw