aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2014-03-09 13:05:25 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2014-03-13 18:35:09 -0400
commitc0a639ad0bc6b178b46996bd1f821a04643e2bde (patch)
tree1ffe363181917629c2ab2e67f9c11485891f803b /arch/x86/kernel/cpu
parent8f86a7373a1c8ee52d3cc64adf7f2ace13fd24ed (diff)
x86, Intel: Convert to the new bit access MSR accessors
... and save some lines of code. Signed-off-by: Borislav Petkov <bp@suse.de> Link: http://lkml.kernel.org/r/1394384725-10796-4-git-send-email-bp@alien8.de Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r--arch/x86/kernel/cpu/intel.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 5cd9bfabd645..44ca6317af43 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -31,11 +31,7 @@ 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, MSR_BIT_LIMIT_CPUID) > 0) {
35
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); 35 c->cpuid_level = cpuid_eax(0);
40 get_cpu_cap(c); 36 get_cpu_cap(c);
41 } 37 }
@@ -129,16 +125,9 @@ static void early_init_intel(struct cpuinfo_x86 *c)
129 * Ingo Molnar reported a Pentium D (model 6) and a Xeon 125 * Ingo Molnar reported a Pentium D (model 6) and a Xeon
130 * (model 2) with the same problem. 126 * (model 2) with the same problem.
131 */ 127 */
132 if (c->x86 == 15) { 128 if (c->x86 == 15)
133 rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable); 129 if (msr_clear_bit(MSR_IA32_MISC_ENABLE, MSR_BIT_FAST_STRING) > 0)
134 130 pr_info("kmemcheck: Disabling fast string operations\n");
135 if (misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING) {
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 131#endif
143 132
144 /* 133 /*
@@ -197,8 +186,6 @@ static void intel_smp_check(struct cpuinfo_x86 *c)
197 186
198static void intel_workarounds(struct cpuinfo_x86 *c) 187static void intel_workarounds(struct cpuinfo_x86 *c)
199{ 188{
200 unsigned long lo, hi;
201
202#ifdef CONFIG_X86_F00F_BUG 189#ifdef CONFIG_X86_F00F_BUG
203 /* 190 /*
204 * All current models of Pentium and Pentium with MMX technology CPUs 191 * All current models of Pentium and Pentium with MMX technology CPUs
@@ -229,12 +216,9 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
229 * Hardware prefetcher may cause stale data to be loaded into the cache. 216 * Hardware prefetcher may cause stale data to be loaded into the cache.
230 */ 217 */
231 if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) { 218 if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) {
232 rdmsr(MSR_IA32_MISC_ENABLE, lo, hi); 219 if (msr_set_bit(MSR_IA32_MISC_ENABLE, MSR_BIT_PRF_DIS) > 0) {
233 if ((lo & MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE) == 0) { 220 pr_info("CPU: C0 stepping P4 Xeon detected.\n");
234 printk (KERN_INFO "CPU: C0 stepping P4 Xeon detected.\n"); 221 pr_info("CPU: Disabling hardware prefetching (Errata 037)\n");
235 printk (KERN_INFO "CPU: Disabling hardware prefetching (Errata 037)\n");
236 lo |= MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE;
237 wrmsr(MSR_IA32_MISC_ENABLE, lo, hi);
238 } 222 }
239 } 223 }
240 224