2000-12-14 14:42:00

by John Levon

[permalink] [raw]
Subject: x86 cpu_data


Hi, I need to check for *only* Intel P6 processors, so no Classic Pentium,
and no Pentium 4. setup.c is a bit obscure; is this check correct :

if (current_cpu_data.x86_vendor != X86_VENDOR_INTEL ||
current_cpu_data.x86 != 6)
return NOT_P6;
if (current_cpu_data.x86_model > 5)
return PENTIUM_III;
if (current_cpu_data.x86_model > 2)
return PENTIUM_II;
return PENTIUM_PRO;

??

(I need this check as I make use of the P6 performance counters).

Also, I found a weird bit of code in setup.c (2.4.0test12) :

1567 case 4:
1568 if ( c->x86 > 6 && dl ) {
1569 /* P4 family */
1570 if ( dl ) {
1571 /* L3 cache */
1572 cs = 128 << (dl-1);
1573 l3 += cs;
1574 break;
1575 }
1576 }
1577 /* else same as 8 - fall through */
1578 case 8:
1579 if ( dl ) {

in particular, the check on line 1570 seems redundant, or a typo.

thanks
john

--
"Kaa's Law: In any sufficiently large group of people most are idiots."
"Adams' Corollary: "sufficiently large" is around 1."


2000-12-14 21:03:15

by Alan

[permalink] [raw]
Subject: Re: x86 cpu_data

> Hi, I need to check for *only* Intel P6 processors, so no Classic Pentium,
> and no Pentium 4. setup.c is a bit obscure; is this check correct :

Long answer - you cannot reliably check...

Shorter answer

x86_vendor == INTEL
x86 = 6

is Pentium Pro-> PentiumIII

The Pentium IV reports x86 = 15. My opinion on that isnt printable ;)