aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/intel.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/cpu/intel.c')
-rw-r--r--arch/x86/kernel/cpu/intel.c57
1 files changed, 30 insertions, 27 deletions
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 5cd9bfabd645..a80029035bf2 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -31,11 +31,8 @@ static void early_init_intel(struct cpuinfo_x86 *c)
31 31
32 /* Unmask CPUID levels if masked: */ 32 /* Unmask CPUID levels if masked: */
33 if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) { 33 if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
34 rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable); 34 if (msr_clear_bit(MSR_IA32_MISC_ENABLE,
35 35 MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT) > 0) {
36 if (misc_enable & MSR_IA32_MISC_ENABLE_LIMIT_CPUID) {
37 misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID;
38 wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
39 c->cpuid_level = cpuid_eax(0); 36 c->cpuid_level = cpuid_eax(0);
40 get_cpu_cap(c); 37 get_cpu_cap(c);
41 } 38 }
@@ -129,16 +126,10 @@ static void early_init_intel(struct cpuinfo_x86 *c)
129 * Ingo Molnar reported a Pentium D (model 6) and a Xeon 126 * Ingo Molnar reported a Pentium D (model 6) and a Xeon
130 * (model 2) with the same problem. 127 * (model 2) with the same problem.
131 */ 128 */
132 if (c->x86 == 15) { 129 if (c->x86 == 15)
133 rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable); 130 if (msr_clear_bit(MSR_IA32_MISC_ENABLE,
134 131 MSR_IA32_MISC_ENABLE_FAST_STRING_BIT) > 0)
135 if (misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING) { 132 pr_info("kmemcheck: Disabling fast string operations\n");
136 printk(KERN_INFO "kmemcheck: Disabling fast string operations\n");
137
138 misc_enable &= ~MSR_IA32_MISC_ENABLE_FAST_STRING;
139 wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
140 }
141 }
142#endif 133#endif
143 134
144 /* 135 /*
@@ -195,10 +186,16 @@ static void intel_smp_check(struct cpuinfo_x86 *c)
195 } 186 }
196} 187}
197 188
198static void intel_workarounds(struct cpuinfo_x86 *c) 189static int forcepae;
190static int __init forcepae_setup(char *__unused)
199{ 191{
200 unsigned long lo, hi; 192 forcepae = 1;
193 return 1;
194}
195__setup("forcepae", forcepae_setup);
201 196
197static void intel_workarounds(struct cpuinfo_x86 *c)
198{
202#ifdef CONFIG_X86_F00F_BUG 199#ifdef CONFIG_X86_F00F_BUG
203 /* 200 /*
204 * All current models of Pentium and Pentium with MMX technology CPUs 201 * All current models of Pentium and Pentium with MMX technology CPUs
@@ -225,16 +222,26 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
225 clear_cpu_cap(c, X86_FEATURE_SEP); 222 clear_cpu_cap(c, X86_FEATURE_SEP);
226 223
227 /* 224 /*
225 * PAE CPUID issue: many Pentium M report no PAE but may have a
226 * functionally usable PAE implementation.
227 * Forcefully enable PAE if kernel parameter "forcepae" is present.
228 */
229 if (forcepae) {
230 printk(KERN_WARNING "PAE forced!\n");
231 set_cpu_cap(c, X86_FEATURE_PAE);
232 add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_NOW_UNRELIABLE);
233 }
234
235 /*
228 * P4 Xeon errata 037 workaround. 236 * P4 Xeon errata 037 workaround.
229 * Hardware prefetcher may cause stale data to be loaded into the cache. 237 * Hardware prefetcher may cause stale data to be loaded into the cache.
230 */ 238 */
231 if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) { 239 if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) {
232 rdmsr(MSR_IA32_MISC_ENABLE, lo, hi); 240 if (msr_set_bit(MSR_IA32_MISC_ENABLE,
233 if ((lo & MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE) == 0) { 241 MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT)
234 printk (KERN_INFO "CPU: C0 stepping P4 Xeon detected.\n"); 242 > 0) {
235 printk (KERN_INFO "CPU: Disabling hardware prefetching (Errata 037)\n"); 243 pr_info("CPU: C0 stepping P4 Xeon detected.\n");
236 lo |= MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE; 244 pr_info("CPU: Disabling hardware prefetching (Errata 037)\n");
237 wrmsr(MSR_IA32_MISC_ENABLE, lo, hi);
238 } 245 }
239 } 246 }
240 247
@@ -267,10 +274,6 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
267 } 274 }
268#endif 275#endif
269 276
270#ifdef CONFIG_X86_NUMAQ
271 numaq_tsc_disable();
272#endif
273
274 intel_smp_check(c); 277 intel_smp_check(c);
275} 278}
276#else 279#else