Jason A. Donenfeld 829d680e82 random: cap jitter samples per bit to factor of HZ
Currently the jitter mechanism will require two timer ticks per
iteration, and it requires N iterations per bit. This N is determined
with a small measurement, and if it's too big, it won't waste time with
jitter entropy because it'd take too long or not have sufficient entropy
anyway.

With the current max N of 32, there are large timeouts on systems with a
small CONFIG_HZ. Rather than set that maximum to 32, instead choose a
factor of CONFIG_HZ. In this case, 1/30 seems to yield sane values for
different configurations of CONFIG_HZ.

Reported-by: Vladimir Murzin <vladimir.murzin@arm.com>
Fixes: 78c768e619fb ("random: vary jitter iterations based on cycle counter speed")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Tested-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-07-16 10:42:12 -07:00
..
2022-07-15 10:12:22 -07:00
2022-06-30 08:21:43 +09:00
2022-06-26 14:12:56 -07:00
2022-05-15 18:31:28 -06:00
2022-06-28 17:56:57 +02:00
2022-07-15 10:12:22 -07:00
2022-07-15 09:56:24 -07:00
2022-06-07 15:00:29 -07:00
2022-06-02 15:23:54 -07:00
2022-06-02 15:23:54 -07:00
2022-05-25 16:18:27 -07:00
2022-05-25 15:02:26 +02:00
2022-06-03 11:48:47 -07:00
2022-06-02 15:23:54 -07:00
2022-05-23 21:06:11 -07:00
2022-05-19 16:56:17 +02:00
2022-07-15 10:12:22 -07:00
2022-05-09 23:09:10 +02:00
2022-06-03 11:48:47 -07:00
2022-06-02 15:23:54 -07:00
2022-07-01 11:19:14 -07:00
2022-06-03 11:48:47 -07:00
2022-05-11 08:29:11 +03:00
2022-06-05 09:25:12 -07:00
2022-06-05 09:25:12 -07:00