kernel_optimize_test/arch/arm64/kernel
D Scott Phillips bf0d4ae5c6 arm64: errata: Fix exec handling in erratum 1418040 workaround
commit 38e0257e0e6f4fef2aa2966b089b56a8b1cfb75c upstream.

The erratum 1418040 workaround enables CNTVCT_EL1 access trapping in EL0
when executing compat threads. The workaround is applied when switching
between tasks, but the need for the workaround could also change at an
exec(), when a non-compat task execs a compat binary or vice versa. Apply
the workaround in arch_setup_new_exec().

This leaves a small window of time between SET_PERSONALITY and
arch_setup_new_exec where preemption could occur and confuse the old
workaround logic that compares TIF_32BIT between prev and next. Instead, we
can just read cntkctl to make sure it's in the state that the next task
needs. I measured cntkctl read time to be about the same as a mov from a
general-purpose register on N1. Update the workaround logic to examine the
current value of cntkctl instead of the previous task's compat state.

Fixes: d49f7d7376 ("arm64: Move handling of erratum 1418040 into C code")
Cc: <stable@vger.kernel.org> # 5.9.x
Signed-off-by: D Scott Phillips <scott@os.amperecomputing.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211220234114.3926-1-scott@os.amperecomputing.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-01 17:25:40 +01:00
..
probes
vdso
vdso32 arm64: vdso32: require CROSS_COMPILE_COMPAT for gcc+bfd 2021-12-29 12:25:53 +01:00
.gitignore
acpi_numa.c
acpi_parking_protocol.c
acpi.c
alternative.c
armv8_deprecated.c
asm-offsets.c
cacheinfo.c drivers: base: cacheinfo: Get rid of DEFINE_SMP_CALL_CACHE_FUNCTION() 2021-09-26 14:08:59 +02:00
cpu_errata.c
cpu_ops.c
cpu-reset.h
cpu-reset.S
cpufeature.c
cpuidle.c
cpuinfo.c
crash_core.c
crash_dump.c
debug-monitors.c
efi-entry.S
efi-header.S
efi-rt-wrapper.S
efi.c
entry-common.c
entry-fpsimd.S
entry-ftrace.S arm64: ftrace: add missing BTIs 2021-12-08 09:03:24 +01:00
entry.S arm64: consistently use reserved_pg_dir 2021-07-14 16:56:06 +02:00
fpsimd.c arm64/sve: Use correct size when reinitialising SVE state 2021-09-22 12:27:54 +02:00
ftrace.c
head.S arm64: head: avoid over-mapping in map_memory 2021-09-18 13:40:08 +02:00
hibernate-asm.S
hibernate.c
hw_breakpoint.c
hyp-stub.S
image-vars.h
image.h
insn.c
io.c
irq.c
jump_label.c
kaslr.c
kexec_image.c
kgdb.c
kuser32.S
machine_kexec_file.c
machine_kexec.c
Makefile
module-plts.c
module.c
mte.c
paravirt.c
pci.c
perf_callchain.c perf: Protect perf_guest_cbs with RCU 2022-01-20 09:17:50 +01:00
perf_event.c
perf_regs.c
pointer_auth.c
process.c arm64: errata: Fix exec handling in erratum 1418040 workaround 2022-02-01 17:25:40 +01:00
proton-pack.c
psci.c
ptrace.c arm64: fix compat syscall return truncation 2021-08-12 13:22:20 +02:00
reloc_test_core.c
reloc_test_syms.S
relocate_kernel.S
return_address.c
scs.c
sdei.c
setup.c arm64/mm: Fix ttbr0 values stored in struct thread_info for software-pan 2021-07-14 16:56:07 +02:00
signal.c arm64: fix compat syscall return truncation 2021-08-12 13:22:20 +02:00
signal32.c
sigreturn32.S
sleep.S
smccc-call.S
smp_spin_table.c
smp.c
stacktrace.c arm64: stacktrace: avoid tracing arch_stack_walk() 2021-08-12 13:22:12 +02:00
suspend.c
sys_compat.c
sys.c
sys32.c
syscall.c arm64: fix compat syscall return truncation 2021-08-12 13:22:20 +02:00
time.c
topology.c
trace-events-emulation.h
traps.c
vdso.c
vmlinux.lds.S arm64: consistently use reserved_pg_dir 2021-07-14 16:56:06 +02:00