diff options
author | Will Deacon <[email protected]> | 2024-11-14 09:53:32 +0000 |
---|---|---|
committer | Catalin Marinas <[email protected]> | 2024-11-14 12:04:13 +0000 |
commit | 67ab51cbdfee02ef07fb9d7d14cc0bf6cb5a5e5c (patch) | |
tree | 532b36b3e2d4577d2a9d320094c641004e86f1e5 /drivers/perf/arm-ccn.c | |
parent | c0139f6cbb1fc6438509467ec0455a200cc49a43 (diff) |
arm64: tls: Fix context-switching of tpidrro_el0 when kpti is enabled
Commit 18011eac28c7 ("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 <[email protected]>
Cc: [email protected]
Fixes: 18011eac28c7 ("arm64: tls: Avoid unconditional zeroing of tpidrro_el0 for native tasks")
Signed-off-by: Will Deacon <[email protected]>
Acked-by: Mark Rutland <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Catalin Marinas <[email protected]>
Diffstat (limited to 'drivers/perf/arm-ccn.c')
0 files changed, 0 insertions, 0 deletions