Commit f5f786d0 authored by Suresh Siddha's avatar Suresh Siddha Committed by Linus Torvalds

[PATCH] x86-64/i386: Fix CPU model for family 6

According to cpuid instruction in IA32 SDM-Vol2, when computing cpu model,
we need to consider extended model ID for family 0x6 also.

AK: Also added fixes/simplifcation from Petr Vandrovec
Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e9b59d83
...@@ -233,10 +233,10 @@ static void __init early_cpu_detect(void) ...@@ -233,10 +233,10 @@ static void __init early_cpu_detect(void)
cpuid(0x00000001, &tfms, &misc, &junk, &cap0); cpuid(0x00000001, &tfms, &misc, &junk, &cap0);
c->x86 = (tfms >> 8) & 15; c->x86 = (tfms >> 8) & 15;
c->x86_model = (tfms >> 4) & 15; c->x86_model = (tfms >> 4) & 15;
if (c->x86 == 0xf) { if (c->x86 == 0xf)
c->x86 += (tfms >> 20) & 0xff; c->x86 += (tfms >> 20) & 0xff;
if (c->x86 >= 0x6)
c->x86_model += ((tfms >> 16) & 0xF) << 4; c->x86_model += ((tfms >> 16) & 0xF) << 4;
}
c->x86_mask = tfms & 15; c->x86_mask = tfms & 15;
if (cap0 & (1<<19)) if (cap0 & (1<<19))
c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8; c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8;
......
...@@ -1060,10 +1060,10 @@ void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c) ...@@ -1060,10 +1060,10 @@ void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c)
c->x86 = (tfms >> 8) & 0xf; c->x86 = (tfms >> 8) & 0xf;
c->x86_model = (tfms >> 4) & 0xf; c->x86_model = (tfms >> 4) & 0xf;
c->x86_mask = tfms & 0xf; c->x86_mask = tfms & 0xf;
if (c->x86 == 0xf) { if (c->x86 == 0xf)
c->x86 += (tfms >> 20) & 0xff; c->x86 += (tfms >> 20) & 0xff;
if (c->x86 >= 0x6)
c->x86_model += ((tfms >> 16) & 0xF) << 4; c->x86_model += ((tfms >> 16) & 0xF) << 4;
}
if (c->x86_capability[0] & (1<<19)) if (c->x86_capability[0] & (1<<19))
c->x86_clflush_size = ((misc >> 8) & 0xff) * 8; c->x86_clflush_size = ((misc >> 8) & 0xff) * 8;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment