Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Aug 2010 08:46:40 -0700
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-hackers@freebsd.org, hackers@freebsd.org
Subject:   Re: Question about printcpuinfo in sys/amd64/amd64/indentcpu.c
Message-ID:  <AANLkTimRTv5sy9TbRN1LgKtgbfzFf0Fkq2MirhdyY3RY@mail.gmail.com>
In-Reply-To: <201008230807.59582.jhb@freebsd.org>
References:  <AANLkTi=CB4eyZPsj%2BNdFfYo3bhQ-P=1icnxAHx3VaT%2Bn@mail.gmail.com> <201008230807.59582.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 23, 2010 at 5:07 AM, John Baldwin <jhb@freebsd.org> wrote:
> On Friday, August 20, 2010 10:14:46 am Garrett Cooper wrote:
>> Hi,
>> =A0 =A0 Currently the code in identcpu.c does a check for a specific cpu
>> value extension. This is set to 0x80000004 (even though the
>> corresponding code below iterates through 0x80000002:0x80000005):
>
> It does not invoke 0x80000005 (<, not <=3D, is used as the loop terminato=
r).
>
>> =A0 =A0 =A0 =A0 /* Check for extended CPUID information and a processor =
name. */
>> =A0 =A0 =A0 =A0 if (cpu_exthigh >=3D 0x80000004) {
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 brand =3D cpu_brand;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 for (i =3D 0x80000002; i < 0x80000005; i=
++) {
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 do_cpuid(i, regs);
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 memcpy(brand, regs, size=
of(regs));
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 brand +=3D sizeof(regs);
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
>> =A0 =A0 =A0 =A0 }

    I'm blind :/. I did some poking around and now I know why it's
doing that. It's checking for the items noted in chapter 4.2 Brand
String under the "Intel Processor Identification and the CPUID
Instruction" spec.
Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimRTv5sy9TbRN1LgKtgbfzFf0Fkq2MirhdyY3RY>