freebsd-dev/sys
Conrad Meyer 3ee1d5bb9d random(4): Simplify RANDOM_LOADABLE
Simplify RANDOM_LOADABLE by removing the ability to unload a LOADABLE
random(4) implementation.  This allows one-time random module selection
at boot, by loader(8).  Swapping modules on the fly doesn't seem
especially useful.

This removes the need to hold a lock over the sleepable module calls
read_random and read_random_uio.

init/deinit have been pulled out of random_algorithm entirely.  Algorithms
can run their own sysinits to initialize; deinit is removed entirely, as
algorithms can not be unloaded.  Algorithms should initialize at
SI_SUB_RANDOM:SI_ORDER_SECOND.  In LOADABLE systems, algorithms install
a pointer to their local random_algorithm context in p_random_alg_context at
that time.

Go ahead and const'ify random_algorithm objects; there is no need to mutate
them at runtime.

LOADABLE kernel NULL checks are removed from random_harvestq by ordering
random_harvestq initialization at SI_SUB_RANDOM:SI_ORDER_THIRD, after
algorithm init.  Prior to random_harvestq init, hc_harvest_mask is zero and
no events are forwarded to algorithms; after random_harvestq init, the
relevant pointers will already have been installed.

Remove the bulk of random_infra shim wrappers and instead expose the bare
function pointers in sys/random.h.  In LOADABLE systems, read_random(9) et
al are just thin shim macros around invoking the associated function
pointer.  We do not provide a registration system but instead expect
LOADABLE modules to register themselves at SI_SUB_RANDOM:SI_ORDER_SECOND.
An example is provided in randomdev.c, as used in the random_fortuna.ko
module.

Approved by:	csprng(markm)
Discussed with:	gordon
Differential Revision:	https://reviews.freebsd.org/D22512
2019-12-26 19:32:11 +00:00
..
amd64 Unbreak build. It seems that mips and amd64 still pull in link_elf.c, so 2019-12-24 16:52:10 +00:00
arm Initialize the bounce pages list in armv[4|6] DMA maps. 2019-12-24 23:43:29 +00:00
arm64 [PowerPC] Implement Secure-PLT jump table processing for ppc32. 2019-12-24 15:56:24 +00:00
bsm Jail and capability mode for shm_rename; add audit support for shm_rename 2019-11-18 13:31:16 +00:00
cam Make pass(4) handle misaligned buffers of MAXPHYS size. 2019-12-23 20:41:55 +00:00
cddl vfs: flatten vop vectors 2019-12-16 00:06:22 +00:00
compat Make page busy state deterministic on free. Pages must be xbusy when 2019-12-22 06:56:44 +00:00
conf Add comments to a couple i2c device lines. 2019-12-26 02:22:38 +00:00
contrib Don't shift 32-bit value by more than 32 bits. 2019-12-21 11:38:48 +00:00
crypto Fix the armv8 crypto driver after r354170. 2019-10-30 10:41:10 +00:00
ddb sleep(9), sleepqueue(9): const'ify wchan pointers 2019-12-24 16:19:33 +00:00
dev random(4): Simplify RANDOM_LOADABLE 2019-12-26 19:32:11 +00:00
dts
fs Add NFSv4.1 and NFSv4.2 errors to nfsv4_errstr.h. 2019-12-25 22:25:30 +00:00
gdb [PPC] Handle qOffsets packet 2019-12-16 13:17:39 +00:00
geom Add BIO_SPEEDUP 2019-12-17 00:13:35 +00:00
gnu Import DTS files for riscv from Linux 5.4 2019-12-03 09:12:53 +00:00
i386 [PowerPC] Implement Secure-PLT jump table processing for ppc32. 2019-12-24 15:56:24 +00:00
isa syscons: drop keyboard index from softc 2019-12-23 21:32:07 +00:00
kern gone_in(9): Trivial string grammar and style cleanups 2019-12-26 18:25:07 +00:00
kgssapi
libkern Port the NetBSD KCSAN runtime to FreeBSD. 2019-11-21 11:22:08 +00:00
mips Unbreak build. It seems that mips and amd64 still pull in link_elf.c, so 2019-12-24 16:52:10 +00:00
modules Compile uart_cpu_acpi.c, added in r348195, into uart.ko. 2019-12-22 22:10:20 +00:00
net lagg: Clean up handling of the rr_limit option. 2019-12-22 21:56:47 +00:00
net80211 Don't use if_maddr_rlock() in 802.11, use epoch(9) directly instead. 2019-10-10 23:55:33 +00:00
netgraph Remove the deprecated timeout(9) interface. 2019-12-13 21:03:12 +00:00
netinet Improve input validation for some parameters having a too small 2019-12-20 15:25:08 +00:00
netinet6 Remove useless code from in6_rmx.c 2019-12-18 22:10:56 +00:00
netipsec Fix m_pullup() problem after removing PULLDOWN_TESTs and KAME EXT_*macros. 2019-12-01 00:22:04 +00:00
netpfil ipfw: Don't rollback state in alloc_table_vidx() if atomicity is not required. 2019-12-19 10:22:16 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Prevent potential underflow in ibcore. 2019-11-15 11:46:53 +00:00
opencrypto Add support for TLS 1.3 using AES-GCM to the OCF backend for KTLS. 2019-12-18 01:37:00 +00:00
powerpc [PowerPC] Define powerpc IFUNC kernel/userspace ABI. 2019-12-24 20:13:29 +00:00
riscv [PowerPC] Implement Secure-PLT jump table processing for ppc32. 2019-12-24 15:56:24 +00:00
rpc Change r355157 to make svc_rpc_gss_lifetime_max a static. 2019-11-28 02:18:51 +00:00
security Instead of looking up a predecessor or successor to the current map 2019-11-20 16:06:48 +00:00
sparc64 [PowerPC] Implement Secure-PLT jump table processing for ppc32. 2019-12-24 15:56:24 +00:00
sys random(4): Simplify RANDOM_LOADABLE 2019-12-26 19:32:11 +00:00
teken Adjust teken to allow build as part of loader 2019-09-05 18:07:40 +00:00
tests
tools vfs: allow tail call optimisation in vops in the common case 2019-12-16 00:07:51 +00:00
ufs Drop a sleepable lock when we plan on sleeping 2019-12-18 16:01:15 +00:00
vm Further reduce the cacheline footprint of fast allocations by duplicating 2019-12-25 20:57:24 +00:00
x86 Introduce the concept of busdma tag templates. A template can be allocated 2019-12-24 14:48:46 +00:00
xdr
xen
Makefile