Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Jan 2012 21:59:33 GMT
From:      Stefan Krüger <stadtkind2@gmx.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/163974: Via RNG not enabled on amd64
Message-ID:  <201201092159.q09LxXfA049248@red.freebsd.org>
Resent-Message-ID: <201201092200.q09M0QTj047053@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         163974
>Category:       kern
>Synopsis:       Via RNG not enabled on amd64
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 09 22:00:26 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Stefan Krüger
>Release:        FreeBSD 9.0-REL
>Organization:
>Environment:
FreeBSD fbsd9.some.lan 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  9 21:46:25 UTC 2012     root@fbsd9.some.lan:/usr/obj/usr/src/sys/NANO  amd64
>Description:
The random kernel module on FreeBSD/amd64 doesn't support 64bit VIA CPUs hardware rng because the conf/Makefile/c files still assume Via CPUs are 32bit only.
>How-To-Repeat:
Boot FreeBSD/amd64 on a 64bit Via Nano CPU and notice that the hw rng is not used.
>Fix:


Patch attached with submission follows:

--- conf/files.amd64.orig	2012-01-09 22:08:51.000000000 +0100
+++ conf/files.amd64	2012-01-09 22:10:23.000000000 +0100
@@ -208,6 +208,7 @@
 dev/nfe/if_nfe.c		optional	nfe pci
 dev/nve/if_nve.c		optional	nve pci
 dev/nvram/nvram.c		optional	nvram isa
+dev/random/nehemiah.c		optional	random
 dev/qlxgb/qla_dbg.c		optional	qlxgb pci
 dev/qlxgb/qla_hw.c		optional	qlxgb pci
 dev/qlxgb/qla_ioctl.c		optional	qlxgb pci
--- modules/random/Makefile.orig	2012-01-09 22:07:22.000000000 +0100
+++ modules/random/Makefile	2012-01-09 22:07:27.000000000 +0100
@@ -6,7 +6,7 @@
 
 KMOD=	random
 SRCS=	randomdev.c probe.c
-.if ${MACHINE} == "i386"
+.if ${MACHINE} == "i386" || ${MACHINE} == "amd64"
 SRCS+=	nehemiah.c
 .endif
 SRCS+=	randomdev_soft.c yarrow.c hash.c
--- dev/random/probe.c.orig	2012-01-09 21:55:26.000000000 +0100
+++ dev/random/probe.c	2012-01-09 21:55:43.000000000 +0100
@@ -36,7 +36,7 @@
 #include <sys/stdint.h>
 #include <sys/sysctl.h>
 
-#if defined(__i386__) && !defined(PC98)
+#if defined(__amd64__) || (defined(__i386__) && !defined(PC98))
 #include <machine/cpufunc.h>
 #include <machine/cputypes.h>
 #include <machine/md_var.h>
@@ -55,7 +55,7 @@
 	*systat = random_yarrow;
 
 	/* Then go looking for hardware */
-#if defined(__i386__) && !defined(PC98)
+#if defined(__amd64__) || (defined(__i386__) && !defined(PC98))
 	if (via_feature_rng & VIA_HAS_RNG) {
 		*systat = random_nehemiah;
 	}


>Release-Note:
>Audit-Trail:
>Unformatted:



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