Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362692
b: refs/heads/master
c: 74c3e3f
h: refs/heads/master
v: v3
  • Loading branch information
H. Peter Anvin committed Apr 19, 2013
1 parent ec6f3d9 commit df79553
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 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: 7eff7ded02d1b15ba8321664839b353fa6c0c1e4
refs/heads/master: 74c3e3fcf350b2e7e3eaf9550528ee3f74e44b37
38 changes: 31 additions & 7 deletions trunk/arch/x86/kernel/microcode_core_early.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ static int __cpuinit x86_vendor(void)
u32 eax = 0x00000000;
u32 ebx, ecx = 0, edx;

if (!have_cpuid_p())
return X86_VENDOR_UNKNOWN;

native_cpuid(&eax, &ebx, &ecx, &edx);

if (CPUID_IS(CPUID_INTEL1, CPUID_INTEL2, CPUID_INTEL3, ebx, ecx, edx))
Expand All @@ -59,18 +56,45 @@ static int __cpuinit x86_vendor(void)
return X86_VENDOR_UNKNOWN;
}

static int __cpuinit x86_family(void)
{
u32 eax = 0x00000001;
u32 ebx, ecx = 0, edx;
int x86;

native_cpuid(&eax, &ebx, &ecx, &edx);

x86 = (eax >> 8) & 0xf;
if (x86 == 15)
x86 += (eax >> 20) & 0xff;

return x86;
}

void __init load_ucode_bsp(void)
{
int vendor = x86_vendor();
int vendor, x86;

if (!have_cpuid_p())
return;

if (vendor == X86_VENDOR_INTEL)
vendor = x86_vendor();
x86 = x86_family();

if (vendor == X86_VENDOR_INTEL && x86 >= 6)
load_ucode_intel_bsp();
}

void __cpuinit load_ucode_ap(void)
{
int vendor = x86_vendor();
int vendor, x86;

if (!have_cpuid_p())
return;

vendor = x86_vendor();
x86 = x86_family();

if (vendor == X86_VENDOR_INTEL)
if (vendor == X86_VENDOR_INTEL && x86 >= 6)
load_ucode_intel_ap();
}

0 comments on commit df79553

Please sign in to comment.