Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144911777
D34150.1776903604.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D34150.1776903604.diff
View Options
Index: sys/dev/random/fenestrasX/fx_pool.c
===================================================================
--- sys/dev/random/fenestrasX/fx_pool.c
+++ sys/dev/random/fenestrasX/fx_pool.c
@@ -158,6 +158,9 @@
[RANDOM_SWI] = {
.entc_cls = &fxrng_lo_push,
},
+ [RANDOM_CALLOUT] = {
+ .entc_cls = &fxrng_lo_push,
+ },
[RANDOM_FS_ATIME] = {
.entc_cls = &fxrng_lo_push,
},
Index: sys/dev/random/random_harvestq.c
===================================================================
--- sys/dev/random/random_harvestq.c
+++ sys/dev/random/random_harvestq.c
@@ -348,6 +348,7 @@
[RANDOM_NET_NG] = "NET_NG",
[RANDOM_INTERRUPT] = "INTERRUPT",
[RANDOM_SWI] = "SWI",
+ [RANDOM_CALLOUT] = "CALLOUT",
[RANDOM_FS_ATIME] = "FS_ATIME",
[RANDOM_UMA] = "UMA", /* ENVIRONMENTAL_END */
[RANDOM_PURE_OCTEON] = "PURE_OCTEON", /* PURE_START */
Index: sys/kern/kern_timeout.c
===================================================================
--- sys/kern/kern_timeout.c
+++ 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;
@@ -546,6 +552,12 @@
#endif
if (!TAILQ_EMPTY(&cc->cc_expireq)) {
td = cc->cc_thread;
+
+ entropy.cc = cc;
+ entropy.td = td;
+ entropy.now = now;
+ random_harvest_queue(&entropy, sizeof(entropy), RANDOM_CALLOUT);
+
if (TD_AWAITING_INTR(td)) {
thread_lock_block_wait(td);
THREAD_LOCK_ASSERT(td, MA_OWNED);
Index: sys/sys/random.h
===================================================================
--- sys/sys/random.h
+++ sys/sys/random.h
@@ -84,6 +84,7 @@
RANDOM_NET_NG,
RANDOM_INTERRUPT,
RANDOM_SWI,
+ RANDOM_CALLOUT,
RANDOM_FS_ATIME,
RANDOM_UMA, /* Special!! UMA/SLAB Allocator */
RANDOM_ENVIRONMENTAL_END = RANDOM_UMA,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 23, 12:20 AM (18 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28412510
Default Alt Text
D34150.1776903604.diff (2 KB)
Attached To
Mode
D34150: kern: harvest entropy from callouts
Attached
Detach File
Event Timeline
Log In to Comment