/* Initialize the standard set of capabilities */
/* Note that the vendor-specific code below might override */
- /* Intel-defined flags: level 0x00000001 */
+ /* Model and family information. */
cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
- c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = edx;
- c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = ecx;
c->x86 = (eax >> 8) & 15;
c->x86_model = (eax >> 4) & 15;
if (c->x86 == 0xf)
c->x86_mask = eax & 15;
c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0);
c->phys_proc_id = c->apicid;
+
+ if (this_cpu->c_early_init)
+ this_cpu->c_early_init(c);
+
+ /* c_early_init() may have adjusted cpuid levels/features. Reread. */
+ c->cpuid_level = cpuid_eax(0);
+ cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
+ c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = edx;
+ c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = ecx;
+
if ( cpu_has(c, X86_FEATURE_CLFLSH) )
c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8;
get_model_name(c); /* Default name */
}
- /* Might lift BIOS max_leaf=3 limit. */
- early_intel_workaround(c);
-
/* Intel-defined flags: level 0x00000007 */
if ( c->cpuid_level >= 0x00000007 )
cpuid_count(0x00000007, 0, &tmp,
/* some have two possibilities for cpuid string */
char * c_ident[2];
+ void (*c_early_init)(struct cpuinfo_x86 *c);
void (*c_init)(struct cpuinfo_x86 * c);
};
extern int get_model_name(struct cpuinfo_x86 *c);
extern void display_cacheinfo(struct cpuinfo_x86 *c);
-
-extern void early_intel_workaround(struct cpuinfo_x86 *c);
}
}
-void __devinit early_intel_workaround(struct cpuinfo_x86 *c)
+static void early_init_intel(struct cpuinfo_x86 *c)
{
- if (c->x86_vendor != X86_VENDOR_INTEL)
- return;
/* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */
if (c->x86 == 15 && c->x86_cache_alignment == 64)
c->x86_cache_alignment = 128;
static const struct cpu_dev intel_cpu_dev = {
.c_vendor = "Intel",
.c_ident = { "GenuineIntel" },
+ .c_early_init = early_init_intel,
.c_init = init_intel,
};