Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324041
b: refs/heads/master
c: c96d2c0
h: refs/heads/master
i:
  324039: 2cc48f9
v: v3
  • Loading branch information
Borislav Petkov authored and H. Peter Anvin committed Aug 22, 2012
1 parent e571787 commit 6a1f698
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 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: 48e30685caa8bdc4b8d4417d8ac31db59689742c
refs/heads/master: c96d2c0905cc48e34f2b37b775b59932c416b343
46 changes: 30 additions & 16 deletions trunk/arch/x86/kernel/microcode_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,36 @@ static struct equiv_cpu_entry *equiv_cpu_table;
/* page-sized ucode patch buffer */
void *patch;

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

BUG_ON(equiv_cpu_table == NULL);

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

i++;
}
return 0;
}

static u32 find_cpu_family_by_equiv_cpu(u16 equiv_cpu)
{
int i = 0;

BUG_ON(!equiv_cpu_table);

while (equiv_cpu_table[i].equiv_cpu != 0) {
if (equiv_cpu == equiv_cpu_table[i].equiv_cpu)
return equiv_cpu_table[i].installed_cpu;
i++;
}
return 0;
}

static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig)
{
struct cpuinfo_x86 *c = &cpu_data(cpu);
Expand Down Expand Up @@ -119,22 +149,6 @@ static unsigned int verify_ucode_size(int cpu, u32 patch_size,
return patch_size;
}

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

BUG_ON(equiv_cpu_table == NULL);

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

i++;
}
return 0;
}

/*
* we signal a good patch is found by returning its size > 0
*/
Expand Down

0 comments on commit 6a1f698

Please sign in to comment.