diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2011-04-18 18:31:57 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2011-04-18 19:40:32 -0400 |
commit | d8d9766c8c29f71c37bc4b74cc9fcf6a192c9bfd (patch) | |
tree | e491da1e7e5a7dd2b500d4cb62b17b56e13f306a /arch/x86/kernel/alternative.c | |
parent | dc326fca2b640fc41aed7c015d0f456935a66255 (diff) |
x86, cpu: Change NOP selection for certain Intel CPUs
Due to a decoder implementation quirk, some specific Intel CPUs
actually perform better with the "k8_nops" than with the
SDM-recommended NOPs. For runtime-selected NOPs, if we detect those
specific CPUs then use the k8_nops instead of the ones we would
normally use.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jason Baron <jbaron@redhat.com>
Link: http://lkml.kernel.org/r/1303166160-10315-4-git-send-email-hpa@linux.intel.com
Diffstat (limited to 'arch/x86/kernel/alternative.c')
-rw-r--r-- | arch/x86/kernel/alternative.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 846f61eb89c1..c0501ea6b634 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c | |||
@@ -199,7 +199,19 @@ void __init arch_init_ideal_nops(void) | |||
199 | { | 199 | { |
200 | switch (boot_cpu_data.x86_vendor) { | 200 | switch (boot_cpu_data.x86_vendor) { |
201 | case X86_VENDOR_INTEL: | 201 | case X86_VENDOR_INTEL: |
202 | if (boot_cpu_has(X86_FEATURE_NOPL)) { | 202 | /* |
203 | * Due to a decoder implementation quirk, some | ||
204 | * specific Intel CPUs actually perform better with | ||
205 | * the "k8_nops" than with the SDM-recommended NOPs. | ||
206 | */ | ||
207 | if (boot_cpu_data.x86 == 6 && | ||
208 | boot_cpu_data.x86_model >= 0x0f && | ||
209 | boot_cpu_data.x86_model != 0x1c && | ||
210 | boot_cpu_data.x86_model != 0x26 && | ||
211 | boot_cpu_data.x86_model != 0x27 && | ||
212 | boot_cpu_data.x86_model < 0x30) { | ||
213 | ideal_nops = k8_nops; | ||
214 | } else if (boot_cpu_has(X86_FEATURE_NOPL)) { | ||
203 | ideal_nops = p6_nops; | 215 | ideal_nops = p6_nops; |
204 | } else { | 216 | } else { |
205 | #ifdef CONFIG_X86_64 | 217 | #ifdef CONFIG_X86_64 |