linux/arch/arm64
D Scott Phillips 38e0257e0e arm64: errata: Fix exec handling in erratum 1418040 workaround
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>
2021-12-22 15:18:19 +00:00
..
boot arm64: dts: exynos: drop samsung,ufs-shareability-reg-offset in ExynosAutov9 2021-11-25 14:46:00 +01:00
configs ARM: defconfig updates for 5.16 2021-11-03 17:07:02 -07:00
crypto crypto: arm64/aes-ccm - avoid by-ref argument for ce_aes_ccm_auth_data 2021-09-17 11:05:11 +08:00
hyperv
include asm-generic: introduce io_stop_wc() and add implementation for ARM64 2021-12-22 10:44:53 +00:00
kernel arm64: errata: Fix exec handling in erratum 1418040 workaround 2021-12-22 15:18:19 +00:00
kvm arm64/kvm: Fix bitrotted comment for SVE handling in handle_exit.c 2021-12-06 16:09:34 +00:00
lib Kbuild updates for v5.16 2021-11-08 09:15:45 -08:00
mm arm64: remove __dma_*_area() aliases 2021-12-15 11:19:41 +00:00
net arm64 updates for 5.16 2021-11-01 16:33:53 -07:00
tools Merge branch 'for-next/trbe-errata' into for-next/core 2021-10-29 12:25:33 +01:00
xen xen: allow pv-only hypercalls only with CONFIG_XEN_PV 2021-11-02 08:11:01 -05:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
Kconfig.debug
Kconfig.platforms ARM: SoC drivers for 5.16 2021-11-03 17:00:52 -07:00
Makefile kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00