linux/arch
Will Deacon 67ab51cbdf arm64: tls: Fix context-switching of tpidrro_el0 when kpti is enabled
Commit 18011eac28 ("arm64: tls: Avoid unconditional zeroing of
tpidrro_el0 for native tasks") tried to optimise the context switching
of tpidrro_el0 by eliding the clearing of the register when switching
to a native task with kpti enabled, on the erroneous assumption that
the kpti trampoline entry code would already have taken care of the
write.

Although the kpti trampoline does zero the register on entry from a
native task, the check in tls_thread_switch() is on the *next* task and
so we can end up leaving a stale, non-zero value in the register if the
previous task was 32-bit.

Drop the broken optimisation and zero tpidrro_el0 unconditionally when
switching to a native 64-bit task.

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: stable@vger.kernel.org
Fixes: 18011eac28 ("arm64: tls: Avoid unconditional zeroing of tpidrro_el0 for native tasks")
Signed-off-by: Will Deacon <will@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20241114095332.23391-1-will@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2024-11-14 12:04:13 +00:00
..
alpha asm-generic updates for 6.12 2024-09-26 11:54:40 -07:00
arc Kbuild updates for v6.12 2024-09-24 13:02:06 -07:00
arm soc: convert ep93xx to devicetree 2024-09-26 12:00:25 -07:00
arm64 arm64: tls: Fix context-switching of tpidrro_el0 when kpti is enabled 2024-11-14 12:04:13 +00:00
csky mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
hexagon hexagon: vdso: Fix build failure 2024-09-23 08:17:50 -07:00
loongarch x86: 2024-09-28 09:20:14 -07:00
m68k m68knommu: updates and fixes for v6.12 2024-09-24 10:48:44 -07:00
microblaze microblaze: don't treat zero reserved memory regions as error 2024-08-25 15:26:30 -07:00
mips x86: 2024-09-28 09:20:14 -07:00
nios2 mm: remove legacy install_special_mapping() code 2024-09-01 20:26:13 -07:00
openrisc
parisc [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
powerpc powerpc fixes for 6.12 #2 2024-09-25 11:17:25 -07:00
riscv x86: 2024-09-28 09:20:14 -07:00
s390 x86: 2024-09-28 09:20:14 -07:00
sh sh updates for v6.12 2024-09-27 10:10:21 -07:00
sparc This includes the following changes related to sparc for v6.12: 2024-09-25 11:21:06 -07:00
um This pull request contains the following changes for UML: 2024-09-27 12:48:48 -07:00
x86 x86: kvm: fix build error 2024-09-29 14:47:33 -07:00
xtensa ALong with the usual shower of singleton patches, notable patch series in 2024-09-21 07:29:05 -07:00
.gitignore
Kconfig Rust changes for v6.12 2024-09-25 10:25:40 -07:00