]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
x86/cpufeatures: Add support for fast short REP; MOVSB
authorTony Luck <tony.luck@intel.com>
Mon, 16 Dec 2019 21:42:54 +0000 (13:42 -0800)
committerBorislav Petkov <bp@suse.de>
Wed, 8 Jan 2020 10:29:25 +0000 (11:29 +0100)
commitf444a5ff95dce07cf4353cbb85fc3e785019d430
tree028332dd5f3c84140bc8ec91bc705b39f0546e1d
parent50cc02e599ef1e049473358604dc07d32b751e2c
x86/cpufeatures: Add support for fast short REP; MOVSB

>From the Intel Optimization Reference Manual:

3.7.6.1 Fast Short REP MOVSB
Beginning with processors based on Ice Lake Client microarchitecture,
REP MOVSB performance of short operations is enhanced. The enhancement
applies to string lengths between 1 and 128 bytes long.  Support for
fast-short REP MOVSB is enumerated by the CPUID feature flag: CPUID
[EAX=7H, ECX=0H).EDX.FAST_SHORT_REP_MOVSB[bit 4] = 1. There is no change
in the REP STOS performance.

Add an X86_FEATURE_FSRM flag for this.

memmove() avoids REP MOVSB for short (< 32 byte) copies. Check FSRM and
use REP MOVSB for short copies on systems that support it.

 [ bp: Massage and add comment. ]

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20191216214254.26492-1-tony.luck@intel.com
arch/x86/include/asm/cpufeatures.h
arch/x86/lib/memmove_64.S