x86/copy_user_generic: Optimize copy_user_generic with CPU erms feature
authorFenghua Yu <fenghua.yu@intel.com>
Fri, 25 May 2012 01:19:45 +0000 (18:19 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Fri, 29 Jun 2012 22:33:34 +0000 (15:33 -0700)
commit954e482bde20b0e208fd4d34ef26e10afd194600
treea98702fdde1d47b31851cee7b81849dec8b91f09
parent2f74759056797054122cdc70844137f70bb3f626
x86/copy_user_generic: Optimize copy_user_generic with CPU erms feature

According to Intel 64 and IA-32 SDM and Optimization Reference Manual, beginning
with Ivybridge, REG string operation using MOVSB and STOSB can provide both
flexible and high-performance REG string operations in cases like memory copy.
Enhancement availability is indicated by CPUID.7.0.EBX[9] (Enhanced REP MOVSB/
STOSB).

If CPU erms feature is detected, patch copy_user_generic with enhanced fast
string version of copy_user_generic.

A few new macros are defined to reduce duplicate code in ALTERNATIVE and
ALTERNATIVE_2.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Link: http://lkml.kernel.org/r/1337908785-14015-1-git-send-email-fenghua.yu@intel.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/include/asm/alternative.h
arch/x86/include/asm/uaccess_64.h
arch/x86/kernel/x8664_ksyms_64.c