From owner-freebsd-current@FreeBSD.ORG Tue Feb 7 04:29:32 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0321E16A420; Tue, 7 Feb 2006 04:29:32 +0000 (GMT) (envelope-from Cy.Schubert@komquats.com) Received: from spqr.komquats.com (S0106002078125c0c.gv.shawcable.net [24.108.150.239]) by mx1.FreeBSD.org (Postfix) with ESMTP id 28D2B43D45; Tue, 7 Feb 2006 04:29:31 +0000 (GMT) (envelope-from Cy.Schubert@komquats.com) Received: from cwsys.cwsent.com (cwsys [10.1.1.1]) by spqr.komquats.com (Postfix) with ESMTP id 15FB34C5C5; Mon, 6 Feb 2006 20:29:29 -0800 (PST) Received: from cwsys (localhost [127.0.0.1]) by cwsys.cwsent.com (8.13.4/8.13.4) with ESMTP id k174TZ6v009581; Mon, 6 Feb 2006 20:29:35 -0800 (PST) (envelope-from Cy.Schubert@komquats.com) Message-Id: <200602070429.k174TZ6v009581@cwsys.cwsent.com> X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.0.4 From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.komquats.com/ To: freebsd-current@freebsd.org, netchild@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 06 Feb 2006 20:29:35 -0800 Sender: Cy.Schubert@komquats.com Cc: Subject: Re: 7.0-CURRENT Hang X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Cy Schubert List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2006 04:29:32 -0000 Oops. In my haste I made a typo in my note. It should read when AL = 0x02. It should read as follows: I identified the problem (see my original discussion about this in attached the email below). On the Pentium P54C model (that's an old 120 MHz Pentium I use as a 4.x, 5.x, and 7.x ports build testbed) the CPUID instruction when called with AL = 0x02, CPUID returns EAX = EBX = ECX = EDX = 0. The code fragment in identcpu.c below results in "rounds" becoming 0xffffffff. do_cpuid(0x2, regs); rounds = (regs[0] & 0xff) - 1; The subsequent loop of the following will loop virtually for ever (it takes forever tor this machine to count down from 0xffffffff performing a very great many calls to get_INTEL_TLB in the process, virtually hanging the machine in the process. while (rounds > 0) { [... code ...] rounds--; } To resolve my problem I cobbled up the following patch to identcpu.c: --- sys/i386/i386/identcpu.c.orig Thu Feb 2 04:44:09 2006 +++ sys/i386/i386/identcpu.c Mon Feb 6 18:47:16 2006 @@ -1237,7 +1237,7 @@ do_cpuid(0x2, regs); - rounds = (regs[0] & 0xff) - 1; + rounds = (regs[0] & 0xff); for (regnum = 0; regnum <= 3; ++regnum) { if ((regs[regnum] & (1<<31)) == 0) { @@ -1249,7 +1249,7 @@ } } - while (rounds > 0) { + while (rounds > 1) { do_cpuid(0x2, regs); for (regnum = 0; regnum <= 3; ++regnum) { @@ -1452,7 +1452,7 @@ u_int nwaycode; do_cpuid(0x2, regs); - rounds = (regs[0] & 0xff) - 1; + rounds = (regs[0] & 0xff); for (regnum = 0; regnum <= 3; ++regnum) { if ((regs[regnum] & (1<<31)) == 0) { @@ -1468,7 +1468,7 @@ } } - while (rounds > 0) { + while (rounds > 1) { do_cpuid(0x2, regs); for (regnum = 0; regnum <= 3; ++regnum) { It fixes the hang. Cheers, Cy Schubert Web: http://www.komquats.com and http://www.bcbodybuilder.com FreeBSD UNIX: Web: http://www.FreeBSD.org BC Government: "Lift long enough and I believe arrogance is replaced by humility and fear by courage and selfishness by generosity and rudeness by compassion and caring." -- Dave Draper