Module Name:    src
Committed By:   riastradh
Date:           Fri Mar 18 23:35:19 UTC 2022

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

Log Message:
entropy(9): Reduce global entropy lock from IPL_VM to IPL_SOFTSERIAL.

This is no longer ever taken in hard interrupt context, so there's no
longer any need to block interrupts while doing crypto operations on
the global entropy pool.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/kern/kern_entropy.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/kern_entropy.c
diff -u src/sys/kern/kern_entropy.c:1.38 src/sys/kern/kern_entropy.c:1.39
--- src/sys/kern/kern_entropy.c:1.38	Fri Mar 18 23:35:07 2022
+++ src/sys/kern/kern_entropy.c	Fri Mar 18 23:35:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_entropy.c,v 1.38 2022/03/18 23:35:07 riastradh Exp $	*/
+/*	$NetBSD: kern_entropy.c,v 1.39 2022/03/18 23:35:19 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.38 2022/03/18 23:35:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.39 2022/03/18 23:35:19 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -366,7 +366,7 @@ entropy_init(void)
 	    NULL, 0, &E->epoch, 0, CTL_CREATE, CTL_EOL);
 
 	/* Initialize the global state for multithreaded operation.  */
-	mutex_init(&E->lock, MUTEX_DEFAULT, IPL_VM);
+	mutex_init(&E->lock, MUTEX_DEFAULT, IPL_SOFTSERIAL);
 	cv_init(&E->cv, "entropy");
 	selinit(&E->selq);
 	cv_init(&E->sourcelock_cv, "entsrclock");

Reply via email to