Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324039
b: refs/heads/master
c: 5f5b747
h: refs/heads/master
i:
  324037: 893e0f2
  324035: b936403
  324031: 5c85cd9
v: v3
  • Loading branch information
Borislav Petkov authored and H. Peter Anvin committed Aug 22, 2012
1 parent 95c74f8 commit 2cc48f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 685ca6d797af9d41164dd64dd60145d4946fc152
refs/heads/master: 5f5b747282c6cc57b91baba37f76de27398b9e60
12 changes: 6 additions & 6 deletions trunk/arch/x86/kernel/microcode_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig)
{
struct cpuinfo_x86 *c = &cpu_data(cpu);

csig->sig = cpuid_eax(0x00000001);
csig->rev = c->microcode;
pr_info("CPU%d: patch_level=0x%08x\n", cpu, csig->rev);

Expand Down Expand Up @@ -118,16 +119,15 @@ static unsigned int verify_ucode_size(int cpu, u32 patch_size,
return patch_size;
}

static u16 find_equiv_id(void)
static u16 find_equiv_id(unsigned int cpu)
{
unsigned int current_cpu_id, i = 0;
struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
int i = 0;

BUG_ON(equiv_cpu_table == NULL);

current_cpu_id = cpuid_eax(0x00000001);

while (equiv_cpu_table[i].installed_cpu != 0) {
if (current_cpu_id == equiv_cpu_table[i].installed_cpu)
if (uci->cpu_sig.sig == equiv_cpu_table[i].installed_cpu)
return equiv_cpu_table[i].equiv_cpu;

i++;
Expand All @@ -150,7 +150,7 @@ static int get_matching_microcode(int cpu, const u8 *ucode_ptr,
patch_size = *(u32 *)(ucode_ptr + 4);
*current_size = patch_size + SECTION_HDR_SIZE;

equiv_cpu_id = find_equiv_id();
equiv_cpu_id = find_equiv_id(cpu);
if (!equiv_cpu_id)
return 0;

Expand Down

0 comments on commit 2cc48f9

Please sign in to comment.