public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] crypto: x86/crc32c-intel - Exclude some Zhaoxin CPUs
@ 2021-01-07  6:19 Tony W Wang-oc
  2021-01-07  6:19 ` [PATCH v1 1/3] x86/cpufeatures: Add low performance CRC32C instruction CPU feature Tony W Wang-oc
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Tony W Wang-oc @ 2021-01-07  6:19 UTC (permalink / raw)
  To: herbert, davem, tglx, mingo, bp, x86, hpa, tony.luck, dave.hansen,
	seanjc, fenghua.yu, thomas.lendacky, kyung.min.park, kim.phillips,
	mgross, peterz, krish.sadhukhan, liam.merwick, mlevitsk,
	reinette.chatre, babu.moger, linux-crypto, linux-kernel
  Cc: TimGuo-oc, CooperYan, QiyuanWang, HerryYang, CobeChen, SilviaZhao

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.

When doing lmbench3 Create and Delete file test on partitions with
ext4 enabling metadata checksum, found using crc32c-generic driver
could get about 20% performance gain than using the driver crc32c-intel
on some Zhaoxin CPUs. Lower-level testing result is that with the same
input value the generic C implementation takes fewer time than the crc32c
instruction implementation on these CPUs. This case expect to use
crc32c-generic driver for these CPUs to get performance gain.

The presence of crc32c is enumerated by CPUID.01:ECX[SSE4.2] = 1, and
these CPUs other SSE4.2 instructions is ok.

Add a synthetic flag to indicates low performance CRC32C instruction
implementation, set this flag in Zhaoxin CPUs specific init phase,
and exclude CPUs which setting this flag from the driver crc32c-intel.

https://lkml.org/lkml/2020/12/21/789

Tony W Wang-oc (3):
  x86/cpufeatures: Add low performance CRC32C instruction CPU feature
  x86/cpu: Set low performance CRC32C flag on some Zhaoxin CPUs
  crypto: x86/crc32c-intel Exclude low performance CRC32C instruction
    CPUs

 arch/x86/crypto/crc32c-intel_glue.c | 5 +++++
 arch/x86/include/asm/cpufeatures.h  | 1 +
 arch/x86/kernel/cpu/centaur.c       | 7 +++++++
 arch/x86/kernel/cpu/cpuid-deps.c    | 1 +
 arch/x86/kernel/cpu/zhaoxin.c       | 6 ++++++
 5 files changed, 20 insertions(+)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-01-15  1:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-07  6:19 [PATCH v1 0/3] crypto: x86/crc32c-intel - Exclude some Zhaoxin CPUs Tony W Wang-oc
2021-01-07  6:19 ` [PATCH v1 1/3] x86/cpufeatures: Add low performance CRC32C instruction CPU feature Tony W Wang-oc
2021-01-07  6:37   ` Borislav Petkov
2021-01-11 10:51     ` Tony W Wang-oc
2021-01-11 11:03       ` Borislav Petkov
2021-01-15  1:43         ` Tony W Wang-oc
2021-01-11 15:20     ` hpa
2021-01-07  6:19 ` [PATCH v1 2/3] x86/cpu: Set low performance CRC32C flag on some Zhaoxin CPUs Tony W Wang-oc
2021-01-07 15:52   ` Dave Hansen
2021-01-11 10:54     ` Tony W Wang-oc
2021-01-07  6:19 ` [PATCH v1 3/3] crypto: x86/crc32c-intel Exclude low performance CRC32C instruction CPUs Tony W Wang-oc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox