linux/arch/arm64/kernel
Stephen Boyd 73e2d827a5 arm64: Initialize jump labels before setup_machine_fdt()
A static key warning splat appears during early boot on arm64 systems
that credit randomness from devicetrees that contain an "rng-seed"
property. This is because setup_machine_fdt() is called before
jump_label_init() during setup_arch(). Let's swap the order of these two
calls so that jump labels are initialized before the devicetree is
unflattened and the rng seed is credited.

 static_key_enable_cpuslocked(): static key '0xffffffe51c6fcfc0' used before call to jump_label_init()
 WARNING: CPU: 0 PID: 0 at kernel/jump_label.c:166 static_key_enable_cpuslocked+0xb0/0xb8
 Modules linked in:
 CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0+ #224 44b43e377bfc84bc99bb5ab885ff694984ee09ff
 pstate: 600001c9 (nZCv dAIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
 pc : static_key_enable_cpuslocked+0xb0/0xb8
 lr : static_key_enable_cpuslocked+0xb0/0xb8
 sp : ffffffe51c393cf0
 x29: ffffffe51c393cf0 x28: 000000008185054c x27: 00000000f1042f10
 x26: 0000000000000000 x25: 00000000f10302b2 x24: 0000002513200000
 x23: 0000002513200000 x22: ffffffe51c1c9000 x21: fffffffdfdc00000
 x20: ffffffe51c2f0831 x19: ffffffe51c6fcfc0 x18: 00000000ffff1020
 x17: 00000000e1e2ac90 x16: 00000000000000e0 x15: ffffffe51b710708
 x14: 0000000000000066 x13: 0000000000000018 x12: 0000000000000000
 x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000
 x8 : 0000000000000000 x7 : 61632065726f6665 x6 : 6220646573752027
 x5 : ffffffe51c641d25 x4 : ffffffe51c13142c x3 : ffff0a00ffffff05
 x2 : 40000000ffffe003 x1 : 00000000000001c0 x0 : 0000000000000065
 Call trace:
  static_key_enable_cpuslocked+0xb0/0xb8
  static_key_enable+0x2c/0x40
  crng_set_ready+0x24/0x30
  execute_in_process_context+0x80/0x90
  _credit_init_bits+0x100/0x154
  add_bootloader_randomness+0x64/0x78
  early_init_dt_scan_chosen+0x140/0x184
  early_init_dt_scan_nodes+0x28/0x4c
  early_init_dt_scan+0x40/0x44
  setup_machine_fdt+0x7c/0x120
  setup_arch+0x74/0x1d8
  start_kernel+0x84/0x44c
  __primary_switched+0xc0/0xc8
 ---[ end trace 0000000000000000 ]---
 random: crng init done
 Machine model: Google Lazor (rev1 - 2) with LTE

Cc: Hsin-Yi Wang <hsinyi@chromium.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Fixes: f5bda35fba ("random: use static branch for crng_ready()")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Link: https://lore.kernel.org/r/20220602022109.780348-1-swboyd@chromium.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2022-06-02 20:22:48 +01:00
..
probes arm64: Treat ESR_ELx as a 64-bit register 2022-04-29 19:26:27 +01:00
vdso arm64: vdso: Fix "no previous prototype" warning 2022-01-24 12:08:28 +00:00
vdso32 Kbuild: move to -std=gnu11 2022-03-13 17:31:37 +09:00
.gitignore
acpi_numa.c arm64, numa: Change the numa init functions name to be generic 2021-01-14 15:08:54 -08:00
acpi_parking_protocol.c arm64: use function_nocfi with __pa_symbol 2021-04-08 16:04:22 -07:00
acpi.c arm64: Simplify checking for populated DT 2021-12-06 16:12:53 +00:00
alternative.c arm64: alternatives: mark patch_alternative() as noinstr 2022-04-06 11:23:48 +01:00
armv8_deprecated.c arm64: extable: add a dedicated uaccess handler 2021-10-21 10:45:22 +01:00
asm-offsets.c KVM: arm64: Drop unused workaround_flags vcpu field 2021-12-08 14:54:07 +00:00
cacheinfo.c drivers: base: cacheinfo: Get rid of DEFINE_SMP_CALL_CACHE_FUNCTION() 2021-09-01 10:29:10 +02:00
cpu_errata.c arm64: Declare non global symbols as static 2022-05-11 13:40:26 +01:00
cpu_ops.c
cpu-reset.S arm64: kexec: remove cpu-reset.h 2021-10-01 13:31:00 +01:00
cpufeature.c arm64/fp: Rename SVE and SME LEN field name to _WIDTH 2022-05-16 19:50:20 +01:00
cpuidle.c cpuidle: PSCI: Move the has_lpi check to the beginning of the function 2022-03-03 20:20:06 +01:00
cpuinfo.c arm64/sme: Identify supported SME vector lengths at boot 2022-04-22 18:50:51 +01:00
crash_core.c arm64: crash_core: Export MODULES, VMALLOC, and VMEMMAP ranges 2022-03-07 21:25:47 +00:00
crash_dump.c arm64: kdump: update ppos when reading elfcorehdr 2021-03-22 12:46:38 +00:00
debug-monitors.c arm64: Treat ESR_ELx as a 64-bit register 2022-04-29 19:26:27 +01:00
efi-entry.S arm64: Rename arm64-internal cache maintenance functions 2021-05-25 19:27:49 +01:00
efi-header.S arm64: head: tidy up the Image header definition 2020-11-17 16:14:20 +00:00
efi-rt-wrapper.S Merge branch 'for-next/scs' into for-next/core 2020-05-28 18:03:40 +01:00
efi.c arm64: efi: Export screen_info 2021-08-04 16:54:36 +00:00
elfcore.c arm64: mte: Fix the stack frame size warning in mte_dump_tag_range() 2022-04-04 09:59:27 +01:00
entry-common.c Merge branch 'for-next/esr-elx-64-bit' into for-next/core 2022-05-20 18:51:54 +01:00
entry-fpsimd.S arm64/sme: Implement ZA context switching 2022-04-22 18:51:02 +01:00
entry-ftrace.S arm64/ftrace: Make function graph use ftrace directly 2022-04-29 19:21:12 +01:00
entry.S Merge branch 'for-next/spectre-bhb' into for-next/core 2022-03-14 19:08:31 +00:00
fpsimd.c Merge branch 'for-next/esr-elx-64-bit' into for-next/core 2022-05-20 18:51:54 +01:00
ftrace.c arm64/ftrace: Make function graph use ftrace directly 2022-04-29 19:21:12 +01:00
head.S sched: move CPU field back into thread_info if THREAD_INFO_IN_TASK=y 2021-09-30 16:13:10 +02:00
hibernate-asm.S arm64: kexec: install a copy of the linear-map 2021-10-01 13:31:00 +01:00
hibernate.c arm64: hibernate: Fix syntax errors in comments 2022-06-02 20:16:22 +01:00
hw_breakpoint.c arm64: Treat ESR_ELx as a 64-bit register 2022-04-29 19:26:27 +01:00
hyp-stub.S Merge remote-tracking branch 'arm64/for-next/vhe-only' into kvmarm-master/next 2021-04-13 15:42:40 +01:00
idle.c Merge branch 'for-next/entry' into for-next/core 2021-06-24 14:01:55 +01:00
idreg-override.c arm64: Add support of PAuth QARMA3 architected algorithm 2022-02-25 13:38:52 +00:00
image-vars.h ARM: 2022-03-24 11:58:57 -07:00
image.h arm64: get rid of TEXT_OFFSET 2020-09-07 15:00:52 +01:00
io.c
irq.c arm64: irq: allow FIQs to be handled 2021-03-24 20:19:30 +00:00
jump_label.c arm64: insn: decouple patching from insn code 2021-06-11 11:19:27 +01:00
kaslr.c arm64: fix the doc of RANDOMIZE_MODULE_REGION_FULL 2021-08-03 10:36:42 +01:00
kexec_image.c arm64: kexec_file: Fix sparse warning 2020-11-10 13:11:44 +00:00
kgdb.c arm64: Treat ESR_ELx as a 64-bit register 2022-04-29 19:26:27 +01:00
kuser32.S
machine_kexec_file.c arm64: kdump: Reimplement crashkernel=X 2022-05-07 19:54:33 +01:00
machine_kexec.c arm64: kdump: Reimplement crashkernel=X 2022-05-07 19:54:33 +01:00
Makefile arm64: mte: Dump the MTE tags in the core file 2022-02-15 22:53:29 +00:00
module-plts.c arm64: fix typos in comments 2022-04-04 10:32:50 +01:00
module.c kasan, arm64: don't tag executable vmalloc allocations 2022-03-24 19:06:48 -07:00
mte.c Merge branch 'for-next/sysreg-gen' into for-next/core 2022-05-20 18:50:57 +01:00
paravirt.c x86/paravirt: Switch time pvops functions to use static_call() 2021-03-11 16:17:52 +01:00
patching.c arm64: patch_text: Fixup last cpu should be master 2022-04-08 11:43:46 +01:00
pci.c arm64: PCI: Support root bridge preparation for Hyper-V 2021-08-23 10:59:26 +01:00
perf_callchain.c Peter Zijlstra says: 2022-01-12 16:26:58 -08:00
perf_event.c arm64: perf: Expose some Armv9 common events under sysfs 2022-03-08 11:40:44 +00:00
perf_regs.c perf/arch: Remove perf_sample_data::regs_user_copy 2020-11-09 18:12:34 +01:00
pointer_auth.c arm64: move preemption disablement to prctl handlers 2021-07-28 18:33:49 +01:00
process.c arm64/sme: Fix NULL check after kzalloc 2022-04-29 16:03:47 +01:00
proton-pack.c arm64: Add part number for Arm Cortex-A78AE 2022-04-08 11:46:46 +01:00
psci.c arm64: use function_nocfi with __pa_symbol 2021-04-08 16:04:22 -07:00
ptrace.c arm64/sme: Remove _EL0 from name of SVCR - FIXME sysreg.h 2022-05-16 19:50:20 +01:00
reloc_test_core.c
reloc_test_syms.S
relocate_kernel.S arm64: kexec: keep MMU enabled during kexec relocation 2021-10-01 13:31:00 +01:00
return_address.c arm64: Make return_address() use arch_stack_walk() 2021-12-10 14:06:04 +00:00
sdei.c arm64: kernel: add helper for booted at EL2 and not VHE 2021-10-01 13:30:59 +01:00
setup.c arm64: Initialize jump labels before setup_machine_fdt() 2022-06-02 20:22:48 +01:00
signal32.c arm64 updates for 5.15: 2021-09-01 15:04:29 -07:00
signal.c arm64: Remove the __user annotation for the restore_za_context() argument 2022-06-02 11:55:29 +01:00
sigreturn32.S
sleep.S kasan: remove redundant config option 2021-04-16 16:10:36 -07:00
smccc-call.S arm64: smccc: Save lr before calling __arm_smccc_sve_check() 2021-07-21 11:23:25 +01:00
smp_spin_table.c arm64: Rename arm64-internal cache maintenance functions 2021-05-25 19:27:49 +01:00
smp.c arch/arm64: Fix topology initialization for core scheduling 2022-04-04 10:24:22 +01:00
stacktrace.c arm64: stacktrace: align with common naming 2022-04-22 15:33:14 +01:00
suspend.c arm64: fix typos in comments 2022-04-04 10:32:50 +01:00
sys32.c
sys_compat.c arm64: compat: Do not treat syscall number as ESR_ELx for a bad syscall 2022-04-29 19:26:27 +01:00
sys.c
syscall.c arm64/sme: Remove _EL0 from name of SVCR - FIXME sysreg.h 2022-05-16 19:50:20 +01:00
time.c arm64: Make profile_pc() use arch_stack_walk() 2021-12-10 14:06:04 +00:00
topology.c topology: Represent clusters of CPUs within a die 2021-10-15 11:25:15 +02:00
trace-events-emulation.h
traps.c Merge branch 'for-next/esr-elx-64-bit' into for-next/core 2022-05-20 18:51:54 +01:00
vdso32-wrap.S arm64: do not descend to vdso directories twice 2021-01-20 12:18:46 +00:00
vdso-wrap.S arm64: do not descend to vdso directories twice 2021-01-20 12:18:46 +00:00
vdso.c Merge branches 'for-next/misc', 'for-next/kselftest', 'for-next/xntable', 'for-next/vdso', 'for-next/fiq', 'for-next/epan', 'for-next/kasan-vmalloc', 'for-next/fgt-boot-init', 'for-next/vhe-only' and 'for-next/neon-softirqs-disabled', remote-tracking branch 'arm64/for-next/perf' into for-next/core 2021-04-15 14:00:38 +01:00
vmlinux.lds.S arm64: lds: move special code sections out of kernel exec segment 2022-05-17 09:32:38 +01:00