kern/163974: Via RNG not enabled on amd64
Stefan Krüger
stadtkind2 at gmx.de
Mon Jan 9 22:00:27 UTC 2012
>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 at 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:
More information about the freebsd-bugs
mailing list