From nobody@FreeBSD.org  Tue Dec 14 10:37:40 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 925FF16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 14 Dec 2004 10:37:40 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 805EB43D2F
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 14 Dec 2004 10:37:40 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id iBEAbe7d084689
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 14 Dec 2004 10:37:40 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id iBEAbef9084688;
	Tue, 14 Dec 2004 10:37:40 GMT
	(envelope-from nobody)
Message-Id: <200412141037.iBEAbef9084688@www.freebsd.org>
Date: Tue, 14 Dec 2004 10:37:40 GMT
From: Boris Bliznioukov <blib@dsi.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: dev/random/probe.c use cpuid instruction that not availible on i486
X-Send-Pr-Version: www-2.3

>Number:         75049
>Category:       i386
>Synopsis:       dev/random/probe.c use cpuid instruction that not availible on i486
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    markm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 14 10:40:19 GMT 2004
>Closed-Date:    Mon Mar 28 12:56:18 GMT 2005
>Last-Modified:  Mon Mar 28 12:56:18 GMT 2005
>Originator:     Boris Bliznioukov
>Release:        RELLENG_5_3
>Organization:
>Environment:
RELENG_5_3 on MachZ x86 CPU

>Description:
I have MachZ x86 CPU, which is i486.
When I try to boot GENERIC kernel it traps on illegal instruction cpuid in dev/random/probe.c:58
i486 does not have cpuid instruction dev/random should do more checks before calling do_cpuid


http://www.paradicesoftware.com/specs/cpuid/note_cpuidtroubles.htm
>How-To-Repeat:
boot GENERIC kernel on any i486 (except Cyrix i486, most of the Cyrix CPUs have cpuid instruction)
>Fix:
*** dev/random/probe.c.orig     Tue Dec 14 13:02:59 2004
--- dev/random/probe.c  Tue Dec 14 13:05:15 2004
***************
*** 37,42 ****
--- 37,43 ----

  #if defined(__i386__) && !defined(PC98)
  #include <machine/cpufunc.h>
+ #include "cputypes.h"
  #endif

  #include <dev/random/randomdev.h>
***************
*** 55,67 ****

        /* Then go looking for hardware */
  #if defined(__i386__) && !defined(PC98)
!       do_cpuid(1, regs);
!       if ((regs[0] & 0xf) >= 3) {
!               do_cpuid(0xc0000000, regs);
!               if (regs[0] == 0xc0000001) {
!                       do_cpuid(0xc0000001, regs);
!                       if ((regs[3] & 0x0c) == 0x0c)
!                               *systat = random_nehemiah;
                }
        }
  #endif
--- 56,70 ----

        /* Then go looking for hardware */
  #if defined(__i386__) && !defined(PC98)
!       if(cpu_class != CPUCLASS_486 ) {
!               do_cpuid(1, regs);
!               if ((regs[0] & 0xf) >= 3) {
!                       do_cpuid(0xc0000000, regs);
!                       if (regs[0] == 0xc0000001) {
!                               do_cpuid(0xc0000001, regs);
!                               if ((regs[3] & 0x0c) == 0x0c)
!                                       *systat = random_nehemiah;
!                       }
                }
        }
  #endif

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->markm 
Responsible-Changed-By: arved 
Responsible-Changed-When: Fri Dec 17 23:14:24 GMT 2004 
Responsible-Changed-Why:  
markm is working on random-code. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75049 

From: Rick Jenkins <rick@hartmantech.com>
To: freebsd-gnats-submit@FreeBSD.org, blib@dsi.ru
Cc:  
Subject: Re:i386/75049: dev/random/probe.c use cpuid instruction that not availible on i486
Date: Fri, 4 Mar 2005 13:59:14 -0700

 This fault also affects many Cyrix 6x86 processors, and prevents installation 
 of the 5.3 release from scratch on such machines. I have two such systems 
 using different motherboards, either will install and run Gentoo linux 
 perfectly, but FreeBSD release 5.3 cannot be installed. 
 
 Is there any workaround ?
 -- 
 Rick Jenkins <rick@hartmantech.com>
 Hartman Technica           http://www.hartmantech.com 
 Phone +1 (403) 230-1987 voice & fax
 221 35 Avenue. N.E., Calgary, Alberta, Canada T2E 2K5
State-Changed-From-To: open->closed 
State-Changed-By: markm 
State-Changed-When: Mon Mar 28 12:55:55 GMT 2005 
State-Changed-Why:  
Fixed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75049 
>Unformatted:
