forked from luck/tmp_suning_uos_patched
ed03a650fb
commit e4f74400308cb8abde5fdc9cad609c2aba32110c upstream. s390x appears to present two RNG interfaces: - a "TRNG" that gathers entropy using some hardware function; and - a "DRBG" that takes in a seed and expands it. Previously, the TRNG was wired up to arch_get_random_{long,int}(), but it was observed that this was being called really frequently, resulting in high overhead. So it was changed to be wired up to arch_get_random_ seed_{long,int}(), which was a reasonable decision. Later on, the DRBG was then wired up to arch_get_random_{long,int}(), with a complicated buffer filling thread, to control overhead and rate. Fortunately, none of the performance issues matter much now. The RNG always attempts to use arch_get_random_seed_{long,int}() first, which means a complicated implementation of arch_get_random_{long,int}() isn't really valuable or useful to have around. And it's only used when reseeding, which means it won't hit the high throughput complications that were faced before. So this commit returns to an earlier design of just calling the TRNG in arch_get_random_seed_{long,int}(), and returning false in arch_get_ random_{long,int}(). Part of what makes the simplification possible is that the RNG now seeds itself using the TRNG at bootup. But this only works if the TRNG is detected early in boot, before random_init() is called. So this commit also causes that check to happen in setup_arch(). Cc: stable@vger.kernel.org Cc: Harald Freudenberger <freude@linux.ibm.com> Cc: Ingo Franzki <ifranzki@linux.ibm.com> Cc: Juergen Christ <jchrist@linux.ibm.com> Cc: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Link: https://lore.kernel.org/r/20220610222023.378448-1-Jason@zx2c4.com Reviewed-by: Harald Freudenberger <freude@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
||
---|---|---|
.. | ||
syscalls | ||
vdso64 | ||
.gitignore | ||
alternative.c | ||
asm-offsets.c | ||
audit.c | ||
audit.h | ||
base.S | ||
cache.c | ||
compat_audit.c | ||
compat_linux.c | ||
compat_linux.h | ||
compat_ptrace.h | ||
compat_signal.c | ||
cpcmd.c | ||
crash_dump.c | ||
debug.c | ||
diag.c | ||
dis.c | ||
dumpstack.c | ||
early_printk.c | ||
early.c | ||
ebcdic.c | ||
entry.h | ||
entry.S | ||
fpu.c | ||
ftrace.c | ||
guarded_storage.c | ||
head64.S | ||
idle.c | ||
ima_arch.c | ||
ipl_vmparm.c | ||
ipl.c | ||
irq.c | ||
jump_label.c | ||
kdebugfs.c | ||
kexec_elf.c | ||
kexec_image.c | ||
kprobes_insn_page.S | ||
kprobes.c | ||
lgr.c | ||
machine_kexec_file.c | ||
machine_kexec_reloc.c | ||
machine_kexec.c | ||
Makefile | ||
mcount.S | ||
module.c | ||
nmi.c | ||
nospec-branch.c | ||
nospec-sysfs.c | ||
numa.c | ||
os_info.c | ||
perf_cpum_cf_common.c | ||
perf_cpum_cf_diag.c | ||
perf_cpum_cf_events.c | ||
perf_cpum_cf.c | ||
perf_cpum_sf.c | ||
perf_event.c | ||
perf_regs.c | ||
pgm_check.S | ||
process.c | ||
processor.c | ||
ptrace.c | ||
reipl.S | ||
relocate_kernel.S | ||
runtime_instr.c | ||
setup.c | ||
signal.c | ||
smp.c | ||
stacktrace.c | ||
sthyi.c | ||
sys_s390.c | ||
sysinfo.c | ||
time.c | ||
topology.c | ||
trace.c | ||
traps.c | ||
unwind_bc.c | ||
uprobes.c | ||
uv.c | ||
vdso.c | ||
vmlinux.lds.S | ||
vtime.c |