Module Name: src
Committed By: riastradh
Date: Thu Aug 14 16:27:56 UTC 2014
Modified Files:
src/sys/kern: init_main.c
src/sys/rump/librump/rumpkern: rump.c
Log Message:
Defer cprng_fast_init until CPUs are detected.
To generate a diff of this commit:
cvs rdiff -u -r1.458 -r1.459 src/sys/kern/init_main.c
cvs rdiff -u -r1.308 -r1.309 src/sys/rump/librump/rumpkern/rump.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/init_main.c
diff -u src/sys/kern/init_main.c:1.458 src/sys/kern/init_main.c:1.459
--- src/sys/kern/init_main.c:1.458 Sun Aug 10 16:44:36 2014
+++ src/sys/kern/init_main.c Thu Aug 14 16:27:55 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: init_main.c,v 1.458 2014/08/10 16:44:36 tls Exp $ */
+/* $NetBSD: init_main.c,v 1.459 2014/08/14 16:27:55 riastradh Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.458 2014/08/10 16:44:36 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.459 2014/08/14 16:27:55 riastradh Exp $");
#include "opt_ddb.h"
#include "opt_ipsec.h"
@@ -501,8 +501,6 @@ main(void)
kern_cprng = cprng_strong_create("kernel", IPL_VM,
CPRNG_INIT_ANY|CPRNG_REKEY_ANY);
- cprng_fast_init();
-
/* Initialize interfaces. */
ifinit1();
@@ -514,6 +512,9 @@ main(void)
/* Configure the system hardware. This will enable interrupts. */
configure();
+ /* Once all CPUs are detected, initialize the per-CPU cprng_fast. */
+ cprng_fast_init();
+
ssp_init();
ubc_init(); /* must be after autoconfig */
Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.308 src/sys/rump/librump/rumpkern/rump.c:1.309
--- src/sys/rump/librump/rumpkern/rump.c:1.308 Mon Aug 11 04:27:24 2014
+++ src/sys/rump/librump/rumpkern/rump.c Thu Aug 14 16:27:56 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: rump.c,v 1.308 2014/08/11 04:27:24 ozaki-r Exp $ */
+/* $NetBSD: rump.c,v 1.309 2014/08/14 16:27:56 riastradh Exp $ */
/*
* Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.308 2014/08/11 04:27:24 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.309 2014/08/14 16:27:56 riastradh Exp $");
#include <sys/systm.h>
#define ELFSIZE ARCH_ELFSIZE
@@ -305,7 +305,6 @@ rump_init(void)
kern_cprng = cprng_strong_create("kernel", IPL_VM,
CPRNG_INIT_ANY|CPRNG_REKEY_ANY);
- cprng_fast_init();
rump_hyperentropy_init();
procinit();
@@ -364,6 +363,9 @@ rump_init(void)
aprint_verbose("cpu%d at thinair0: rump virtual cpu\n", i);
}
+ /* Once all CPUs are detected, initialize the per-CPU cprng_fast. */
+ cprng_fast_init();
+
/* CPUs are up. allow kernel threads to run */
rump_thread_allow(NULL);