aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/microcode_amd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 8fdf7d99b804..25d34b177482 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -82,6 +82,7 @@ static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig)
82{ 82{
83 struct cpuinfo_x86 *c = &cpu_data(cpu); 83 struct cpuinfo_x86 *c = &cpu_data(cpu);
84 84
85 csig->sig = cpuid_eax(0x00000001);
85 csig->rev = c->microcode; 86 csig->rev = c->microcode;
86 pr_info("CPU%d: patch_level=0x%08x\n", cpu, csig->rev); 87 pr_info("CPU%d: patch_level=0x%08x\n", cpu, csig->rev);
87 88
@@ -118,16 +119,15 @@ static unsigned int verify_ucode_size(int cpu, u32 patch_size,
118 return patch_size; 119 return patch_size;
119} 120}
120 121
121static u16 find_equiv_id(void) 122static u16 find_equiv_id(unsigned int cpu)
122{ 123{
123 unsigned int current_cpu_id, i = 0; 124 struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
125 int i = 0;
124 126
125 BUG_ON(equiv_cpu_table == NULL); 127 BUG_ON(equiv_cpu_table == NULL);
126 128
127 current_cpu_id = cpuid_eax(0x00000001);
128
129 while (equiv_cpu_table[i].installed_cpu != 0) { 129 while (equiv_cpu_table[i].installed_cpu != 0) {
130 if (current_cpu_id == equiv_cpu_table[i].installed_cpu) 130 if (uci->cpu_sig.sig == equiv_cpu_table[i].installed_cpu)
131 return equiv_cpu_table[i].equiv_cpu; 131 return equiv_cpu_table[i].equiv_cpu;
132 132
133 i++; 133 i++;
@@ -150,7 +150,7 @@ static int get_matching_microcode(int cpu, const u8 *ucode_ptr,
150 patch_size = *(u32 *)(ucode_ptr + 4); 150 patch_size = *(u32 *)(ucode_ptr + 4);
151 *current_size = patch_size + SECTION_HDR_SIZE; 151 *current_size = patch_size + SECTION_HDR_SIZE;
152 152
153 equiv_cpu_id = find_equiv_id(); 153 equiv_cpu_id = find_equiv_id(cpu);
154 if (!equiv_cpu_id) 154 if (!equiv_cpu_id)
155 return 0; 155 return 0;
156 156