linux-stable/arch/arm64
Mark Rutland 353e228eb3 arm64: initialize per-cpu offsets earlier
The current initialization of the per-cpu offset register is difficult
to follow and this initialization is not always early enough for
upcoming instrumentation with KCSAN, where the instrumentation callbacks
use the per-cpu offset.

To make it possible to support KCSAN, and to simplify reasoning about
early bringup code, let's initialize the per-cpu offset earlier, before
we run any C code that may consume it. To do so, this patch adds a new
init_this_cpu_offset() helper that's called before the usual
primary/secondary start functions. For consistency, this is also used to
re-initialize the per-cpu offset after the runtime per-cpu areas have
been allocated (which can change CPU0's offset).

So that init_this_cpu_offset() isn't subject to any instrumentation that
might consume the per-cpu offset, it is marked with noinstr, preventing
instrumentation.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20201005164303.21389-1-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2020-10-05 18:54:49 +01:00
..
boot arm64: dts: k3-am65: Update the RM resource types 2020-08-16 22:01:20 +01:00
configs ARM: SoC driver updates for v5.9 2020-08-03 19:30:59 -07:00
crypto crypto: arm64/gcm - use inline helper to suppress indirect calls 2020-07-09 22:14:32 +10:00
include arm64: initialize per-cpu offsets earlier 2020-10-05 18:54:49 +01:00
kernel arm64: initialize per-cpu offsets earlier 2020-10-05 18:54:49 +01:00
kvm - Fix kernel build with the integrated LLVM assembler which doesn't 2020-08-28 11:37:33 -07:00
lib Merge branch 'rwonce/rework' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux 2020-06-10 14:46:54 -07:00
mm treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
net bpf, arm64: Add BPF exception tables 2020-07-31 00:43:40 +02:00
xen
Kbuild
Kconfig KVM/arm64 updates for Linux 5.9: 2020-08-09 12:58:23 -04:00
Kconfig.debug arm64: remove TEXT_OFFSET randomization 2020-06-15 13:10:59 +01:00
Kconfig.platforms ARM: new SoC support for v5.9 2020-08-03 19:38:30 -07:00
Makefile arm64: vdso32: make vdso32 install conditional 2020-08-28 13:18:48 +01:00