freebsd-skq/sys
Mark Murray d1b06863fb Huge cleanup of random(4) code.
* GENERAL
- Update copyright.
- Make kernel options for RANDOM_YARROW and RANDOM_DUMMY. Set
  neither to ON, which means we want Fortuna
- If there is no 'device random' in the kernel, there will be NO
  random(4) device in the kernel, and the KERN_ARND sysctl will
  return nothing. With RANDOM_DUMMY there will be a random(4) that
  always blocks.
- Repair kern.arandom (KERN_ARND sysctl). The old version went
  through arc4random(9) and was a bit weird.
- Adjust arc4random stirring a bit - the existing code looks a little
  suspect.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Redo read_random(9) so as to duplicate random(4)'s read internals.
  This makes it a first-class citizen rather than a hack.
- Move stuff out of locked regions when it does not need to be
  there.
- Trim RANDOM_DEBUG printfs. Some are excess to requirement, some
  behind boot verbose.
- Use SYSINIT to sequence the startup.
- Fix init/deinit sysctl stuff.
- Make relevant sysctls also tunables.
- Add different harvesting "styles" to allow for different requirements
  (direct, queue, fast).
- Add harvesting of FFS atime events. This needs to be checked for
  weighing down the FS code.
- Add harvesting of slab allocator events. This needs to be checked for
  weighing down the allocator code.
- Fix the random(9) manpage.
- Loadable modules are not present for now. These will be re-engineered
  when the dust settles.
- Use macros for locks.
- Fix comments.

* src/share/man/...
- Update the man pages.

* src/etc/...
- The startup/shutdown work is done in D2924.

* src/UPDATING
- Add UPDATING announcement.

* src/sys/dev/random/build.sh
- Add copyright.
- Add libz for unit tests.

* src/sys/dev/random/dummy.c
- Remove; no longer needed. Functionality incorporated into randomdev.*.

* live_entropy_sources.c live_entropy_sources.h
- Remove; content moved.
- move content to randomdev.[ch] and optimise.

* src/sys/dev/random/random_adaptors.c src/sys/dev/random/random_adaptors.h
- Remove; plugability is no longer used. Compile-time algorithm
  selection is the way to go.

* src/sys/dev/random/random_harvestq.c src/sys/dev/random/random_harvestq.h
- Add early (re)boot-time randomness caching.

* src/sys/dev/random/randomdev_soft.c src/sys/dev/random/randomdev_soft.h
- Remove; no longer needed.

* src/sys/dev/random/uint128.h
- Provide a fake uint128_t; if a real one ever arrived, we can use
  that instead. All that is needed here is N=0, N++, N==0, and some
  localised trickery is used to manufacture a 128-bit 0ULLL.

* src/sys/dev/random/unit_test.c src/sys/dev/random/unit_test.h
- Improve unit tests; previously the testing human needed clairvoyance;
  now the test will do a basic check of compressibility. Clairvoyant
  talent is still a good idea.
- This is still a long way off a proper unit test.

* src/sys/dev/random/fortuna.c src/sys/dev/random/fortuna.h
- Improve messy union to just uint128_t.
- Remove unneeded 'static struct fortuna_start_cache'.
- Tighten up up arithmetic.
- Provide a method to allow eternal junk to be introduced; harden
  it against blatant by compress/hashing.
- Assert that locks are held correctly.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Turn into self-sufficient module (no longer requires randomdev_soft.[ch])

* src/sys/dev/random/yarrow.c src/sys/dev/random/yarrow.h
- Improve messy union to just uint128_t.
- Remove unneeded 'staic struct start_cache'.
- Tighten up up arithmetic.
- Provide a method to allow eternal junk to be introduced; harden
  it against blatant by compress/hashing.
- Assert that locks are held correctly.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Turn into self-sufficient module (no longer requires randomdev_soft.[ch])
- Fix some magic numbers elsewhere used as FAST and SLOW.

