Module Name: src Committed By: tls Date: Thu Dec 1 19:15:15 UTC 2011
Modified Files: src/sys/rump/librump/rumpkern: rump.c Log Message: Initialize the kern_cprng in rump startup. Oops. Should fix some "mysterious" rump test failures. Thanks to Nicholas Joly for pointing out exactly what was wrong. To generate a diff of this commit: cvs rdiff -u -r1.236 -r1.237 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/rump/librump/rumpkern/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.236 src/sys/rump/librump/rumpkern/rump.c:1.237 --- src/sys/rump/librump/rumpkern/rump.c:1.236 Sat Nov 26 21:41:02 2011 +++ src/sys/rump/librump/rumpkern/rump.c Thu Dec 1 19:15:15 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.236 2011/11/26 21:41:02 njoly Exp $ */ +/* $NetBSD: rump.c,v 1.237 2011/12/01 19:15:15 tls 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.236 2011/11/26 21:41:02 njoly Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.237 2011/12/01 19:15:15 tls Exp $"); #include <sys/systm.h> #define ELFSIZE ARCH_ELFSIZE @@ -163,19 +163,6 @@ rump_proc_vfs_release_fn rump_proc_vfs_r static void add_linkedin_modules(const struct modinfo *const *, size_t); -static void __noinline -messthestack(void) -{ - volatile uint32_t mess[64]; - uint64_t d1, d2; - int i, error; - - for (i = 0; i < 64; i++) { - rumpuser_gettime(&d1, &d2, &error); - mess[i] = d2; - } -} - /* * Create kern.hostname. why only this you ask. well, init_sysctl * is a kitchen sink in need of some gardening. but i want to use @@ -328,12 +315,11 @@ rump__init(int rump_version) kauth_init(); /* - * Seed arc4random() with a "reasonable" amount of randomness. - * Yes, this is a quick kludge which depends on the arc4random - * implementation. + * Create the kernel cprng. Yes, it's currently stubbed out + * to arc4random() for RUMP, but this won't always be so. */ - messthestack(); - cprng_fast32(); + kern_cprng = cprng_strong_create("kernel", IPL_VM, + CPRNG_INIT_ANY|CPRNG_REKEY_ANY); procinit(); proc0_init();