Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111420535
D34150.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D34150.diff
View Options
diff --git a/sys/dev/random/fenestrasX/fx_pool.c b/sys/dev/random/fenestrasX/fx_pool.c
--- a/sys/dev/random/fenestrasX/fx_pool.c
+++ b/sys/dev/random/fenestrasX/fx_pool.c
@@ -164,6 +164,9 @@
[RANDOM_UMA] = {
.entc_cls = &fxrng_lo_push,
},
+ [RANDOM_CALLOUT] = {
+ .entc_cls = &fxrng_lo_push,
+ },
[RANDOM_PURE_OCTEON] = {
.entc_cls = &fxrng_hi_push, /* Could be made pull. */
},
diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c
--- a/sys/dev/random/random_harvestq.c
+++ b/sys/dev/random/random_harvestq.c
@@ -349,7 +349,8 @@
[RANDOM_INTERRUPT] = "INTERRUPT",
[RANDOM_SWI] = "SWI",
[RANDOM_FS_ATIME] = "FS_ATIME",
- [RANDOM_UMA] = "UMA", /* ENVIRONMENTAL_END */
+ [RANDOM_UMA] = "UMA",
+ [RANDOM_CALLOUT] = "CALLOUT", /* ENVIRONMENTAL_END */
[RANDOM_PURE_OCTEON] = "PURE_OCTEON", /* PURE_START */
[RANDOM_PURE_SAFE] = "PURE_SAFE",
[RANDOM_PURE_GLXSB] = "PURE_GLXSB",
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -57,6 +57,7 @@
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/random.h>
#include <sys/sched.h>
#include <sys/sdt.h>
#include <sys/sleepqueue.h>
@@ -430,6 +431,11 @@
void
callout_process(sbintime_t now)
{
+ struct callout_entropy {
+ struct callout_cpu *cc;
+ struct thread *td;
+ sbintime_t now;
+ } entropy;
struct callout *tmp, *tmpn;
struct callout_cpu *cc;
struct callout_list *sc;
@@ -545,6 +551,11 @@
avg_lockcalls_dir += (lockcalls_dir * 1000 - avg_lockcalls_dir) >> 8;
#endif
if (!TAILQ_EMPTY(&cc->cc_expireq)) {
+ entropy.cc = cc;
+ entropy.td = curthread;
+ entropy.now = now;
+ random_harvest_queue(&entropy, sizeof(entropy), RANDOM_CALLOUT);
+
td = cc->cc_thread;
if (TD_AWAITING_INTR(td)) {
thread_lock_block_wait(td);
diff --git a/sys/sys/random.h b/sys/sys/random.h
--- a/sys/sys/random.h
+++ b/sys/sys/random.h
@@ -86,7 +86,8 @@
RANDOM_SWI,
RANDOM_FS_ATIME,
RANDOM_UMA, /* Special!! UMA/SLAB Allocator */
- RANDOM_ENVIRONMENTAL_END = RANDOM_UMA,
+ RANDOM_CALLOUT,
+ RANDOM_ENVIRONMENTAL_END = RANDOM_CALLOUT,
/* Fast hardware random-number sources from here on. */
RANDOM_PURE_START,
RANDOM_PURE_OCTEON = RANDOM_PURE_START,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 4, 1:27 PM (17 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16971651
Default Alt Text
D34150.diff (2 KB)
Attached To
Mode
D34150: kern: harvest entropy from callouts
Attached
Detach File
Event Timeline
Log In to Comment