Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173029
b: refs/heads/master
c: 8cc2361
h: refs/heads/master
i:
  173027: c4ae0ce
v: v3
  • Loading branch information
Andreas Herrmann authored and Ingo Molnar committed Nov 17, 2009
1 parent 297029d commit 8b05e5f
Show file tree
Hide file tree
Showing 2 changed files with 16 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: 9f15226e75583547aaf542c6be4bdac1060dd425
refs/heads/master: 8cc2361bd00e87aab2827a3996a71fe9b2c9f9c4
21 changes: 15 additions & 6 deletions trunk/arch/x86/kernel/microcode_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ MODULE_LICENSE("GPL v2");
#define UCODE_UCODE_TYPE 0x00000001

const struct firmware *firmware;
static int supported_cpu;

struct equiv_cpu_entry {
u32 installed_cpu;
Expand Down Expand Up @@ -73,15 +74,12 @@ static struct equiv_cpu_entry *equiv_cpu_table;

static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig)
{
struct cpuinfo_x86 *c = &cpu_data(cpu);
u32 dummy;

memset(csig, 0, sizeof(*csig));
if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) {
pr_warning("microcode: CPU%d: AMD CPU family 0x%x not "
"supported\n", cpu, c->x86);
if (!supported_cpu)
return -1;
}

memset(csig, 0, sizeof(*csig));
rdmsr(MSR_AMD64_PATCH_LEVEL, csig->rev, dummy);
pr_info("microcode: CPU%d: patch_level=0x%x\n", cpu, csig->rev);
return 0;
Expand Down Expand Up @@ -331,6 +329,17 @@ static void microcode_fini_cpu_amd(int cpu)
void init_microcode_amd(struct device *device)
{
const char *fw_name = "amd-ucode/microcode_amd.bin";
struct cpuinfo_x86 *c = &boot_cpu_data;

WARN_ON(c->x86_vendor != X86_VENDOR_AMD);

if (c->x86 < 0x10) {
pr_warning("microcode: AMD CPU family 0x%x not supported\n",
c->x86);
return;
}
supported_cpu = 1;

if (request_firmware(&firmware, fw_name, device))
pr_err("microcode: failed to load file %s\n", fw_name);
}
Expand Down

0 comments on commit 8b05e5f

Please sign in to comment.