Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2171069pxb; Mon, 11 Jan 2021 02:54:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJmpHinuo+5/HVzCa9aSviDEU7a5DZ0bcUdIxKVVk7qM9DGE+3mx2aFTP4BVA0tzFqCa5D X-Received: by 2002:a17:906:f905:: with SMTP id lc5mr10296417ejb.177.1610362470126; Mon, 11 Jan 2021 02:54:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610362470; cv=none; d=google.com; s=arc-20160816; b=Yv/WTQ3FZ0CuJk1mT/6l4HIjzyE/+dmvQ9xmzE8GDrO4muimuwkENg8G8s1llAWmhr jspyCiyRZy23GDJWmWKurZmM4QU51QWa4S92NVlLqpx/8OPEY/KgW1J68N4JDvY/vo4+ ozQ5Upp1cJd4lF8LkYaKOzTsjzrGBqfW0X1tQqZpFAEmo9b4GyXL7e9Fa3jfHfJKuMgN uXgxfcwI35B/ym0LfZYrdCDP3EPnWztUFo6V7P4HTb39Dka/m89r+yPaFhvMXMPIJWLI EUMHfVmyQeSu90IHVgq/l/YLVniySLVyL4Ljk4jpP5MsVvseiIXnmcOe8WK4eiA85z5g H93w== 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=L5RjcA7Yk49kIRnvlw6RA7xvU5FnVAtFCfUpmZLsuqk=; b=Qy/GYcMwmpd2K0IclVPYGOSFHIE00nlgaLKSP7XlAs2Fd10rI6HqHmQPi+++4XLDo8 Wc4Ivyj+Yo3dD53vDoNBvjNkUk7nlO5b5CR6l2um5y9re20+Son8/MnXGQypKYpFCDIn Cjk40vrNeupJj2z9XqT1PUe9hYdCIG1US0TJDSPjvwUcnMmPyXBpQatsacIO6daCR6Zr H1YTYdnX/QIaFv3Zm9j7jqjWTlC9luvlyP2SGa1on+6oEmdTmCWDJxdyWDO94yoS0xin iDhS4+bvg1IqXu7yUaGB1wQN+F0zLlwC7L1lHNBWTqH8MBrT8SlGkWQJGlB2xoAoqq8r K1vQ== 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 d5si6428211ejz.505.2021.01.11.02.54.08; Mon, 11 Jan 2021 02:54:30 -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 S1729303AbhAKKw5 (ORCPT + 99 others); Mon, 11 Jan 2021 05:52:57 -0500 Received: from ZXSHCAS1.zhaoxin.com ([203.148.12.81]:31062 "EHLO ZXSHCAS1.zhaoxin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728725AbhAKKw5 (ORCPT ); Mon, 11 Jan 2021 05:52:57 -0500 Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHCAS1.zhaoxin.com (10.28.252.161) 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:52:10 +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:52:07 +0800 Subject: Re: [PATCH v1 1/3] x86/cpufeatures: Add low performance CRC32C instruction CPU feature To: Borislav Petkov CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , References: <1610000348-17316-1-git-send-email-TonyWWang-oc@zhaoxin.com> <1610000348-17316-2-git-send-email-TonyWWang-oc@zhaoxin.com> <20210107063750.GA14697@zn.tnic> From: Tony W Wang-oc Message-ID: <871e93d3-701e-86cd-6454-19fbb083d0c5@zhaoxin.com> Date: Mon, 11 Jan 2021 18:51:59 +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: <20210107063750.GA14697@zn.tnic> 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 14:37, Borislav Petkov wrote: > On Thu, Jan 07, 2021 at 02:19:06PM +0800, Tony W Wang-oc wrote: >> SSE4.2 on Zhaoxin CPUs are compatible with Intel. The presence of >> CRC32C instruction is enumerated by CPUID.01H:ECX.SSE4_2[bit 20] = 1. >> Some Zhaoxin CPUs declare support SSE4.2 instruction sets but their >> CRC32C instruction are working with low performance. >> >> Add a synthetic CPU flag to indicates that the CRC32C instruction is >> not working as intended. This low performance CRC32C instruction flag >> is depend on X86_FEATURE_XMM4_2. >> >> Signed-off-by: Tony W Wang-oc >> --- >> arch/x86/include/asm/cpufeatures.h | 1 + >> arch/x86/kernel/cpu/cpuid-deps.c | 1 + >> 2 files changed, 2 insertions(+) >> >> diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h >> index 84b8878..9e8151b 100644 >> --- a/arch/x86/include/asm/cpufeatures.h >> +++ b/arch/x86/include/asm/cpufeatures.h >> @@ -292,6 +292,7 @@ >> #define X86_FEATURE_FENCE_SWAPGS_KERNEL (11*32+ 5) /* "" LFENCE in kernel entry SWAPGS path */ >> #define X86_FEATURE_SPLIT_LOCK_DETECT (11*32+ 6) /* #AC for split lock */ >> #define X86_FEATURE_PER_THREAD_MBA (11*32+ 7) /* "" Per-thread Memory Bandwidth Allocation */ >> +#define X86_FEATURE_CRC32C (11*32+ 8) /* "" Low performance CRC32C instruction */ > > Didn't hpa say to create a BUG flag for it - X86_BUG...? Low performance > insn sounds like a bug and not a feature to me. > > And call it X86_BUG_CRC32C_SLOW or ..._UNUSABLE to denote what it means. > This issue will be enhanced by hardware and patch submit will be pending. Sincerely Tonyw