aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-10-28 08:14:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-28 08:14:48 -0400
commit8237eb946a1a23c600fb289cf8dd3b399b10604e (patch)
treee3985782029601ede4035cfec7ee59e1a54324fd /arch/x86/kernel/cpu
parentcc21fe518a971bb2b0ab8370ec46ea21e84c57ab (diff)
parentbcb80e53877c2045d9e52f4a71372c3fe6501f6f (diff)
Merge branch 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86, microcode, AMD: Add microcode revision to /proc/cpuinfo x86, microcode: Correct microcode revision format coretemp: Get microcode revision from cpu_data x86, intel: Use c->microcode for Atom errata check x86, intel: Output microcode revision in /proc/cpuinfo x86, microcode: Don't request microcode from userspace unnecessarily Fix up trivial conflicts in arch/x86/kernel/cpu/amd.c (conflict between moving AMD BSP code to cpu_dev helper function and adding AMD microcode revision to /proc/cpuinfo code)
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r--arch/x86/kernel/cpu/amd.c4
-rw-r--r--arch/x86/kernel/cpu/intel.c24
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c9
-rw-r--r--arch/x86/kernel/cpu/proc.c2
4 files changed, 26 insertions, 13 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 13c6ec812545..46ae4f65fc7f 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -441,6 +441,8 @@ static void __cpuinit bsp_init_amd(struct cpuinfo_x86 *c)
441 441
442static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) 442static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
443{ 443{
444 u32 dummy;
445
444 early_init_amd_mc(c); 446 early_init_amd_mc(c);
445 447
446 /* 448 /*
@@ -470,6 +472,8 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
470 set_cpu_cap(c, X86_FEATURE_EXTD_APICID); 472 set_cpu_cap(c, X86_FEATURE_EXTD_APICID);
471 } 473 }
472#endif 474#endif
475
476 rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy);
473} 477}
474 478
475static void __cpuinit init_amd(struct cpuinfo_x86 *c) 479static void __cpuinit init_amd(struct cpuinfo_x86 *c)
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index ed6086eedf1d..523131213f08 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -47,6 +47,15 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
47 (c->x86 == 0x6 && c->x86_model >= 0x0e)) 47 (c->x86 == 0x6 && c->x86_model >= 0x0e))
48 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); 48 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
49 49
50 if (c->x86 >= 6 && !cpu_has(c, X86_FEATURE_IA64)) {
51 unsigned lower_word;
52
53 wrmsr(MSR_IA32_UCODE_REV, 0, 0);
54 /* Required by the SDM */
55 sync_core();
56 rdmsr(MSR_IA32_UCODE_REV, lower_word, c->microcode);
57 }
58
50 /* 59 /*
51 * Atom erratum AAE44/AAF40/AAG38/AAH41: 60 * Atom erratum AAE44/AAF40/AAG38/AAH41:
52 * 61 *
@@ -55,17 +64,10 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
55 * need the microcode to have already been loaded... so if it is 64 * need the microcode to have already been loaded... so if it is
56 * not, recommend a BIOS update and disable large pages. 65 * not, recommend a BIOS update and disable large pages.
57 */ 66 */
58 if (c->x86 == 6 && c->x86_model == 0x1c && c->x86_mask <= 2) { 67 if (c->x86 == 6 && c->x86_model == 0x1c && c->x86_mask <= 2 &&
59 u32 ucode, junk; 68 c->microcode < 0x20e) {
60 69 printk(KERN_WARNING "Atom PSE erratum detected, BIOS microcode update recommended\n");
61 wrmsr(MSR_IA32_UCODE_REV, 0, 0); 70 clear_cpu_cap(c, X86_FEATURE_PSE);
62 sync_core();
63 rdmsr(MSR_IA32_UCODE_REV, junk, ucode);
64
65 if (ucode < 0x20e) {
66 printk(KERN_WARNING "Atom PSE erratum detected, BIOS microcode update recommended\n");
67 clear_cpu_cap(c, X86_FEATURE_PSE);
68 }
69 } 71 }
70 72
71#ifdef CONFIG_X86_64 73#ifdef CONFIG_X86_64
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index fce51ad1f362..7b5063a6ad42 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -217,8 +217,13 @@ static void print_mce(struct mce *m)
217 pr_cont("MISC %llx ", m->misc); 217 pr_cont("MISC %llx ", m->misc);
218 218
219 pr_cont("\n"); 219 pr_cont("\n");
220 pr_emerg(HW_ERR "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x\n", 220 /*
221 m->cpuvendor, m->cpuid, m->time, m->socketid, m->apicid); 221 * Note this output is parsed by external tools and old fields
222 * should not be changed.
223 */
224 pr_emerg(HW_ERR "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x microcode %x\n",
225 m->cpuvendor, m->cpuid, m->time, m->socketid, m->apicid,
226 cpu_data(m->extcpu).microcode);
222 227
223 /* 228 /*
224 * Print out human-readable details about the MCE error, 229 * Print out human-readable details about the MCE error,
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 62ac8cb6ba27..14b23140e81f 100644
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
@@ -85,6 +85,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
85 seq_printf(m, "stepping\t: %d\n", c->x86_mask); 85 seq_printf(m, "stepping\t: %d\n", c->x86_mask);
86 else 86 else
87 seq_printf(m, "stepping\t: unknown\n"); 87 seq_printf(m, "stepping\t: unknown\n");
88 if (c->microcode)
89 seq_printf(m, "microcode\t: 0x%x\n", c->microcode);
88 90
89 if (cpu_has(c, X86_FEATURE_TSC)) { 91 if (cpu_has(c, X86_FEATURE_TSC)) {
90 unsigned int freq = cpufreq_quick_get(cpu); 92 unsigned int freq = cpufreq_quick_get(cpu);