diff options
-rw-r--r-- | arch/x86/kernel/cpu/amd.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/microcode_amd.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index b13ed393dfce..d898fab0e125 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
@@ -412,6 +412,8 @@ static void __cpuinit early_init_amd_mc(struct cpuinfo_x86 *c) | |||
412 | 412 | ||
413 | static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) | 413 | static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) |
414 | { | 414 | { |
415 | u32 dummy; | ||
416 | |||
415 | early_init_amd_mc(c); | 417 | early_init_amd_mc(c); |
416 | 418 | ||
417 | /* | 419 | /* |
@@ -442,6 +444,8 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) | |||
442 | } | 444 | } |
443 | #endif | 445 | #endif |
444 | 446 | ||
447 | rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy); | ||
448 | |||
445 | /* We need to do the following only once */ | 449 | /* We need to do the following only once */ |
446 | if (c != &boot_cpu_data) | 450 | if (c != &boot_cpu_data) |
447 | return; | 451 | return; |
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c index 591be0ee1934..d494799aafcd 100644 --- a/arch/x86/kernel/microcode_amd.c +++ b/arch/x86/kernel/microcode_amd.c | |||
@@ -74,14 +74,13 @@ static struct equiv_cpu_entry *equiv_cpu_table; | |||
74 | static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig) | 74 | static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig) |
75 | { | 75 | { |
76 | struct cpuinfo_x86 *c = &cpu_data(cpu); | 76 | struct cpuinfo_x86 *c = &cpu_data(cpu); |
77 | u32 dummy; | ||
78 | 77 | ||
79 | if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) { | 78 | if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) { |
80 | pr_warning("CPU%d: family %d not supported\n", cpu, c->x86); | 79 | pr_warning("CPU%d: family %d not supported\n", cpu, c->x86); |
81 | return -1; | 80 | return -1; |
82 | } | 81 | } |
83 | 82 | ||
84 | rdmsr(MSR_AMD64_PATCH_LEVEL, csig->rev, dummy); | 83 | csig->rev = c->microcode; |
85 | pr_info("CPU%d: patch_level=0x%08x\n", cpu, csig->rev); | 84 | pr_info("CPU%d: patch_level=0x%08x\n", cpu, csig->rev); |
86 | 85 | ||
87 | return 0; | 86 | return 0; |
@@ -130,6 +129,7 @@ static int apply_microcode_amd(int cpu) | |||
130 | int cpu_num = raw_smp_processor_id(); | 129 | int cpu_num = raw_smp_processor_id(); |
131 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num; | 130 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num; |
132 | struct microcode_amd *mc_amd = uci->mc; | 131 | struct microcode_amd *mc_amd = uci->mc; |
132 | struct cpuinfo_x86 *c = &cpu_data(cpu); | ||
133 | 133 | ||
134 | /* We should bind the task to the CPU */ | 134 | /* We should bind the task to the CPU */ |
135 | BUG_ON(cpu_num != cpu); | 135 | BUG_ON(cpu_num != cpu); |
@@ -150,6 +150,7 @@ static int apply_microcode_amd(int cpu) | |||
150 | 150 | ||
151 | pr_info("CPU%d: new patch_level=0x%08x\n", cpu, rev); | 151 | pr_info("CPU%d: new patch_level=0x%08x\n", cpu, rev); |
152 | uci->cpu_sig.rev = rev; | 152 | uci->cpu_sig.rev = rev; |
153 | c->microcode = rev; | ||
153 | 154 | ||
154 | return 0; | 155 | return 0; |
155 | } | 156 | } |