diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-18 11:25:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-18 11:25:51 -0400 |
commit | 9e9abecfc0ff3a9ad2ead954b37bbfcb863c775e (patch) | |
tree | 0c3ffda953b82750638a06507591ad587b565ff2 /arch/x86/kernel/cpu/intel.c | |
parent | d7bb545d86825e635cab33a1dd81ca0ad7b92887 (diff) | |
parent | 77ad386e596c6b0930cc2e09e3cce485e3ee7f72 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86: (613 commits)
x86: standalone trampoline code
x86: move suspend wakeup code to C
x86: coding style fixes to arch/x86/kernel/acpi/sleep.c
x86: setup_trampoline() - fix section mismatch warning
x86: section mismatch fixes, #1
x86: fix paranoia about using BIOS quickboot mechanism.
x86: print out buggy mptable
x86: use cpu_online()
x86: use cpumask_of_cpu()
x86: remove unnecessary tmp local variable
x86: remove unnecessary memset()
x86: use ioapic_read_entry() and ioapic_write_entry()
x86: avoid redundant loop in io_apic_level_ack_pending()
x86: remove superfluous initialisation in boot code.
x86: merge mpparse_{32,64}.c
x86: unify mp_register_gsi
x86: unify mp_config_acpi_legacy_irqs
x86: unify mp_register_ioapic
x86: unify uniq_io_apic_id
x86: unify smp_scan_config
...
Diffstat (limited to 'arch/x86/kernel/cpu/intel.c')
-rw-r--r-- | arch/x86/kernel/cpu/intel.c | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index fae31ce747bd..fe9224c51d37 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
@@ -30,7 +30,7 @@ | |||
30 | struct movsl_mask movsl_mask __read_mostly; | 30 | struct movsl_mask movsl_mask __read_mostly; |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | void __cpuinit early_init_intel(struct cpuinfo_x86 *c) | 33 | static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) |
34 | { | 34 | { |
35 | /* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */ | 35 | /* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */ |
36 | if (c->x86 == 15 && c->x86_cache_alignment == 64) | 36 | if (c->x86 == 15 && c->x86_cache_alignment == 64) |
@@ -45,7 +45,7 @@ void __cpuinit early_init_intel(struct cpuinfo_x86 *c) | |||
45 | * | 45 | * |
46 | * This is called before we do cpu ident work | 46 | * This is called before we do cpu ident work |
47 | */ | 47 | */ |
48 | 48 | ||
49 | int __cpuinit ppro_with_ram_bug(void) | 49 | int __cpuinit ppro_with_ram_bug(void) |
50 | { | 50 | { |
51 | /* Uses data from early_cpu_detect now */ | 51 | /* Uses data from early_cpu_detect now */ |
@@ -58,7 +58,7 @@ int __cpuinit ppro_with_ram_bug(void) | |||
58 | } | 58 | } |
59 | return 0; | 59 | return 0; |
60 | } | 60 | } |
61 | 61 | ||
62 | 62 | ||
63 | /* | 63 | /* |
64 | * P4 Xeon errata 037 workaround. | 64 | * P4 Xeon errata 037 workaround. |
@@ -69,7 +69,7 @@ static void __cpuinit Intel_errata_workarounds(struct cpuinfo_x86 *c) | |||
69 | unsigned long lo, hi; | 69 | unsigned long lo, hi; |
70 | 70 | ||
71 | if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) { | 71 | if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) { |
72 | rdmsr (MSR_IA32_MISC_ENABLE, lo, hi); | 72 | rdmsr(MSR_IA32_MISC_ENABLE, lo, hi); |
73 | if ((lo & (1<<9)) == 0) { | 73 | if ((lo & (1<<9)) == 0) { |
74 | printk (KERN_INFO "CPU: C0 stepping P4 Xeon detected.\n"); | 74 | printk (KERN_INFO "CPU: C0 stepping P4 Xeon detected.\n"); |
75 | printk (KERN_INFO "CPU: Disabling hardware prefetching (Errata 037)\n"); | 75 | printk (KERN_INFO "CPU: Disabling hardware prefetching (Errata 037)\n"); |
@@ -127,10 +127,10 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c) | |||
127 | */ | 127 | */ |
128 | c->f00f_bug = 0; | 128 | c->f00f_bug = 0; |
129 | if (!paravirt_enabled() && c->x86 == 5) { | 129 | if (!paravirt_enabled() && c->x86 == 5) { |
130 | static int f00f_workaround_enabled = 0; | 130 | static int f00f_workaround_enabled; |
131 | 131 | ||
132 | c->f00f_bug = 1; | 132 | c->f00f_bug = 1; |
133 | if ( !f00f_workaround_enabled ) { | 133 | if (!f00f_workaround_enabled) { |
134 | trap_init_f00f_bug(); | 134 | trap_init_f00f_bug(); |
135 | printk(KERN_NOTICE "Intel Pentium with F0 0F bug - workaround enabled.\n"); | 135 | printk(KERN_NOTICE "Intel Pentium with F0 0F bug - workaround enabled.\n"); |
136 | f00f_workaround_enabled = 1; | 136 | f00f_workaround_enabled = 1; |
@@ -139,20 +139,22 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c) | |||
139 | #endif | 139 | #endif |
140 | 140 | ||
141 | l2 = init_intel_cacheinfo(c); | 141 | l2 = init_intel_cacheinfo(c); |
142 | if (c->cpuid_level > 9 ) { | 142 | if (c->cpuid_level > 9) { |
143 | unsigned eax = cpuid_eax(10); | 143 | unsigned eax = cpuid_eax(10); |
144 | /* Check for version and the number of counters */ | 144 | /* Check for version and the number of counters */ |
145 | if ((eax & 0xff) && (((eax>>8) & 0xff) > 1)) | 145 | if ((eax & 0xff) && (((eax>>8) & 0xff) > 1)) |
146 | set_bit(X86_FEATURE_ARCH_PERFMON, c->x86_capability); | 146 | set_cpu_cap(c, X86_FEATURE_ARCH_PERFMON); |
147 | } | 147 | } |
148 | 148 | ||
149 | /* SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until model 3 mask 3 */ | 149 | /* SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until model 3 mask 3 */ |
150 | if ((c->x86<<8 | c->x86_model<<4 | c->x86_mask) < 0x633) | 150 | if ((c->x86<<8 | c->x86_model<<4 | c->x86_mask) < 0x633) |
151 | clear_bit(X86_FEATURE_SEP, c->x86_capability); | 151 | clear_cpu_cap(c, X86_FEATURE_SEP); |
152 | 152 | ||
153 | /* Names for the Pentium II/Celeron processors | 153 | /* |
154 | detectable only by also checking the cache size. | 154 | * Names for the Pentium II/Celeron processors |
155 | Dixon is NOT a Celeron. */ | 155 | * detectable only by also checking the cache size. |
156 | * Dixon is NOT a Celeron. | ||
157 | */ | ||
156 | if (c->x86 == 6) { | 158 | if (c->x86 == 6) { |
157 | switch (c->x86_model) { | 159 | switch (c->x86_model) { |
158 | case 5: | 160 | case 5: |
@@ -163,14 +165,14 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c) | |||
163 | p = "Mobile Pentium II (Dixon)"; | 165 | p = "Mobile Pentium II (Dixon)"; |
164 | } | 166 | } |
165 | break; | 167 | break; |
166 | 168 | ||
167 | case 6: | 169 | case 6: |
168 | if (l2 == 128) | 170 | if (l2 == 128) |
169 | p = "Celeron (Mendocino)"; | 171 | p = "Celeron (Mendocino)"; |
170 | else if (c->x86_mask == 0 || c->x86_mask == 5) | 172 | else if (c->x86_mask == 0 || c->x86_mask == 5) |
171 | p = "Celeron-A"; | 173 | p = "Celeron-A"; |
172 | break; | 174 | break; |
173 | 175 | ||
174 | case 8: | 176 | case 8: |
175 | if (l2 == 128) | 177 | if (l2 == 128) |
176 | p = "Celeron (Coppermine)"; | 178 | p = "Celeron (Coppermine)"; |
@@ -178,9 +180,9 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c) | |||
178 | } | 180 | } |
179 | } | 181 | } |
180 | 182 | ||
181 | if ( p ) | 183 | if (p) |
182 | strcpy(c->x86_model_id, p); | 184 | strcpy(c->x86_model_id, p); |
183 | 185 | ||
184 | c->x86_max_cores = num_cpu_cores(c); | 186 | c->x86_max_cores = num_cpu_cores(c); |
185 | 187 | ||
186 | detect_ht(c); | 188 | detect_ht(c); |
@@ -207,28 +209,29 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c) | |||
207 | #endif | 209 | #endif |
208 | 210 | ||
209 | if (cpu_has_xmm2) | 211 | if (cpu_has_xmm2) |
210 | set_bit(X86_FEATURE_LFENCE_RDTSC, c->x86_capability); | 212 | set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC); |
211 | if (c->x86 == 15) { | 213 | if (c->x86 == 15) { |
212 | set_bit(X86_FEATURE_P4, c->x86_capability); | 214 | set_cpu_cap(c, X86_FEATURE_P4); |
213 | } | 215 | } |
214 | if (c->x86 == 6) | 216 | if (c->x86 == 6) |
215 | set_bit(X86_FEATURE_P3, c->x86_capability); | 217 | set_cpu_cap(c, X86_FEATURE_P3); |
216 | if (cpu_has_ds) { | 218 | if (cpu_has_ds) { |
217 | unsigned int l1; | 219 | unsigned int l1; |
218 | rdmsr(MSR_IA32_MISC_ENABLE, l1, l2); | 220 | rdmsr(MSR_IA32_MISC_ENABLE, l1, l2); |
219 | if (!(l1 & (1<<11))) | 221 | if (!(l1 & (1<<11))) |
220 | set_bit(X86_FEATURE_BTS, c->x86_capability); | 222 | set_cpu_cap(c, X86_FEATURE_BTS); |
221 | if (!(l1 & (1<<12))) | 223 | if (!(l1 & (1<<12))) |
222 | set_bit(X86_FEATURE_PEBS, c->x86_capability); | 224 | set_cpu_cap(c, X86_FEATURE_PEBS); |
223 | } | 225 | } |
224 | 226 | ||
225 | if (cpu_has_bts) | 227 | if (cpu_has_bts) |
226 | ds_init_intel(c); | 228 | ds_init_intel(c); |
227 | } | 229 | } |
228 | 230 | ||
229 | static unsigned int __cpuinit intel_size_cache(struct cpuinfo_x86 * c, unsigned int size) | 231 | static unsigned int __cpuinit intel_size_cache(struct cpuinfo_x86 *c, unsigned int size) |
230 | { | 232 | { |
231 | /* Intel PIII Tualatin. This comes in two flavours. | 233 | /* |
234 | * Intel PIII Tualatin. This comes in two flavours. | ||
232 | * One has 256kb of cache, the other 512. We have no way | 235 | * One has 256kb of cache, the other 512. We have no way |
233 | * to determine which, so we use a boottime override | 236 | * to determine which, so we use a boottime override |
234 | * for the 512kb model, and assume 256 otherwise. | 237 | * for the 512kb model, and assume 256 otherwise. |
@@ -240,42 +243,42 @@ static unsigned int __cpuinit intel_size_cache(struct cpuinfo_x86 * c, unsigned | |||
240 | 243 | ||
241 | static struct cpu_dev intel_cpu_dev __cpuinitdata = { | 244 | static struct cpu_dev intel_cpu_dev __cpuinitdata = { |
242 | .c_vendor = "Intel", | 245 | .c_vendor = "Intel", |
243 | .c_ident = { "GenuineIntel" }, | 246 | .c_ident = { "GenuineIntel" }, |
244 | .c_models = { | 247 | .c_models = { |
245 | { .vendor = X86_VENDOR_INTEL, .family = 4, .model_names = | 248 | { .vendor = X86_VENDOR_INTEL, .family = 4, .model_names = |
246 | { | 249 | { |
247 | [0] = "486 DX-25/33", | 250 | [0] = "486 DX-25/33", |
248 | [1] = "486 DX-50", | 251 | [1] = "486 DX-50", |
249 | [2] = "486 SX", | 252 | [2] = "486 SX", |
250 | [3] = "486 DX/2", | 253 | [3] = "486 DX/2", |
251 | [4] = "486 SL", | 254 | [4] = "486 SL", |
252 | [5] = "486 SX/2", | 255 | [5] = "486 SX/2", |
253 | [7] = "486 DX/2-WB", | 256 | [7] = "486 DX/2-WB", |
254 | [8] = "486 DX/4", | 257 | [8] = "486 DX/4", |
255 | [9] = "486 DX/4-WB" | 258 | [9] = "486 DX/4-WB" |
256 | } | 259 | } |
257 | }, | 260 | }, |
258 | { .vendor = X86_VENDOR_INTEL, .family = 5, .model_names = | 261 | { .vendor = X86_VENDOR_INTEL, .family = 5, .model_names = |
259 | { | 262 | { |
260 | [0] = "Pentium 60/66 A-step", | 263 | [0] = "Pentium 60/66 A-step", |
261 | [1] = "Pentium 60/66", | 264 | [1] = "Pentium 60/66", |
262 | [2] = "Pentium 75 - 200", | 265 | [2] = "Pentium 75 - 200", |
263 | [3] = "OverDrive PODP5V83", | 266 | [3] = "OverDrive PODP5V83", |
264 | [4] = "Pentium MMX", | 267 | [4] = "Pentium MMX", |
265 | [7] = "Mobile Pentium 75 - 200", | 268 | [7] = "Mobile Pentium 75 - 200", |
266 | [8] = "Mobile Pentium MMX" | 269 | [8] = "Mobile Pentium MMX" |
267 | } | 270 | } |
268 | }, | 271 | }, |
269 | { .vendor = X86_VENDOR_INTEL, .family = 6, .model_names = | 272 | { .vendor = X86_VENDOR_INTEL, .family = 6, .model_names = |
270 | { | 273 | { |
271 | [0] = "Pentium Pro A-step", | 274 | [0] = "Pentium Pro A-step", |
272 | [1] = "Pentium Pro", | 275 | [1] = "Pentium Pro", |
273 | [3] = "Pentium II (Klamath)", | 276 | [3] = "Pentium II (Klamath)", |
274 | [4] = "Pentium II (Deschutes)", | 277 | [4] = "Pentium II (Deschutes)", |
275 | [5] = "Pentium II (Deschutes)", | 278 | [5] = "Pentium II (Deschutes)", |
276 | [6] = "Mobile Pentium II", | 279 | [6] = "Mobile Pentium II", |
277 | [7] = "Pentium III (Katmai)", | 280 | [7] = "Pentium III (Katmai)", |
278 | [8] = "Pentium III (Coppermine)", | 281 | [8] = "Pentium III (Coppermine)", |
279 | [10] = "Pentium III (Cascades)", | 282 | [10] = "Pentium III (Cascades)", |
280 | [11] = "Pentium III (Tualatin)", | 283 | [11] = "Pentium III (Tualatin)", |
281 | } | 284 | } |
@@ -290,15 +293,12 @@ static struct cpu_dev intel_cpu_dev __cpuinitdata = { | |||
290 | } | 293 | } |
291 | }, | 294 | }, |
292 | }, | 295 | }, |
296 | .c_early_init = early_init_intel, | ||
293 | .c_init = init_intel, | 297 | .c_init = init_intel, |
294 | .c_size_cache = intel_size_cache, | 298 | .c_size_cache = intel_size_cache, |
295 | }; | 299 | }; |
296 | 300 | ||
297 | __init int intel_cpu_init(void) | 301 | cpu_vendor_dev_register(X86_VENDOR_INTEL, &intel_cpu_dev); |
298 | { | ||
299 | cpu_devs[X86_VENDOR_INTEL] = &intel_cpu_dev; | ||
300 | return 0; | ||
301 | } | ||
302 | 302 | ||
303 | #ifndef CONFIG_X86_CMPXCHG | 303 | #ifndef CONFIG_X86_CMPXCHG |
304 | unsigned long cmpxchg_386_u8(volatile void *ptr, u8 old, u8 new) | 304 | unsigned long cmpxchg_386_u8(volatile void *ptr, u8 old, u8 new) |
@@ -364,5 +364,5 @@ unsigned long long cmpxchg_486_u64(volatile void *ptr, u64 old, u64 new) | |||
364 | EXPORT_SYMBOL(cmpxchg_486_u64); | 364 | EXPORT_SYMBOL(cmpxchg_486_u64); |
365 | #endif | 365 | #endif |
366 | 366 | ||
367 | // arch_initcall(intel_cpu_init); | 367 | /* arch_initcall(intel_cpu_init); */ |
368 | 368 | ||