alistair23-linux/arch/arm64/kernel
Will Deacon f6cc0c5016 arm64: Avoid calling stop_machine() when patching jump labels
Patching a jump label involves patching a single instruction at a time,
swizzling between a branch and a NOP. The architecture treats these
instructions specially, so a concurrently executing CPU is guaranteed to
see either the NOP or the branch, rather than an amalgamation of the two
instruction encodings.

However, in order to guarantee that the new instruction is visible, it
is necessary to send an IPI to the concurrently executing CPU so that it
discards any previously fetched instructions from its pipeline. This
operation therefore cannot be completed from a context with IRQs
disabled, but this is exactly what happens on the jump label path where
the hotplug lock is held and irqs are subsequently disabled by
stop_machine_cpuslocked(). This results in a deadlock during boot on
Hikey-960.

Due to the architectural guarantees around patching NOPs and branches,
we don't actually need to stop_machine() at all on the jump label path,
so we can avoid the deadlock by using the "nosync" variant of our
instruction patching routine.

Fixes: 693350a799 ("arm64: insn: Don't fallback on nosync path for general insn patching")
Reported-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reported-by: John Stultz <john.stultz@linaro.org>
Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Tested-by: Tuomas Tynkkynen <tuomas@tuxera.com>
Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2018-08-17 10:26:44 +01:00
..
probes
vdso
.gitignore
acpi.c arm64: acpi: fix alignment fault in accessing ACPI 2018-07-23 15:34:12 +01:00
acpi_numa.c arm64: numa: rework ACPI NUMA initialization 2018-07-09 18:21:40 +01:00
acpi_parking_protocol.c
alternative.c arm64: alternative: Use true and false for boolean values 2018-08-08 11:20:54 +01:00
arm64ksyms.c arm64: export tishift functions to modules 2018-05-21 19:00:48 +01:00
armv8_deprecated.c arm64: kill config_sctlr_el1() 2018-07-12 14:40:38 +01:00
asm-offsets.c arm64: KVM: Handle guest's ARCH_WORKAROUND_2 requests 2018-05-31 18:00:57 +01:00
cacheinfo.c arm64: Add support for ACPI based firmware tables 2018-05-17 17:28:09 +01:00
cpu-reset.h arm64: kexec: always reset to EL2 if present 2018-07-04 18:34:24 +01:00
cpu-reset.S arm64: idmap: Use "awx" flags for .idmap.text .pushsection directives 2018-02-06 22:53:27 +00:00
cpu_errata.c arm64: kill config_sctlr_el1() 2018-07-12 14:40:38 +01:00
cpu_ops.c
cpufeature.c arm64: use PSR_AA32 definitions 2018-07-05 17:24:14 +01:00
cpuidle.c ARM64 / cpuidle: Use new cpuidle macro for entering retention state 2018-01-02 13:50:34 +00:00
cpuinfo.c arm64: Expose Arm v8.4 features 2018-03-19 18:14:27 +00:00
crash_dump.c
debug-monitors.c arm64: Use arm64_force_sig_info instead of force_sig_info 2018-03-06 18:52:32 +00:00
efi-entry.S arm64: Add software workaround for Falkor erratum 1041 2018-02-06 22:53:13 +00:00
efi-header.S
efi-rt-wrapper.S efi/arm64: Check whether x18 is preserved by runtime services calls 2018-03-09 08:58:22 +01:00
efi.c efi/arm64: Check whether x18 is preserved by runtime services calls 2018-03-09 08:58:22 +01:00
entry-fpsimd.S arm64/sve: Write ZCR_EL1 on context switch only if changed 2018-05-17 18:19:53 +01:00
entry-ftrace.S
entry.S arm64: Add support for STACKLEAK gcc plugin 2018-07-26 11:36:34 +01:00
fpsimd.c arm64: move sve_user_{enable,disable} to <asm/fpsimd.h> 2018-07-12 14:40:39 +01:00
ftrace.c
head.S arm64/kvm: Prohibit guest LOR accesses 2018-02-26 10:48:01 +01:00
hibernate-asm.S arm64: assembler: Change order of macro arguments in phys_to_ttbr 2018-02-06 22:53:21 +00:00
hibernate.c arm64: ssbd: Restore mitigation status on CPU resume 2018-05-31 17:35:19 +01:00
hw_breakpoint.c compat: Move compat_timespec/ timeval to compat_time.h 2018-04-19 13:29:54 +02:00
hyp-stub.S
image.h arm64/efi: Make strrchr() available to the EFI namespace 2018-03-05 13:45:38 -06:00
insn.c arm64: insn: Don't fallback on nosync path for general insn patching 2018-07-05 17:24:48 +01:00
io.c
irq.c arm64: Add vmap_stack header file 2018-01-13 10:45:03 +00:00
jump_label.c arm64: Avoid calling stop_machine() when patching jump labels 2018-08-17 10:26:44 +01:00
kaslr.c arm64/kernel: kaslr: reduce module randomization range to 4 GB 2018-03-08 13:49:26 +00:00
kgdb.c arm64/debug: Fix registers on sleeping tasks 2018-03-06 18:52:34 +00:00
kuser32.S
machine_kexec.c arm64: kexec: Add comment to explain use of __flush_icache_range() 2018-07-31 12:10:38 +01:00
Makefile arm64: convert compat wrappers to C 2018-07-12 14:49:48 +01:00
module-plts.c arm64/kernel: rename module_emit_adrp_veneer->module_emit_veneer_for_adrp 2018-04-24 19:07:35 +01:00
module.c arm64: Avoid flush_icache_range() in alternatives patching code 2018-06-27 18:21:53 +01:00
module.lds
paravirt.c
pci.c
perf_callchain.c
perf_event.c arm64: perf: Add cap_user_time aarch64 2018-07-31 10:14:00 +01:00
perf_regs.c compat: Move compat_timespec/ timeval to compat_time.h 2018-04-19 13:29:54 +02:00
process.c arm64: Add support for STACKLEAK gcc plugin 2018-07-26 11:36:34 +01:00
psci.c
ptrace.c arm64: Add stack information to on_accessible_stack 2018-07-26 11:36:07 +01:00
reloc_test_core.c arm64: fix undefined reference to 'printk' 2018-03-19 18:14:25 +00:00
reloc_test_syms.S arm64: fix undefined reference to 'printk' 2018-03-19 18:14:25 +00:00
relocate_kernel.S arm64: Add software workaround for Falkor erratum 1041 2018-02-06 22:53:13 +00:00
return_address.c
sdei.c arm64: sdei: Mark sdei stack helper functions as static 2018-07-31 12:08:22 +01:00
setup.c arm64: export memblock_reserve()d regions via /proc/iomem 2018-07-23 15:30:32 +01:00
signal.c arm64: use {COMPAT,}SYSCALL_DEFINE0 for sigreturn 2018-07-12 14:49:48 +01:00
signal32.c arm64: use {COMPAT,}SYSCALL_DEFINE0 for sigreturn 2018-07-12 14:49:48 +01:00
sleep.S arm64: idmap: Use "awx" flags for .idmap.text .pushsection directives 2018-02-06 22:53:27 +00:00
smccc-call.S
smp.c arm64: numa: rework ACPI NUMA initialization 2018-07-09 18:21:40 +01:00
smp_spin_table.c
ssbd.c arm64: ssbd: Add prctl interface for per-thread mitigation 2018-05-31 18:00:52 +01:00
stacktrace.c arm64: Add stack information to on_accessible_stack 2018-07-26 11:36:07 +01:00
suspend.c arm64: ssbd: Restore mitigation status on CPU resume 2018-05-31 17:35:19 +01:00
sys.c arm64: implement syscall wrappers 2018-07-12 14:49:48 +01:00
sys32.c arm64: implement syscall wrappers 2018-07-12 14:49:48 +01:00
sys_compat.c signal: Ensure every siginfo we send has all bits initialized 2018-04-25 10:40:51 -05:00
syscall.c arm64: svc: Ensure hardirq tracing is updated before return 2018-07-30 17:43:39 +01:00
time.c arm64: fix unwind_frame() for filtered out fn for function graph tracing 2018-02-23 13:46:38 +00:00
topology.c arm64: topology: re-introduce numa mask check for scheduler MC selection 2018-07-06 13:18:18 +01:00
trace-events-emulation.h
traps.c arm64: convert raw syscall invocation to C 2018-07-12 14:43:09 +01:00
vdso.c
vmlinux.lds.S arm64: remove no-op macro VMLINUX_SYMBOL() 2018-05-15 18:14:24 +01:00