diff --git a/sys/kern/kern_entropy.c b/sys/kern/kern_entropy.c index a46a3c70d5b0..000d7c29c7ad 100644 --- a/sys/kern/kern_entropy.c +++ b/sys/kern/kern_entropy.c @@ -413,8 +413,20 @@ entropy_init(void) static void entropy_init_late_cpu(void *a, void *b) { + int bound; + /* + * We're not necessarily in a softint lwp here (xc_broadcast + * triggers softint on other CPUs, but calls directly on this + * CPU), so explicitly bind to the current CPU to invoke the + * softintr -- this lets us have a simpler assertion in + * entropy_account_cpu. Not necessary to avoid migration + * because xc_broadcast disables kpreemption anyway, but it + * doesn't hurt. + */ + bound = curlwp_bind(); entropy_softintr(NULL); + curlwp_bindx(bound); } /*