diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-06-07 06:22:15 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-07 06:22:15 -0400 |
commit | 5f4457a4f62cc9d78e04c0eb12ff0540899aad89 (patch) | |
tree | 0b973d527ea6b2ae31e08da0746b4965a3c5a6d8 /arch/x86/kernel/cpu | |
parent | 9b94b3a19b13e094c10f65f24bc358f6ffe4eacd (diff) | |
parent | b87297fb405ef13cac375f202d114323b076a56d (diff) |
Merge branch 'linus' into x86/cpu
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r-- | arch/x86/kernel/cpu/addon_cpuid_features.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 101 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/longhaul.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/p4-clockmod.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k7.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 42 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_64.c | 33 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_intel_64.c | 10 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mtrr/generic.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/proc.c | 2 |
11 files changed, 121 insertions, 87 deletions
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c index 8220ae69849d..c965e5212714 100644 --- a/arch/x86/kernel/cpu/addon_cpuid_features.c +++ b/arch/x86/kernel/cpu/addon_cpuid_features.c | |||
@@ -31,6 +31,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c) | |||
31 | 31 | ||
32 | static const struct cpuid_bit __cpuinitconst cpuid_bits[] = { | 32 | static const struct cpuid_bit __cpuinitconst cpuid_bits[] = { |
33 | { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 }, | 33 | { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 }, |
34 | { X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006 }, | ||
34 | { 0, 0, 0, 0 } | 35 | { 0, 0, 0, 0 } |
35 | }; | 36 | }; |
36 | 37 | ||
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index c4f667896c28..77848d9fca68 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -114,6 +114,13 @@ DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = { | |||
114 | } }; | 114 | } }; |
115 | EXPORT_PER_CPU_SYMBOL_GPL(gdt_page); | 115 | EXPORT_PER_CPU_SYMBOL_GPL(gdt_page); |
116 | 116 | ||
117 | static int __init x86_xsave_setup(char *s) | ||
118 | { | ||
119 | setup_clear_cpu_cap(X86_FEATURE_XSAVE); | ||
120 | return 1; | ||
121 | } | ||
122 | __setup("noxsave", x86_xsave_setup); | ||
123 | |||
117 | #ifdef CONFIG_X86_32 | 124 | #ifdef CONFIG_X86_32 |
118 | static int cachesize_override __cpuinitdata = -1; | 125 | static int cachesize_override __cpuinitdata = -1; |
119 | static int disable_x86_serial_nr __cpuinitdata = 1; | 126 | static int disable_x86_serial_nr __cpuinitdata = 1; |
@@ -1203,6 +1210,8 @@ void __cpuinit cpu_init(void) | |||
1203 | load_TR_desc(); | 1210 | load_TR_desc(); |
1204 | load_LDT(&init_mm.context); | 1211 | load_LDT(&init_mm.context); |
1205 | 1212 | ||
1213 | t->x86_tss.io_bitmap_base = offsetof(struct tss_struct, io_bitmap); | ||
1214 | |||
1206 | #ifdef CONFIG_DOUBLEFAULT | 1215 | #ifdef CONFIG_DOUBLEFAULT |
1207 | /* Set up doublefault TSS pointer in the GDT */ | 1216 | /* Set up doublefault TSS pointer in the GDT */ |
1208 | __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss); | 1217 | __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss); |
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c index 19f6b9d27e83..54b6de2cd947 100644 --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | |||
@@ -65,13 +65,18 @@ enum { | |||
65 | struct acpi_cpufreq_data { | 65 | struct acpi_cpufreq_data { |
66 | struct acpi_processor_performance *acpi_data; | 66 | struct acpi_processor_performance *acpi_data; |
67 | struct cpufreq_frequency_table *freq_table; | 67 | struct cpufreq_frequency_table *freq_table; |
68 | unsigned int max_freq; | ||
69 | unsigned int resume; | 68 | unsigned int resume; |
70 | unsigned int cpu_feature; | 69 | unsigned int cpu_feature; |
71 | }; | 70 | }; |
72 | 71 | ||
73 | static DEFINE_PER_CPU(struct acpi_cpufreq_data *, drv_data); | 72 | static DEFINE_PER_CPU(struct acpi_cpufreq_data *, drv_data); |
74 | 73 | ||
74 | struct acpi_msr_data { | ||
75 | u64 saved_aperf, saved_mperf; | ||
76 | }; | ||
77 | |||
78 | static DEFINE_PER_CPU(struct acpi_msr_data, msr_data); | ||
79 | |||
75 | DEFINE_TRACE(power_mark); | 80 | DEFINE_TRACE(power_mark); |
76 | 81 | ||
77 | /* acpi_perf_data is a pointer to percpu data. */ | 82 | /* acpi_perf_data is a pointer to percpu data. */ |
@@ -152,7 +157,8 @@ struct drv_cmd { | |||
152 | u32 val; | 157 | u32 val; |
153 | }; | 158 | }; |
154 | 159 | ||
155 | static long do_drv_read(void *_cmd) | 160 | /* Called via smp_call_function_single(), on the target CPU */ |
161 | static void do_drv_read(void *_cmd) | ||
156 | { | 162 | { |
157 | struct drv_cmd *cmd = _cmd; | 163 | struct drv_cmd *cmd = _cmd; |
158 | u32 h; | 164 | u32 h; |
@@ -169,10 +175,10 @@ static long do_drv_read(void *_cmd) | |||
169 | default: | 175 | default: |
170 | break; | 176 | break; |
171 | } | 177 | } |
172 | return 0; | ||
173 | } | 178 | } |
174 | 179 | ||
175 | static long do_drv_write(void *_cmd) | 180 | /* Called via smp_call_function_many(), on the target CPUs */ |
181 | static void do_drv_write(void *_cmd) | ||
176 | { | 182 | { |
177 | struct drv_cmd *cmd = _cmd; | 183 | struct drv_cmd *cmd = _cmd; |
178 | u32 lo, hi; | 184 | u32 lo, hi; |
@@ -191,23 +197,24 @@ static long do_drv_write(void *_cmd) | |||
191 | default: | 197 | default: |
192 | break; | 198 | break; |
193 | } | 199 | } |
194 | return 0; | ||
195 | } | 200 | } |
196 | 201 | ||
197 | static void drv_read(struct drv_cmd *cmd) | 202 | static void drv_read(struct drv_cmd *cmd) |
198 | { | 203 | { |
199 | cmd->val = 0; | 204 | cmd->val = 0; |
200 | 205 | ||
201 | work_on_cpu(cpumask_any(cmd->mask), do_drv_read, cmd); | 206 | smp_call_function_single(cpumask_any(cmd->mask), do_drv_read, cmd, 1); |
202 | } | 207 | } |
203 | 208 | ||
204 | static void drv_write(struct drv_cmd *cmd) | 209 | static void drv_write(struct drv_cmd *cmd) |
205 | { | 210 | { |
206 | unsigned int i; | 211 | int this_cpu; |
207 | 212 | ||
208 | for_each_cpu(i, cmd->mask) { | 213 | this_cpu = get_cpu(); |
209 | work_on_cpu(i, do_drv_write, cmd); | 214 | if (cpumask_test_cpu(this_cpu, cmd->mask)) |
210 | } | 215 | do_drv_write(cmd); |
216 | smp_call_function_many(cmd->mask, do_drv_write, cmd, 1); | ||
217 | put_cpu(); | ||
211 | } | 218 | } |
212 | 219 | ||
213 | static u32 get_cur_val(const struct cpumask *mask) | 220 | static u32 get_cur_val(const struct cpumask *mask) |
@@ -241,28 +248,23 @@ static u32 get_cur_val(const struct cpumask *mask) | |||
241 | return cmd.val; | 248 | return cmd.val; |
242 | } | 249 | } |
243 | 250 | ||
244 | struct perf_cur { | 251 | struct perf_pair { |
245 | union { | 252 | union { |
246 | struct { | 253 | struct { |
247 | u32 lo; | 254 | u32 lo; |
248 | u32 hi; | 255 | u32 hi; |
249 | } split; | 256 | } split; |
250 | u64 whole; | 257 | u64 whole; |
251 | } aperf_cur, mperf_cur; | 258 | } aperf, mperf; |
252 | }; | 259 | }; |
253 | 260 | ||
254 | 261 | /* Called via smp_call_function_single(), on the target CPU */ | |
255 | static long read_measured_perf_ctrs(void *_cur) | 262 | static void read_measured_perf_ctrs(void *_cur) |
256 | { | 263 | { |
257 | struct perf_cur *cur = _cur; | 264 | struct perf_pair *cur = _cur; |
258 | |||
259 | rdmsr(MSR_IA32_APERF, cur->aperf_cur.split.lo, cur->aperf_cur.split.hi); | ||
260 | rdmsr(MSR_IA32_MPERF, cur->mperf_cur.split.lo, cur->mperf_cur.split.hi); | ||
261 | 265 | ||
262 | wrmsr(MSR_IA32_APERF, 0, 0); | 266 | rdmsr(MSR_IA32_APERF, cur->aperf.split.lo, cur->aperf.split.hi); |
263 | wrmsr(MSR_IA32_MPERF, 0, 0); | 267 | rdmsr(MSR_IA32_MPERF, cur->mperf.split.lo, cur->mperf.split.hi); |
264 | |||
265 | return 0; | ||
266 | } | 268 | } |
267 | 269 | ||
268 | /* | 270 | /* |
@@ -281,58 +283,63 @@ static long read_measured_perf_ctrs(void *_cur) | |||
281 | static unsigned int get_measured_perf(struct cpufreq_policy *policy, | 283 | static unsigned int get_measured_perf(struct cpufreq_policy *policy, |
282 | unsigned int cpu) | 284 | unsigned int cpu) |
283 | { | 285 | { |
284 | struct perf_cur cur; | 286 | struct perf_pair readin, cur; |
285 | unsigned int perf_percent; | 287 | unsigned int perf_percent; |
286 | unsigned int retval; | 288 | unsigned int retval; |
287 | 289 | ||
288 | if (!work_on_cpu(cpu, read_measured_perf_ctrs, &cur)) | 290 | if (smp_call_function_single(cpu, read_measured_perf_ctrs, &readin, 1)) |
289 | return 0; | 291 | return 0; |
290 | 292 | ||
293 | cur.aperf.whole = readin.aperf.whole - | ||
294 | per_cpu(msr_data, cpu).saved_aperf; | ||
295 | cur.mperf.whole = readin.mperf.whole - | ||
296 | per_cpu(msr_data, cpu).saved_mperf; | ||
297 | per_cpu(msr_data, cpu).saved_aperf = readin.aperf.whole; | ||
298 | per_cpu(msr_data, cpu).saved_mperf = readin.mperf.whole; | ||
299 | |||
291 | #ifdef __i386__ | 300 | #ifdef __i386__ |
292 | /* | 301 | /* |
293 | * We dont want to do 64 bit divide with 32 bit kernel | 302 | * We dont want to do 64 bit divide with 32 bit kernel |
294 | * Get an approximate value. Return failure in case we cannot get | 303 | * Get an approximate value. Return failure in case we cannot get |
295 | * an approximate value. | 304 | * an approximate value. |
296 | */ | 305 | */ |
297 | if (unlikely(cur.aperf_cur.split.hi || cur.mperf_cur.split.hi)) { | 306 | if (unlikely(cur.aperf.split.hi || cur.mperf.split.hi)) { |
298 | int shift_count; | 307 | int shift_count; |
299 | u32 h; | 308 | u32 h; |
300 | 309 | ||
301 | h = max_t(u32, cur.aperf_cur.split.hi, cur.mperf_cur.split.hi); | 310 | h = max_t(u32, cur.aperf.split.hi, cur.mperf.split.hi); |
302 | shift_count = fls(h); | 311 | shift_count = fls(h); |
303 | 312 | ||
304 | cur.aperf_cur.whole >>= shift_count; | 313 | cur.aperf.whole >>= shift_count; |
305 | cur.mperf_cur.whole >>= shift_count; | 314 | cur.mperf.whole >>= shift_count; |
306 | } | 315 | } |
307 | 316 | ||
308 | if (((unsigned long)(-1) / 100) < cur.aperf_cur.split.lo) { | 317 | if (((unsigned long)(-1) / 100) < cur.aperf.split.lo) { |
309 | int shift_count = 7; | 318 | int shift_count = 7; |
310 | cur.aperf_cur.split.lo >>= shift_count; | 319 | cur.aperf.split.lo >>= shift_count; |
311 | cur.mperf_cur.split.lo >>= shift_count; | 320 | cur.mperf.split.lo >>= shift_count; |
312 | } | 321 | } |
313 | 322 | ||
314 | if (cur.aperf_cur.split.lo && cur.mperf_cur.split.lo) | 323 | if (cur.aperf.split.lo && cur.mperf.split.lo) |
315 | perf_percent = (cur.aperf_cur.split.lo * 100) / | 324 | perf_percent = (cur.aperf.split.lo * 100) / cur.mperf.split.lo; |
316 | cur.mperf_cur.split.lo; | ||
317 | else | 325 | else |
318 | perf_percent = 0; | 326 | perf_percent = 0; |
319 | 327 | ||
320 | #else | 328 | #else |
321 | if (unlikely(((unsigned long)(-1) / 100) < cur.aperf_cur.whole)) { | 329 | if (unlikely(((unsigned long)(-1) / 100) < cur.aperf.whole)) { |
322 | int shift_count = 7; | 330 | int shift_count = 7; |
323 | cur.aperf_cur.whole >>= shift_count; | 331 | cur.aperf.whole >>= shift_count; |
324 | cur.mperf_cur.whole >>= shift_count; | 332 | cur.mperf.whole >>= shift_count; |
325 | } | 333 | } |
326 | 334 | ||
327 | if (cur.aperf_cur.whole && cur.mperf_cur.whole) | 335 | if (cur.aperf.whole && cur.mperf.whole) |
328 | perf_percent = (cur.aperf_cur.whole * 100) / | 336 | perf_percent = (cur.aperf.whole * 100) / cur.mperf.whole; |
329 | cur.mperf_cur.whole; | ||
330 | else | 337 | else |
331 | perf_percent = 0; | 338 | perf_percent = 0; |
332 | 339 | ||
333 | #endif | 340 | #endif |
334 | 341 | ||
335 | retval = per_cpu(drv_data, policy->cpu)->max_freq * perf_percent / 100; | 342 | retval = (policy->cpuinfo.max_freq * perf_percent) / 100; |
336 | 343 | ||
337 | return retval; | 344 | return retval; |
338 | } | 345 | } |
@@ -685,16 +692,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
685 | /* Check for high latency (>20uS) from buggy BIOSes, like on T42 */ | 692 | /* Check for high latency (>20uS) from buggy BIOSes, like on T42 */ |
686 | if (perf->control_register.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE && | 693 | if (perf->control_register.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE && |
687 | policy->cpuinfo.transition_latency > 20 * 1000) { | 694 | policy->cpuinfo.transition_latency > 20 * 1000) { |
688 | static int print_once; | ||
689 | policy->cpuinfo.transition_latency = 20 * 1000; | 695 | policy->cpuinfo.transition_latency = 20 * 1000; |
690 | if (!print_once) { | 696 | printk_once(KERN_INFO |
691 | print_once = 1; | 697 | "P-state transition latency capped at 20 uS\n"); |
692 | printk(KERN_INFO "Capping off P-state tranision latency" | ||
693 | " at 20 uS\n"); | ||
694 | } | ||
695 | } | 698 | } |
696 | 699 | ||
697 | data->max_freq = perf->states[0].core_frequency * 1000; | ||
698 | /* table init */ | 700 | /* table init */ |
699 | for (i = 0; i < perf->state_count; i++) { | 701 | for (i = 0; i < perf->state_count; i++) { |
700 | if (i > 0 && perf->states[i].core_frequency >= | 702 | if (i > 0 && perf->states[i].core_frequency >= |
@@ -713,6 +715,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
713 | if (result) | 715 | if (result) |
714 | goto err_freqfree; | 716 | goto err_freqfree; |
715 | 717 | ||
718 | if (perf->states[0].core_frequency * 1000 != policy->cpuinfo.max_freq) | ||
719 | printk(KERN_WARNING FW_WARN "P-state 0 is not max freq\n"); | ||
720 | |||
716 | switch (perf->control_register.space_id) { | 721 | switch (perf->control_register.space_id) { |
717 | case ACPI_ADR_SPACE_SYSTEM_IO: | 722 | case ACPI_ADR_SPACE_SYSTEM_IO: |
718 | /* Current speed is unknown and not detectable by IO port */ | 723 | /* Current speed is unknown and not detectable by IO port */ |
diff --git a/arch/x86/kernel/cpu/cpufreq/longhaul.c b/arch/x86/kernel/cpu/cpufreq/longhaul.c index 0bd48e65a0ca..ce2ed3e4aad9 100644 --- a/arch/x86/kernel/cpu/cpufreq/longhaul.c +++ b/arch/x86/kernel/cpu/cpufreq/longhaul.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/timex.h> | 33 | #include <linux/timex.h> |
34 | #include <linux/io.h> | 34 | #include <linux/io.h> |
35 | #include <linux/acpi.h> | 35 | #include <linux/acpi.h> |
36 | #include <linux/kernel.h> | ||
37 | 36 | ||
38 | #include <asm/msr.h> | 37 | #include <asm/msr.h> |
39 | #include <acpi/processor.h> | 38 | #include <acpi/processor.h> |
diff --git a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c index 6ac55bd341ae..869615193720 100644 --- a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c +++ b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c | |||
@@ -168,6 +168,7 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c) | |||
168 | case 0x0E: /* Core */ | 168 | case 0x0E: /* Core */ |
169 | case 0x0F: /* Core Duo */ | 169 | case 0x0F: /* Core Duo */ |
170 | case 0x16: /* Celeron Core */ | 170 | case 0x16: /* Celeron Core */ |
171 | case 0x1C: /* Atom */ | ||
171 | p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; | 172 | p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; |
172 | return speedstep_get_frequency(SPEEDSTEP_CPU_PCORE); | 173 | return speedstep_get_frequency(SPEEDSTEP_CPU_PCORE); |
173 | case 0x0D: /* Pentium M (Dothan) */ | 174 | case 0x0D: /* Pentium M (Dothan) */ |
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c index 3c28ccd49742..a8363e5be4ef 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c | |||
@@ -168,10 +168,12 @@ static int check_powernow(void) | |||
168 | return 1; | 168 | return 1; |
169 | } | 169 | } |
170 | 170 | ||
171 | #ifdef CONFIG_X86_POWERNOW_K7_ACPI | ||
171 | static void invalidate_entry(unsigned int entry) | 172 | static void invalidate_entry(unsigned int entry) |
172 | { | 173 | { |
173 | powernow_table[entry].frequency = CPUFREQ_ENTRY_INVALID; | 174 | powernow_table[entry].frequency = CPUFREQ_ENTRY_INVALID; |
174 | } | 175 | } |
176 | #endif | ||
175 | 177 | ||
176 | static int get_ranges(unsigned char *pst) | 178 | static int get_ranges(unsigned char *pst) |
177 | { | 179 | { |
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 4709ead2db52..f6b32d112357 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -649,6 +649,20 @@ static void print_basics(struct powernow_k8_data *data) | |||
649 | data->batps); | 649 | data->batps); |
650 | } | 650 | } |
651 | 651 | ||
652 | static u32 freq_from_fid_did(u32 fid, u32 did) | ||
653 | { | ||
654 | u32 mhz = 0; | ||
655 | |||
656 | if (boot_cpu_data.x86 == 0x10) | ||
657 | mhz = (100 * (fid + 0x10)) >> did; | ||
658 | else if (boot_cpu_data.x86 == 0x11) | ||
659 | mhz = (100 * (fid + 8)) >> did; | ||
660 | else | ||
661 | BUG(); | ||
662 | |||
663 | return mhz * 1000; | ||
664 | } | ||
665 | |||
652 | static int fill_powernow_table(struct powernow_k8_data *data, | 666 | static int fill_powernow_table(struct powernow_k8_data *data, |
653 | struct pst_s *pst, u8 maxvid) | 667 | struct pst_s *pst, u8 maxvid) |
654 | { | 668 | { |
@@ -923,8 +937,13 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data, | |||
923 | 937 | ||
924 | powernow_table[i].index = index; | 938 | powernow_table[i].index = index; |
925 | 939 | ||
926 | powernow_table[i].frequency = | 940 | /* Frequency may be rounded for these */ |
927 | data->acpi_data.states[i].core_frequency * 1000; | 941 | if (boot_cpu_data.x86 == 0x10 || boot_cpu_data.x86 == 0x11) { |
942 | powernow_table[i].frequency = | ||
943 | freq_from_fid_did(lo & 0x3f, (lo >> 6) & 7); | ||
944 | } else | ||
945 | powernow_table[i].frequency = | ||
946 | data->acpi_data.states[i].core_frequency * 1000; | ||
928 | } | 947 | } |
929 | return 0; | 948 | return 0; |
930 | } | 949 | } |
@@ -1215,13 +1234,16 @@ static int powernowk8_verify(struct cpufreq_policy *pol) | |||
1215 | return cpufreq_frequency_table_verify(pol, data->powernow_table); | 1234 | return cpufreq_frequency_table_verify(pol, data->powernow_table); |
1216 | } | 1235 | } |
1217 | 1236 | ||
1237 | static const char ACPI_PSS_BIOS_BUG_MSG[] = | ||
1238 | KERN_ERR FW_BUG PFX "No compatible ACPI _PSS objects found.\n" | ||
1239 | KERN_ERR FW_BUG PFX "Try again with latest BIOS.\n"; | ||
1240 | |||
1218 | /* per CPU init entry point to the driver */ | 1241 | /* per CPU init entry point to the driver */ |
1219 | static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | 1242 | static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) |
1220 | { | 1243 | { |
1221 | struct powernow_k8_data *data; | 1244 | struct powernow_k8_data *data; |
1222 | cpumask_t oldmask; | 1245 | cpumask_t oldmask; |
1223 | int rc; | 1246 | int rc; |
1224 | static int print_once; | ||
1225 | 1247 | ||
1226 | if (!cpu_online(pol->cpu)) | 1248 | if (!cpu_online(pol->cpu)) |
1227 | return -ENODEV; | 1249 | return -ENODEV; |
@@ -1244,19 +1266,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1244 | * an UP version, and is deprecated by AMD. | 1266 | * an UP version, and is deprecated by AMD. |
1245 | */ | 1267 | */ |
1246 | if (num_online_cpus() != 1) { | 1268 | if (num_online_cpus() != 1) { |
1247 | /* | 1269 | printk_once(ACPI_PSS_BIOS_BUG_MSG); |
1248 | * Replace this one with print_once as soon as such a | ||
1249 | * thing gets introduced | ||
1250 | */ | ||
1251 | if (!print_once) { | ||
1252 | WARN_ONCE(1, KERN_ERR FW_BUG PFX "Your BIOS " | ||
1253 | "does not provide ACPI _PSS objects " | ||
1254 | "in a way that Linux understands. " | ||
1255 | "Please report this to the Linux ACPI" | ||
1256 | " maintainers and complain to your " | ||
1257 | "BIOS vendor.\n"); | ||
1258 | print_once++; | ||
1259 | } | ||
1260 | goto err_out; | 1270 | goto err_out; |
1261 | } | 1271 | } |
1262 | if (pol->cpu != 0) { | 1272 | if (pol->cpu != 0) { |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_64.c b/arch/x86/kernel/cpu/mcheck/mce_64.c index 863f89568b1a..6fb0b359d2a5 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_64.c | |||
@@ -239,9 +239,10 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b) | |||
239 | * Don't get the IP here because it's unlikely to | 239 | * Don't get the IP here because it's unlikely to |
240 | * have anything to do with the actual error location. | 240 | * have anything to do with the actual error location. |
241 | */ | 241 | */ |
242 | 242 | if (!(flags & MCP_DONTLOG)) { | |
243 | mce_log(&m); | 243 | mce_log(&m); |
244 | add_taint(TAINT_MACHINE_CHECK); | 244 | add_taint(TAINT_MACHINE_CHECK); |
245 | } | ||
245 | 246 | ||
246 | /* | 247 | /* |
247 | * Clear state for this bank. | 248 | * Clear state for this bank. |
@@ -452,13 +453,14 @@ void mce_log_therm_throt_event(__u64 status) | |||
452 | */ | 453 | */ |
453 | 454 | ||
454 | static int check_interval = 5 * 60; /* 5 minutes */ | 455 | static int check_interval = 5 * 60; /* 5 minutes */ |
455 | static int next_interval; /* in jiffies */ | 456 | static DEFINE_PER_CPU(int, next_interval); /* in jiffies */ |
456 | static void mcheck_timer(unsigned long); | 457 | static void mcheck_timer(unsigned long); |
457 | static DEFINE_PER_CPU(struct timer_list, mce_timer); | 458 | static DEFINE_PER_CPU(struct timer_list, mce_timer); |
458 | 459 | ||
459 | static void mcheck_timer(unsigned long data) | 460 | static void mcheck_timer(unsigned long data) |
460 | { | 461 | { |
461 | struct timer_list *t = &per_cpu(mce_timer, data); | 462 | struct timer_list *t = &per_cpu(mce_timer, data); |
463 | int *n; | ||
462 | 464 | ||
463 | WARN_ON(smp_processor_id() != data); | 465 | WARN_ON(smp_processor_id() != data); |
464 | 466 | ||
@@ -470,14 +472,14 @@ static void mcheck_timer(unsigned long data) | |||
470 | * Alert userspace if needed. If we logged an MCE, reduce the | 472 | * Alert userspace if needed. If we logged an MCE, reduce the |
471 | * polling interval, otherwise increase the polling interval. | 473 | * polling interval, otherwise increase the polling interval. |
472 | */ | 474 | */ |
475 | n = &__get_cpu_var(next_interval); | ||
473 | if (mce_notify_user()) { | 476 | if (mce_notify_user()) { |
474 | next_interval = max(next_interval/2, HZ/100); | 477 | *n = max(*n/2, HZ/100); |
475 | } else { | 478 | } else { |
476 | next_interval = min(next_interval * 2, | 479 | *n = min(*n*2, (int)round_jiffies_relative(check_interval*HZ)); |
477 | (int)round_jiffies_relative(check_interval*HZ)); | ||
478 | } | 480 | } |
479 | 481 | ||
480 | t->expires = jiffies + next_interval; | 482 | t->expires = jiffies + *n; |
481 | add_timer(t); | 483 | add_timer(t); |
482 | } | 484 | } |
483 | 485 | ||
@@ -584,7 +586,7 @@ static void mce_init(void *dummy) | |||
584 | * Log the machine checks left over from the previous reset. | 586 | * Log the machine checks left over from the previous reset. |
585 | */ | 587 | */ |
586 | bitmap_fill(all_banks, MAX_NR_BANKS); | 588 | bitmap_fill(all_banks, MAX_NR_BANKS); |
587 | machine_check_poll(MCP_UC, &all_banks); | 589 | machine_check_poll(MCP_UC|(!mce_bootlog ? MCP_DONTLOG : 0), &all_banks); |
588 | 590 | ||
589 | set_in_cr4(X86_CR4_MCE); | 591 | set_in_cr4(X86_CR4_MCE); |
590 | 592 | ||
@@ -632,14 +634,13 @@ static void mce_cpu_features(struct cpuinfo_x86 *c) | |||
632 | static void mce_init_timer(void) | 634 | static void mce_init_timer(void) |
633 | { | 635 | { |
634 | struct timer_list *t = &__get_cpu_var(mce_timer); | 636 | struct timer_list *t = &__get_cpu_var(mce_timer); |
637 | int *n = &__get_cpu_var(next_interval); | ||
635 | 638 | ||
636 | /* data race harmless because everyone sets to the same value */ | 639 | *n = check_interval * HZ; |
637 | if (!next_interval) | 640 | if (!*n) |
638 | next_interval = check_interval * HZ; | ||
639 | if (!next_interval) | ||
640 | return; | 641 | return; |
641 | setup_timer(t, mcheck_timer, smp_processor_id()); | 642 | setup_timer(t, mcheck_timer, smp_processor_id()); |
642 | t->expires = round_jiffies(jiffies + next_interval); | 643 | t->expires = round_jiffies(jiffies + *n); |
643 | add_timer(t); | 644 | add_timer(t); |
644 | } | 645 | } |
645 | 646 | ||
@@ -907,7 +908,6 @@ static void mce_cpu_restart(void *data) | |||
907 | /* Reinit MCEs after user configuration changes */ | 908 | /* Reinit MCEs after user configuration changes */ |
908 | static void mce_restart(void) | 909 | static void mce_restart(void) |
909 | { | 910 | { |
910 | next_interval = check_interval * HZ; | ||
911 | on_each_cpu(mce_cpu_restart, NULL, 1); | 911 | on_each_cpu(mce_cpu_restart, NULL, 1); |
912 | } | 912 | } |
913 | 913 | ||
@@ -1110,7 +1110,8 @@ static int __cpuinit mce_cpu_callback(struct notifier_block *nfb, | |||
1110 | break; | 1110 | break; |
1111 | case CPU_DOWN_FAILED: | 1111 | case CPU_DOWN_FAILED: |
1112 | case CPU_DOWN_FAILED_FROZEN: | 1112 | case CPU_DOWN_FAILED_FROZEN: |
1113 | t->expires = round_jiffies(jiffies + next_interval); | 1113 | t->expires = round_jiffies(jiffies + |
1114 | __get_cpu_var(next_interval)); | ||
1114 | add_timer_on(t, cpu); | 1115 | add_timer_on(t, cpu); |
1115 | smp_call_function_single(cpu, mce_reenable_cpu, &action, 1); | 1116 | smp_call_function_single(cpu, mce_reenable_cpu, &action, 1); |
1116 | break; | 1117 | break; |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c index d6b72df89d69..cef3ee30744b 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c | |||
@@ -151,10 +151,11 @@ static void print_update(char *type, int *hdr, int num) | |||
151 | static void cmci_discover(int banks, int boot) | 151 | static void cmci_discover(int banks, int boot) |
152 | { | 152 | { |
153 | unsigned long *owned = (void *)&__get_cpu_var(mce_banks_owned); | 153 | unsigned long *owned = (void *)&__get_cpu_var(mce_banks_owned); |
154 | unsigned long flags; | ||
154 | int hdr = 0; | 155 | int hdr = 0; |
155 | int i; | 156 | int i; |
156 | 157 | ||
157 | spin_lock(&cmci_discover_lock); | 158 | spin_lock_irqsave(&cmci_discover_lock, flags); |
158 | for (i = 0; i < banks; i++) { | 159 | for (i = 0; i < banks; i++) { |
159 | u64 val; | 160 | u64 val; |
160 | 161 | ||
@@ -184,7 +185,7 @@ static void cmci_discover(int banks, int boot) | |||
184 | WARN_ON(!test_bit(i, __get_cpu_var(mce_poll_banks))); | 185 | WARN_ON(!test_bit(i, __get_cpu_var(mce_poll_banks))); |
185 | } | 186 | } |
186 | } | 187 | } |
187 | spin_unlock(&cmci_discover_lock); | 188 | spin_unlock_irqrestore(&cmci_discover_lock, flags); |
188 | if (hdr) | 189 | if (hdr) |
189 | printk(KERN_CONT "\n"); | 190 | printk(KERN_CONT "\n"); |
190 | } | 191 | } |
@@ -211,13 +212,14 @@ void cmci_recheck(void) | |||
211 | */ | 212 | */ |
212 | void cmci_clear(void) | 213 | void cmci_clear(void) |
213 | { | 214 | { |
215 | unsigned long flags; | ||
214 | int i; | 216 | int i; |
215 | int banks; | 217 | int banks; |
216 | u64 val; | 218 | u64 val; |
217 | 219 | ||
218 | if (!cmci_supported(&banks)) | 220 | if (!cmci_supported(&banks)) |
219 | return; | 221 | return; |
220 | spin_lock(&cmci_discover_lock); | 222 | spin_lock_irqsave(&cmci_discover_lock, flags); |
221 | for (i = 0; i < banks; i++) { | 223 | for (i = 0; i < banks; i++) { |
222 | if (!test_bit(i, __get_cpu_var(mce_banks_owned))) | 224 | if (!test_bit(i, __get_cpu_var(mce_banks_owned))) |
223 | continue; | 225 | continue; |
@@ -227,7 +229,7 @@ void cmci_clear(void) | |||
227 | wrmsrl(MSR_IA32_MC0_CTL2 + i, val); | 229 | wrmsrl(MSR_IA32_MC0_CTL2 + i, val); |
228 | __clear_bit(i, __get_cpu_var(mce_banks_owned)); | 230 | __clear_bit(i, __get_cpu_var(mce_banks_owned)); |
229 | } | 231 | } |
230 | spin_unlock(&cmci_discover_lock); | 232 | spin_unlock_irqrestore(&cmci_discover_lock, flags); |
231 | } | 233 | } |
232 | 234 | ||
233 | /* | 235 | /* |
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c index 0b776c09aff3..d21d4fb161f7 100644 --- a/arch/x86/kernel/cpu/mtrr/generic.c +++ b/arch/x86/kernel/cpu/mtrr/generic.c | |||
@@ -275,7 +275,11 @@ static void __init print_mtrr_state(void) | |||
275 | } | 275 | } |
276 | printk(KERN_DEBUG "MTRR variable ranges %sabled:\n", | 276 | printk(KERN_DEBUG "MTRR variable ranges %sabled:\n", |
277 | mtrr_state.enabled & 2 ? "en" : "dis"); | 277 | mtrr_state.enabled & 2 ? "en" : "dis"); |
278 | high_width = ((size_or_mask ? ffs(size_or_mask) - 1 : 32) - (32 - PAGE_SHIFT) + 3) / 4; | 278 | if (size_or_mask & 0xffffffffUL) |
279 | high_width = ffs(size_or_mask & 0xffffffffUL) - 1; | ||
280 | else | ||
281 | high_width = ffs(size_or_mask>>32) + 32 - 1; | ||
282 | high_width = (high_width - (32 - PAGE_SHIFT) + 3) / 4; | ||
279 | for (i = 0; i < num_var_ranges; ++i) { | 283 | for (i = 0; i < num_var_ranges; ++i) { |
280 | if (mtrr_state.var_ranges[i].mask_lo & (1 << 11)) | 284 | if (mtrr_state.var_ranges[i].mask_lo & (1 << 11)) |
281 | printk(KERN_DEBUG " %u base %0*X%05X000 mask %0*X%05X000 %s\n", | 285 | printk(KERN_DEBUG " %u base %0*X%05X000 mask %0*X%05X000 %s\n", |
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c index f93047fed791..d5e30397246b 100644 --- a/arch/x86/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c | |||
@@ -14,7 +14,7 @@ static void show_cpuinfo_core(struct seq_file *m, struct cpuinfo_x86 *c, | |||
14 | if (c->x86_max_cores * smp_num_siblings > 1) { | 14 | if (c->x86_max_cores * smp_num_siblings > 1) { |
15 | seq_printf(m, "physical id\t: %d\n", c->phys_proc_id); | 15 | seq_printf(m, "physical id\t: %d\n", c->phys_proc_id); |
16 | seq_printf(m, "siblings\t: %d\n", | 16 | seq_printf(m, "siblings\t: %d\n", |
17 | cpumask_weight(cpu_sibling_mask(cpu))); | 17 | cpumask_weight(cpu_core_mask(cpu))); |
18 | seq_printf(m, "core id\t\t: %d\n", c->cpu_core_id); | 18 | seq_printf(m, "core id\t\t: %d\n", c->cpu_core_id); |
19 | seq_printf(m, "cpu cores\t: %d\n", c->booted_cores); | 19 | seq_printf(m, "cpu cores\t: %d\n", c->booted_cores); |
20 | seq_printf(m, "apicid\t\t: %d\n", c->apicid); | 20 | seq_printf(m, "apicid\t\t: %d\n", c->apicid); |