[PATH] minor fixes to 2.1.125-ac2 cpu detection

Rafael Reilova (rreilova@ececs.uc.edu)
Tue, 13 Oct 1998 18:54:52 -0400 (EDT)


Hi Alan,

Please apply the following patch to your tree. I'll just enumerate the
three things this does:

Hunk#1: If the new time code works as advertized then there is no need
to disable the TSC on the Cx686MX and MII. So far so good for
me.

Hunk#2,3: For the AMD people, this gets the chip name and capabilities
from the extendeded cpuid levels [see note].

Hunk#4: The previous kernel was correct. The cmmx flag is on bit 24 of
the *extended* capabilities flag. ON bit 23 we just have the
mmx flag on the normal capabilities. AFAIK, only the Media
processors have the cmmx's. 686MX and MII only have the std.
mmx (on bit 23). We never saw the thing before because we
never fetched the extended flags before 2.1.125-ac1.

Note: The currently capabilities are bound to break if we mix the regular
flags with the extended as currently done. So far vendors have kept the
overlap between them (the std. flags are a subset of the extended flags)
but this may not remain so. Already AMD has a slight deviation on the
APIC flag bit between std. and ext. flags.

I guess eventually the two flags will have to be kept and parsed
separately, but for now this should do it.

Cheers,

Rafael

--- linux/arch/i386/kernel/setup.c~ Tue Oct 13 14:23:28 1998
+++ linux/arch/i386/kernel/setup.c Tue Oct 13 14:30:02 1998
@@ -373,9 +373,6 @@
break;

case 5: /* 6x86MX/M II */
- /* the TSC is broken (for now) */
- c->x86_capability &= ~X86_FEATURE_TSC;
-
if (dir1 > 7) dir0_msn++; /* M II */
tmp = (!(dir0_lsn & 7) || dir0_lsn & 1) ? 2 : 0;
Cx86_cb[tmp] = cyrix_model_mult2[dir0_lsn & 7];
@@ -486,6 +483,9 @@
return;
}

+ if (c->x86_vendor == X86_VENDOR_AMD && amd_model(c))
+ return;
+
for (i = 0; i < sizeof(cpu_models)/sizeof(struct cpu_model_info); i++) {
if (c->cpuid_level > 1) {
/* supports eax=2 call */
@@ -550,9 +550,6 @@
return;
}

- if (c->x86_vendor == X86_VENDOR_AMD && amd_model(c))
- return;
-
sprintf(c->x86_model_id, "%02x/%02x", c->x86_vendor, c->x86_model);
}

@@ -649,7 +646,7 @@
/* Modify the capabilities according to chip type */
if (c->x86_mask) {
if (c->x86_vendor == X86_VENDOR_CYRIX) {
- x86_cap_flags[23] = "cxmmx";
+ x86_cap_flags[24] = "cxmmx";
} else if (c->x86_vendor == X86_VENDOR_AMD) {
x86_cap_flags[16] = "fcmov";
x86_cap_flags[31] = "amd3d";

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/