diff options
Diffstat (limited to 'arch/x86/kernel/cpu/intel.c')
| -rw-r--r-- | arch/x86/kernel/cpu/intel.c | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 24ff26a38ade..191117f1ad51 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <asm/uaccess.h> | 13 | #include <asm/uaccess.h> |
| 14 | #include <asm/ds.h> | 14 | #include <asm/ds.h> |
| 15 | #include <asm/bugs.h> | 15 | #include <asm/bugs.h> |
| 16 | #include <asm/cpu.h> | ||
| 16 | 17 | ||
| 17 | #ifdef CONFIG_X86_64 | 18 | #ifdef CONFIG_X86_64 |
| 18 | #include <asm/topology.h> | 19 | #include <asm/topology.h> |
| @@ -24,7 +25,6 @@ | |||
| 24 | #ifdef CONFIG_X86_LOCAL_APIC | 25 | #ifdef CONFIG_X86_LOCAL_APIC |
| 25 | #include <asm/mpspec.h> | 26 | #include <asm/mpspec.h> |
| 26 | #include <asm/apic.h> | 27 | #include <asm/apic.h> |
| 27 | #include <mach_apic.h> | ||
| 28 | #endif | 28 | #endif |
| 29 | 29 | ||
| 30 | static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) | 30 | static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) |
| @@ -63,6 +63,18 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) | |||
| 63 | set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC); | 63 | set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | /* | ||
| 67 | * There is a known erratum on Pentium III and Core Solo | ||
| 68 | * and Core Duo CPUs. | ||
| 69 | * " Page with PAT set to WC while associated MTRR is UC | ||
| 70 | * may consolidate to UC " | ||
| 71 | * Because of this erratum, it is better to stick with | ||
| 72 | * setting WC in MTRR rather than using PAT on these CPUs. | ||
| 73 | * | ||
| 74 | * Enable PAT WC only on P4, Core 2 or later CPUs. | ||
| 75 | */ | ||
| 76 | if (c->x86 == 6 && c->x86_model < 15) | ||
| 77 | clear_cpu_cap(c, X86_FEATURE_PAT); | ||
| 66 | } | 78 | } |
| 67 | 79 | ||
| 68 | #ifdef CONFIG_X86_32 | 80 | #ifdef CONFIG_X86_32 |
| @@ -99,6 +111,28 @@ static void __cpuinit trap_init_f00f_bug(void) | |||
| 99 | } | 111 | } |
| 100 | #endif | 112 | #endif |
| 101 | 113 | ||
| 114 | static void __cpuinit intel_smp_check(struct cpuinfo_x86 *c) | ||
| 115 | { | ||
| 116 | #ifdef CONFIG_SMP | ||
| 117 | /* calling is from identify_secondary_cpu() ? */ | ||
| 118 | if (c->cpu_index == boot_cpu_id) | ||
| 119 | return; | ||
| 120 | |||
| 121 | /* | ||
| 122 | * Mask B, Pentium, but not Pentium MMX | ||
| 123 | */ | ||
| 124 | if (c->x86 == 5 && | ||
| 125 | c->x86_mask >= 1 && c->x86_mask <= 4 && | ||
| 126 | c->x86_model <= 3) { | ||
| 127 | /* | ||
| 128 | * Remember we have B step Pentia with bugs | ||
| 129 | */ | ||
| 130 | WARN_ONCE(1, "WARNING: SMP operation may be unreliable" | ||
| 131 | "with B stepping processors.\n"); | ||
| 132 | } | ||
| 133 | #endif | ||
| 134 | } | ||
| 135 | |||
| 102 | static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c) | 136 | static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c) |
| 103 | { | 137 | { |
| 104 | unsigned long lo, hi; | 138 | unsigned long lo, hi; |
| @@ -135,10 +169,10 @@ static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c) | |||
| 135 | */ | 169 | */ |
| 136 | if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) { | 170 | if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) { |
| 137 | rdmsr(MSR_IA32_MISC_ENABLE, lo, hi); | 171 | rdmsr(MSR_IA32_MISC_ENABLE, lo, hi); |
| 138 | if ((lo & (1<<9)) == 0) { | 172 | if ((lo & MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE) == 0) { |
| 139 | printk (KERN_INFO "CPU: C0 stepping P4 Xeon detected.\n"); | 173 | printk (KERN_INFO "CPU: C0 stepping P4 Xeon detected.\n"); |
| 140 | printk (KERN_INFO "CPU: Disabling hardware prefetching (Errata 037)\n"); | 174 | printk (KERN_INFO "CPU: Disabling hardware prefetching (Errata 037)\n"); |
| 141 | lo |= (1<<9); /* Disable hw prefetching */ | 175 | lo |= MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE; |
| 142 | wrmsr (MSR_IA32_MISC_ENABLE, lo, hi); | 176 | wrmsr (MSR_IA32_MISC_ENABLE, lo, hi); |
| 143 | } | 177 | } |
| 144 | } | 178 | } |
| @@ -175,6 +209,8 @@ static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c) | |||
| 175 | #ifdef CONFIG_X86_NUMAQ | 209 | #ifdef CONFIG_X86_NUMAQ |
| 176 | numaq_tsc_disable(); | 210 | numaq_tsc_disable(); |
| 177 | #endif | 211 | #endif |
| 212 | |||
| 213 | intel_smp_check(c); | ||
| 178 | } | 214 | } |
| 179 | #else | 215 | #else |
| 180 | static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c) | 216 | static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c) |
