From nobody@FreeBSD.org  Fri Dec 31 05:21:30 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 9448F16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 31 Dec 2004 05:21:30 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7900F43D2D
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 31 Dec 2004 05:21:30 +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 iBV5LU41049520
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 31 Dec 2004 05:21:30 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id iBV5LULx049519;
	Fri, 31 Dec 2004 05:21:30 GMT
	(envelope-from nobody)
Message-Id: <200412310521.iBV5LULx049519@www.freebsd.org>
Date: Fri, 31 Dec 2004 05:21:30 GMT
From: David LeCount <snailboy1@yahoo.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Random device source not compatible with many 486's
X-Send-Pr-Version: www-2.3

>Number:         75686
>Category:       i386
>Synopsis:       Random device source not compatible with many 486's
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    markm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 31 05:30:23 GMT 2004
>Closed-Date:    Sat Feb 12 18:40:44 GMT 2005
>Last-Modified:  Sat Feb 12 18:40:44 GMT 2005
>Originator:     David LeCount
>Release:        5.3 cvsupped
>Organization:
>Environment:
FreeBSD gateway.princekenshi.com 5.0-RELEASE FreeBSD 5.0-RELEASE #0: Thu Jan 16 22:16:53 GMT 2003     root@hollin.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
I have attempted upgrading my 486 from 5.0-RELEASE to 5.3. I am building on my Pentium 3, though that doesn't seem to have anything to do with the issue. I've used different combinations of CPUTYPE=i486, CPUTYPE?=i486, NO_CPU_CFLAGS=true, and NO_CPU_COPTFLAGS all with the same result. The kernel panics at cpuid in the random_ident_hardware function in /usr/src/sys/dev/random/probe.c. The issue is that my processor doesn't support the cpuid opcode, just as many 486's don't. I found nothing in UPDATING regarding the issue. I also inquired about it on the mailing lists 3 times, so I believe it's not my error.
>How-To-Repeat:
Compile a 5.3 kernel on a 486 processor that doesn't support the cpuid opcode and try to boot to it.
>Fix:
Edit the code so it doesn't use the cpuid opcode on processors that do not support it. The 5.0 kernel works so it must use an algorithm that's compatible with these 486's.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->markm 
Responsible-Changed-By: arved 
Responsible-Changed-When: Sun Jan 2 14:23:29 GMT 2005 
Responsible-Changed-Why:  
markm has been working on the random code. 

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

From: Ian Dowse <iedowse@maths.tcd.ie>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: i386/75686: Random device source not compatible with many 486's
Date: Sun, 06 Feb 2005 16:22:03 +0000

 I just came across this problem on an old 486 laptop with a Cyrix
 CPU. Any objections to the following patch?
 
 Ian
 
 
 Index: probe.c
 ===================================================================
 RCS file: /dump/FreeBSD-CVS/src/sys/dev/random/probe.c,v
 retrieving revision 1.2
 diff -u -r1.2 probe.c
 --- probe.c	11 Apr 2004 09:13:42 -0000	1.2
 +++ probe.c	6 Feb 2005 16:06:52 -0000
 @@ -37,6 +37,7 @@
  
  #if defined(__i386__) && !defined(PC98)
  #include <machine/cpufunc.h>
 +#include <machine/cputypes.h>
  #endif
  
  #include <dev/random/randomdev.h>
 @@ -55,6 +56,8 @@
  
  	/* Then go looking for hardware */
  #if defined(__i386__) && !defined(PC98)
 +	if (cpu_class < CPUCLASS_586)
 +		return;
  	do_cpuid(1, regs);
  	if ((regs[0] & 0xf) >= 3) {
  		do_cpuid(0xc0000000, regs);
 
 
 
State-Changed-From-To: open->patched 
State-Changed-By: iedowse 
State-Changed-When: Sun Feb 6 16:56:10 GMT 2005 
State-Changed-Why:  

Fixed in -current by revision 1.3 of probe.c. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75686 
State-Changed-From-To: patched->closed 
State-Changed-By: iedowse 
State-Changed-When: Sat Feb 12 18:40:24 GMT 2005 
State-Changed-Why:  

Patch has been merged into RELENG_5. 

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