Differential Revision: https://reviews.freebsd.org/D2025
Reviewed by: vsevolod,delphij,rwatson,trasz,jmg
Approved by: so (delphij)
2015-06-30 17:00:45 +00:00
..
amd64 Add a comment about too strong semantic of atomic_load_acq() on x86. 2015-06-29 09:58:40 +00:00
arm pc_curpmap is only in the armv6 pcpu data. 2015-06-26 09:02:40 +00:00
arm64 Remove sv_sigtbl handling from the arm64 sendsig(). There is no ABI 2015-06-29 10:31:12 +00:00
boot MFi386: r284878 2015-06-27 08:49:41 +00:00
bsm
cam Fix REPORT LUNS command output for the case when same LUN mapped to same 2015-06-20 13:02:57 +00:00
cddl MFV r284412: 5911 ZFS "hangs" while deleting file 2015-06-19 06:58:05 +00:00
compat svr4 emulator has custom sendsig() implementation, it does not use 2015-06-29 10:33:04 +00:00
conf Huge cleanup of random(4) code. 2015-06-30 17:00:45 +00:00
contrib Merge ACPICA 20150619. 2015-06-18 23:14:45 +00:00
crypto In the version of gcc in the FreeBSD tree, this modification was made to 2015-04-16 17:42:52 +00:00
ddb Correct the function name in catch-all error handling case. 2015-06-17 10:20:59 +00:00
dev Huge cleanup of random(4) code. 2015-06-30 17:00:45 +00:00
fs Huge cleanup of random(4) code. 2015-06-30 17:00:45 +00:00
gdb CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten 2015-05-22 17:05:21 +00:00
geom Fix off-by-one error in fstyp(8) and geom_label(4) that made them use 2015-06-18 21:55:55 +00:00
gnu The GNU Amlogic DTS files have some errors (e.g. bad register 2015-04-11 08:17:39 +00:00
i386 Provide npx_get_fsave(9) and npx_set_fsave(9) functions to obtain and 2015-06-29 12:06:36 +00:00
isa
kern Huge cleanup of random(4) code. 2015-06-30 17:00:45 +00:00
kgssapi
libkern Huge cleanup of random(4) code. 2015-06-30 17:00:45 +00:00
mips Huge cleanup of random(4) code. 2015-06-30 17:00:45 +00:00
modules Huge cleanup of random(4) code. 2015-06-30 17:00:45 +00:00
net Huge cleanup of random(4) code. 2015-06-30 17:00:45 +00:00
net80211 Break out the current 802.11 software scan methods into an indirect table. 2015-06-08 02:35:43 +00:00
netgraph Huge cleanup of random(4) code. 2015-06-30 17:00:45 +00:00
netinet Avoid a situation where we do not set persist timer after a zero window 2015-06-29 21:23:54 +00:00
netinet6 Add FIB support for SCTP. 2015-06-17 15:20:14 +00:00
netipsec drop key_sa_stir_iv as it isn't used... 2015-06-11 13:05:37 +00:00
netnatm
netpfil ALTQ FAIRQ discipline import from DragonFLY 2015-06-24 19:16:41 +00:00
netsmb
nfs Avoid closing unallocated socket in case socreate fails. 2015-02-28 20:30:29 +00:00
nfsclient Remove some oldnfs remnants. 2015-04-18 16:08:06 +00:00
nfsserver
nlm
ofed fd: make rights a mandatory argument to fget_unlocked 2015-06-16 09:52:36 +00:00
opencrypto change the KASSERT so it is meaningful, var is unsigned, so even 2015-06-19 22:42:26 +00:00
pc98 Build GENERIC with RACCT/RCTL support by default. Note that it still 2015-05-14 14:03:55 +00:00
powerpc Allow DTrace to be compiled-in to the kernel. 2015-06-10 15:53:39 +00:00
rpc Remove hard limits on number of accepting NFS connections. 2015-04-07 10:25:27 +00:00
security Replace struct filedesc argument in getvnode with struct thread 2015-06-16 13:09:18 +00:00
sparc64 Generalised support for copy-on-write structures shared by threads. 2015-06-10 10:43:59 +00:00
sys Huge cleanup of random(4) code. 2015-06-30 17:00:45 +00:00
teken
tools
ufs Huge cleanup of random(4) code. 2015-06-30 17:00:45 +00:00
vm Huge cleanup of random(4) code. 2015-06-30 17:00:45 +00:00
x86 Set the initial system time to a sane (as in: not end of 21st century) value when 2015-06-29 17:02:09 +00:00
xdr
xen Garbage collect comments which related to the pre-r284296 support for a 2015-06-21 06:05:33 +00:00
Makefile Kill EoL whitespace. 2015-05-29 14:03:07 +00:00