summaryrefslogtreecommitdiff
path: root/include/linux/hw_random.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2022-02-13 01:54:09 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-05-30 10:33:36 +0300
commit684e9fe92d440b7700672118675ae8a8ace228bb (patch)
tree373dd1e65c4675256a245081d78520278dcb4777 /include/linux/hw_random.h
parentf656bd0011fd128d482fb75f45cd564578984473 (diff)
downloadlinux-684e9fe92d440b7700672118675ae8a8ace228bb.tar.xz
random: unify early init crng load accounting
commit da792c6d5f59a76c10a310c5d4c93428fd18f996 upstream. crng_fast_load() and crng_slow_load() have different semantics: - crng_fast_load() xors and accounts with crng_init_cnt. - crng_slow_load() hashes and doesn't account. However add_hwgenerator_randomness() can afford to hash (it's called from a kthread), and it should account. Additionally, ones that can afford to hash don't need to take a trylock but can take a normal lock. So, we combine these into one function, crng_pre_init_inject(), which allows us to control these in a uniform way. This will make it simpler later to simplify this all down when the time comes for that. Cc: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/hw_random.h')
0 files changed, 0 insertions, 0 deletions