Module Name:    src
Committed By:   riastradh
Date:           Fri Mar 18 23:37:06 UTC 2022

Modified Files:
        src/sys/kern: init_main.c

Log Message:
entropy(9): Establish the softint a little earlier.

Just need to wait until softint_establish and high-priority xcalls
will work, no later than that.  Doing this earlier gives us slightly
more of a chance to ensure cprng_fast and ssp get entropy from
hardware RNG devices that rely on interrupts.


To generate a diff of this commit:
cvs rdiff -u -r1.536 -r1.537 src/sys/kern/init_main.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.536 src/sys/kern/init_main.c:1.537
--- src/sys/kern/init_main.c:1.536	Wed Jan 26 11:48:54 2022
+++ src/sys/kern/init_main.c	Fri Mar 18 23:37:06 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.536 2022/01/26 11:48:54 andvar Exp $	*/
+/*	$NetBSD: init_main.c,v 1.537 2022/03/18 23:37:06 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.536 2022/01/26 11:48:54 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.537 2022/03/18 23:37:06 riastradh Exp $");
 
 #include "opt_cnmagic.h"
 #include "opt_ddb.h"
@@ -552,6 +552,9 @@ main(void)
 	evcnt_attach_legacy_intrcnt();
 #endif
 
+	/* Enable deferred processing of RNG samples */
+	rnd_init_softint();
+
 	/* Once all CPUs are detected, initialize the per-CPU cprng_fast.  */
 	cprng_fast_init();
 
@@ -574,9 +577,6 @@ main(void)
 	/* Get the threads going and into any sleeps before continuing. */
 	yield();
 
-	/* Enable deferred processing of RNG samples */
-	rnd_init_softint();
-
 	vmem_rehash_start();	/* must be before exec_init */
 
 	/* Initialize exec structures */

Reply via email to