Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp93680pxu; Wed, 6 Jan 2021 22:40:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6XcSfGILwyAbYu+p3o9FQrF91Ize23G2X1Vi7RmiJMou3dAkLnRnrEsilYGKYbUwVqiE8 X-Received: by 2002:a17:906:cec7:: with SMTP id si7mr5123777ejb.123.1610001610534; Wed, 06 Jan 2021 22:40:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610001610; cv=none; d=google.com; s=arc-20160816; b=t1lL6HTmbt2U2usmq3OzwK1zvWWvXkJv7bvic2ZvtBIbf2nkxJGPAFMHHUOWsDtq2v idatxfPT8NYclMcDQA55v/+htccltiyncTFzMdJKaD+aL28GHtNF5klzIqy0fofsPQHG seGhHxCU7qvBsXcrJkckvI2Nv2NpQwWqK5KlHJ/0PVIPd7e3xJyVZPk5f48MUo07GJHY gjSPhxCLiZL/0866Fu99iWeJ8R80yDfRMU82JS0iAmRmavV53uluozO2tX2AkiLOujfD of6NWGxzLXZ7QS11lx9dCBpLlgaoCqCPutLQ2mA/WwHx2aKtg2dyMMpWdYppDZKuurv0 Q98w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=v+qMAxqqt8nszXdetCtccYLnMdXSV0ny4ReqXtPVORw=; b=E7hUYeZz+jvjL4xrq92BK0jIGd1JbFDxrbGHu5x4jk0d5KiMw618q99TOU3dGExyzI YtWF4mJMzN8eUdHGVh0+8Ce1oNqU7bDun6MfLunYZlgpxBmD5kxxhp1jErLcgkrZFTXt Xw+J+FS0TgNieIUAaRpkW/41DLJzdFEVQhZ+f2O6F+I+26p5wlij4VI59jVItN6KIafD b2eHYIxy4zx4mJvsTEw62zwoGg7c7j+87i7p6JKRFGIZSH7H0kP6shvJc2FA2FjM2uMc xwxmxWU7ZFuarMSBSQuFhlUiAM9j9bN94ArgokssEEWngtyPuyprCkzoNS6yGCH2v7aa auUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=aP7NQt5L; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga12si1721185ejb.522.2021.01.06.22.39.49; Wed, 06 Jan 2021 22:40:10 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=aP7NQt5L; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726776AbhAGGij (ORCPT + 99 others); Thu, 7 Jan 2021 01:38:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726751AbhAGGij (ORCPT ); Thu, 7 Jan 2021 01:38:39 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16E6BC0612F4; Wed, 6 Jan 2021 22:37:58 -0800 (PST) Received: from zn.tnic (p200300ec2f0e340040aa7c2c4e2416a1.dip0.t-ipconnect.de [IPv6:2003:ec:2f0e:3400:40aa:7c2c:4e24:16a1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id EDEBE1EC0505; Thu, 7 Jan 2021 07:37:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1610001475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=v+qMAxqqt8nszXdetCtccYLnMdXSV0ny4ReqXtPVORw=; b=aP7NQt5Lz7pIHzFTeA7T5LrK0qu5eRPssQukqAt5INooLBcAfxyHQf77Goom81Ycr/gTDO 0SoLv3gF7o3MWnxjCFkj0ZQA8KTvKtaky2CsGIXktMzoEz22dFJOv/4eEQZiZpZn5nOlAX CY1lWo6OC0anBoE6SQZRNyL9M8peaTk= Date: Thu, 7 Jan 2021 07:37:50 +0100 From: Borislav Petkov To: Tony W Wang-oc Cc: herbert@gondor.apana.org.au, davem@davemloft.net, tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, hpa@zytor.com, tony.luck@intel.com, dave.hansen@intel.com, seanjc@google.com, fenghua.yu@intel.com, thomas.lendacky@amd.com, kyung.min.park@intel.com, kim.phillips@amd.com, mgross@linux.intel.com, peterz@infradead.org, krish.sadhukhan@oracle.com, liam.merwick@oracle.com, mlevitsk@redhat.com, reinette.chatre@intel.com, babu.moger@amd.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, TimGuo-oc@zhaoxin.com, CooperYan@zhaoxin.com, QiyuanWang@zhaoxin.com, HerryYang@zhaoxin.com, CobeChen@zhaoxin.com, SilviaZhao@zhaoxin.com Subject: Re: [PATCH v1 1/3] x86/cpufeatures: Add low performance CRC32C instruction CPU feature Message-ID: <20210107063750.GA14697@zn.tnic> References: <1610000348-17316-1-git-send-email-TonyWWang-oc@zhaoxin.com> <1610000348-17316-2-git-send-email-TonyWWang-oc@zhaoxin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1610000348-17316-2-git-send-email-TonyWWang-oc@zhaoxin.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette