Date: Wed, 8 Feb 2006 02:01:42 +0300 From: Yar Tikhiy <yar@comp.chem.msu.su> To: Cy Schubert <Cy.Schubert@spqr.komquats.com> Cc: freebsd-current@freebsd.org, netchild@freebsd.org Subject: Re: 7.0-CURRENT Hang Message-ID: <20060207230142.GD32998@comp.chem.msu.su> In-Reply-To: <200602071834.k17IYGcv036104@cwsys.cwsent.com> References: <20060207182755.GB32998@comp.chem.msu.su> <200602071834.k17IYGcv036104@cwsys.cwsent.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Feb 07, 2006 at 10:34:16AM -0800, Cy Schubert wrote:
> In message <20060207182755.GB32998@comp.chem.msu.su>, Yar Tikhiy writes:
> > On Tue, Feb 07, 2006 at 10:06:32AM -0800, Cy Schubert wrote:
> > > In message <20060207173154.GE19674@comp.chem.msu.su>, Yar Tikhiy writes:
> > > > On Mon, Feb 06, 2006 at 08:29:35PM -0800, Cy Schubert wrote:
>
> cwtest# /usr/local/bin/cpuid
> eax in eax ebx ecx edx
> 00000000 00000001 756e6547 6c65746e 49656e69
^^
> 00000001 0000052c 00000000 00000000 000001bf
Thanks for getting these data! They tell that your CPU doesn't
support CPUID functions above 0x01, which is completely OK for
a Pentium.
Would you mind giving a try to the attached patch? It should fix
the CPUID 0x02 issue while reducing code duplication.
--
Yar
Index: identcpu.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/i386/identcpu.c,v
retrieving revision 1.157
diff -u -p -r1.157 identcpu.c
--- identcpu.c 2 Feb 2006 12:44:09 -0000 1.157
+++ identcpu.c 7 Feb 2006 22:42:13 -0000
@@ -1235,34 +1235,23 @@ print_INTEL_info(void)
u_int rounds, regnum;
u_int nwaycode, nway;
- do_cpuid(0x2, regs);
-
- rounds = (regs[0] & 0xff) - 1;
-
- for (regnum = 0; regnum <= 3; ++regnum) {
- if ((regs[regnum] & (1<<31)) == 0) {
- if (regnum != 0)
- print_INTEL_TLB(regs[regnum] & 0xff);
- print_INTEL_TLB((regs[regnum] >> 8) & 0xff);
- print_INTEL_TLB((regs[regnum] >> 16) & 0xff);
- print_INTEL_TLB((regs[regnum] >> 24) & 0xff);
- }
- }
-
- while (rounds > 0) {
- do_cpuid(0x2, regs);
-
- for (regnum = 0; regnum <= 3; ++regnum) {
- if ((regs[regnum] & (1<<31)) == 0) {
+ if (cpu_high >= 2) {
+ rounds = 0;
+ do {
+ do_cpuid(0x2, regs);
+ if (rounds == 0 && (rounds = (regs[0] & 0xff)) == 0)
+ break; /* we have a buggy CPU */
+
+ for (regnum = 0; regnum <= 3; ++regnum) {
+ if (regs[regnum] & (1<<31))
+ continue;
if (regnum != 0)
print_INTEL_TLB(regs[regnum] & 0xff);
print_INTEL_TLB((regs[regnum] >> 8) & 0xff);
print_INTEL_TLB((regs[regnum] >> 16) & 0xff);
print_INTEL_TLB((regs[regnum] >> 24) & 0xff);
}
- }
-
- --rounds;
+ } while (--rounds > 0);
}
if (cpu_exthigh >= 0x80000006) {
@@ -1451,28 +1440,16 @@ setPQL2_INTEL(int *const size, int *cons
u_int regs[4];
u_int nwaycode;
- do_cpuid(0x2, regs);
- rounds = (regs[0] & 0xff) - 1;
-
- for (regnum = 0; regnum <= 3; ++regnum) {
- if ((regs[regnum] & (1<<31)) == 0) {
- if (regnum != 0)
- get_INTEL_TLB(regs[regnum] & 0xff,
- size, ways);
- get_INTEL_TLB((regs[regnum] >> 8) & 0xff,
- size, ways);
- get_INTEL_TLB((regs[regnum] >> 16) & 0xff,
- size, ways);
- get_INTEL_TLB((regs[regnum] >> 24) & 0xff,
- size, ways);
- }
- }
-
- while (rounds > 0) {
- do_cpuid(0x2, regs);
-
- for (regnum = 0; regnum <= 3; ++regnum) {
- if ((regs[regnum] & (1<<31)) == 0) {
+ if (cpu_high >= 2) {
+ rounds = 0;
+ do {
+ do_cpuid(0x2, regs);
+ if (rounds == 0 && (rounds = (regs[0] & 0xff)) == 0)
+ break; /* we have a buggy CPU */
+
+ for (regnum = 0; regnum <= 3; ++regnum) {
+ if (regs[regnum] & (1<<31))
+ continue;
if (regnum != 0)
get_INTEL_TLB(regs[regnum] & 0xff,
size, ways);
@@ -1482,11 +1459,9 @@ setPQL2_INTEL(int *const size, int *cons
size, ways);
get_INTEL_TLB((regs[regnum] >> 24) & 0xff,
size, ways);
- }
- }
-
- --rounds;
- }
+ }
+ } while (--rounds > 0);
+ }
if (cpu_exthigh >= 0x80000006) {
do_cpuid(0x80000006, regs);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060207230142.GD32998>
