kernel_optimize_test/arch/s390/kernel
Jason A. Donenfeld ed03a650fb s390/archrandom: simplify back to earlier design and initialize earlier
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>
2022-07-07 17:52:16 +02:00
..
syscalls mm/madvise: introduce process_madvise() syscall: an external memory hinting API 2020-10-18 09:27:10 -07:00
vdso64 Kbuild updates for v5.10 2020-10-22 13:13:57 -07:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
alternative.c s390: add automatic detection of the spectre defense 2018-03-28 08:38:24 +02:00
asm-offsets.c s390: fix fpu restore in entry.S 2020-11-23 11:52:13 +01:00
audit.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
audit.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
base.S s390/base: remove unused s390_base_mcck_handler 2019-09-03 13:53:56 +02:00
cache.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat_audit.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat_linux.c s390: use generic UID16 implementation 2019-01-18 09:33:18 +01:00
compat_linux.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat_ptrace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat_signal.c signal: Remove task parameter from force_sig 2019-05-27 09:36:28 -05:00
cpcmd.c s390/cpcmd: fix inline assembly register clobbering 2021-04-14 08:42:10 +02:00
crash_dump.c s390/nvme: support firmware-assisted dump to NVMe disks 2020-10-02 14:40:48 +02:00
debug.c s390/debug: fix debug area life cycle 2021-09-15 09:50:27 +02:00
diag.c s390/diag: convert to use DEFINE_SEQ_ATTRIBUTE macro 2020-09-17 14:11:03 +02:00
dis.c s390/disassembler: increase ebpf disasm buffer size 2021-05-11 14:47:11 +02:00
dumpstack.c kernel: rename show_stack_loglvl() => show_stack() 2020-06-09 09:39:13 -07:00
early_printk.c s390/sclp: remove unused sclp_early_printk_forced 2020-09-21 08:08:44 +02:00
early.c s390: make PCI mio support a machine flag 2021-09-18 13:40:22 +02:00
ebcdic.c s390: ebcdic: convert comments to UTF-8 2018-08-23 18:48:43 -07:00
entry.h s390 updates for the 5.10 merge window 2020-10-16 12:36:38 -07:00
entry.S s390/mcck: fix calculation of SIE critical section size 2021-06-23 14:42:51 +02:00
fpu.c s390: correct some inline assembly constraints 2019-04-17 10:40:57 +02:00
ftrace.c s390/ftrace: fix ftrace_update_ftrace_func implementation 2021-07-28 14:35:42 +02:00
guarded_storage.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2017-11-13 11:47:01 -08:00
head64.S s390/head64: correct init_task stack setup 2019-11-30 10:52:45 +01:00
idle.c sched/idle: Fix arch_cpu_idle() vs tracing 2020-11-24 16:47:35 +01:00
ima_arch.c s390/kexec_file: Disable kexec_load when IPLed secure 2019-04-29 10:44:03 +02:00
ipl_vmparm.c s390/ipl: provide uapi header for list directed IPL 2019-04-26 12:34:05 +02:00
ipl.c s390/kexec: fix return code handling 2021-11-26 10:39:18 +01:00
irq.c s390/irq: make init_ext_interrupts static 2020-03-11 14:18:44 +01:00
jump_label.c s390/jump_label: print real address in a case of a jump label bug 2021-09-18 13:40:22 +02:00
kdebugfs.c s390: no need to check return value of debugfs_create functions 2019-01-28 15:58:55 +01:00
kexec_elf.c kexec: Fix file verification on S390 2019-09-10 13:27:51 +01:00
kexec_image.c kexec_file: split KEXEC_VERIFY_SIG into KEXEC_SIG and KEXEC_SIG_FORCE 2019-08-19 21:54:15 -07:00
kprobes_insn_page.S s390/kprobes: move insn_page to text segment 2020-10-09 23:45:30 +02:00
kprobes.c s390 updates for the 5.10 merge window 2020-10-16 12:36:38 -07:00
lgr.c s390: convert to msecs_to_jiffies() 2020-06-29 16:31:46 +02:00
machine_kexec_file.c s390/kexec_file: fix error handling when applying relocations 2021-12-22 09:30:53 +01:00
machine_kexec_reloc.c s390/kaslr: add support for R_390_JMP_SLOT relocation type 2020-05-20 10:13:27 +02:00
machine_kexec.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
Makefile s390/kprobes: move insn_page to text segment 2020-10-09 23:45:30 +02:00
mcount.S s390/ftrace: fix ftrace_update_ftrace_func implementation 2021-07-28 14:35:42 +02:00
module.c s390/module: fix loading modules with a lot of relocations 2022-02-01 17:25:38 +01:00
nmi.c s390: remove critical section cleanup from entry.S 2020-05-28 12:21:54 +02:00
nospec-branch.c s390 updates for the 5.2 merge window 2019-05-06 16:42:54 -07:00
nospec-sysfs.c s390: Convert IS_ENABLED uses to __is_defined 2019-04-11 13:36:53 +02:00
numa.c s390/numa: move code to arch/s390/kernel 2020-08-11 18:16:55 +02:00
os_info.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf_cpum_cf_common.c s390/cpum_cf: move common functions into a separate file 2019-02-22 09:19:55 +01:00
perf_cpum_cf_diag.c s390/cpumf: Adjust registration of s390 PMU device drivers 2019-11-20 17:16:01 +01:00
perf_cpum_cf_events.c s390/cpum_cf,perf: change DFLT_CCERROR counter name 2020-07-21 13:53:56 +02:00
perf_cpum_cf.c s390/cpumf: Handle events cycles and instructions identical 2022-06-29 08:59:50 +02:00
perf_cpum_sf.c - fix system call exit path; avoid return to user space with 2020-11-17 11:22:03 -08:00
perf_event.c s390/perf: obtain sie_block from the right address 2022-06-09 10:21:24 +02:00
perf_regs.c perf/arch: Remove perf_sample_data::regs_user_copy 2020-11-09 18:12:34 +01:00
pgm_check.S s390: add 3f program exception handler 2020-09-14 10:08:07 +02:00
process.c Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-08-09 13:33:54 -07:00
processor.c s390/cpuinfo: do not skip info for CPUs without MHz feature 2020-03-23 13:41:55 +01:00
ptrace.c s390/ptrace: fix storage key handling 2020-08-17 13:17:14 +02:00
reipl.S s390: add missing ENDPROC statements to assembler functions 2019-05-02 13:54:11 +02:00
relocate_kernel.S s390: add missing ENDPROC statements to assembler functions 2019-05-02 13:54:11 +02:00
runtime_instr.c s390/runtime_instrumentation: fix storage key handling 2020-08-17 13:17:10 +02:00
setup.c s390/archrandom: simplify back to earlier design and initialize earlier 2022-07-07 17:52:16 +02:00
signal.c tracehook: clear TIF_NOTIFY_RESUME in tracehook_notify_resume() 2020-10-17 15:04:36 -06:00
smp.c s390: preempt: Fix preempt_count initialization 2021-07-14 16:56:54 +02:00
stacktrace.c stacktrace: Remove reliable argument from arch_stack_walk() callback 2020-09-18 14:24:16 +01:00
sthyi.c s390/sthyi: Fix machine name validity indication 2018-10-15 12:17:00 +02:00
sys_s390.c s390: autogenerate compat syscall wrappers 2019-01-18 09:33:19 +01:00
sysinfo.c s390: no need to check return value of debugfs_create functions 2019-01-28 15:58:55 +01:00
time.c s390/vdso: copy tod_steering_delta value to vdso_data page 2021-04-07 15:00:10 +02:00
topology.c s390: convert to msecs_to_jiffies() 2020-06-29 16:31:46 +02:00
trace.c s390/ftrace: fix potential crashes when switching tracers 2020-04-22 16:20:55 +02:00
traps.c s390/traps: do not test MONITOR CALL without CONFIG_BUG 2021-07-25 14:36:17 +02:00
unwind_bc.c s390/unwind: stop gracefully at user mode pt_regs in irq stack 2019-12-18 23:29:26 +01:00
uprobes.c s390/uprobes: implement arch_uretprobe_is_alive() 2018-04-23 07:57:16 +02:00
uv.c s390: mm: Fix secure storage access exception handling 2021-07-14 16:55:43 +02:00
vdso.c s390: convert to GENERIC_VDSO 2020-08-26 18:47:21 +02:00
vmlinux.lds.S vmlinux.lds.h: Split ELF_DETAILS from STABS_DEBUG 2020-09-01 09:50:35 +02:00
vtime.c s390/vtime: fix increased steal time accounting 2021-03-25 09:04:05 +01:00