aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/arm/include/asm/switch_to.h
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2022-01-24 19:28:58 +0100
committerArd Biesheuvel <ardb@kernel.org>2022-01-25 09:53:52 +0100
commit75fa4adc4f50ee52d8cdfa3e84798176ccb4a354 (patch)
tree138883d819bf540c067dd986ef505460e49376e9 /arch/arm/include/asm/switch_to.h
parentARM: assembler: define a Kconfig symbol for group relocation support (diff)
downloadwireguard-linux-75fa4adc4f50ee52d8cdfa3e84798176ccb4a354.tar.xz
wireguard-linux-75fa4adc4f50ee52d8cdfa3e84798176ccb4a354.zip
ARM: smp: elide HWCAP_TLS checks or __entry_task updates on SMP+v6
Use the SMP_ON_UP patching framework to elide HWCAP_TLS tests from the context switch and return to userspace code paths, as SMP systems are guaranteed to have this h/w capability. At the same time, omit the update of __entry_task if the system is detected to be UP at runtime, as in that case, the value is never used. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'arch/arm/include/asm/switch_to.h')
-rw-r--r--arch/arm/include/asm/switch_to.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/include/asm/switch_to.h b/arch/arm/include/asm/switch_to.h
index a482c99934ff..f67ae946a3c6 100644
--- a/arch/arm/include/asm/switch_to.h
+++ b/arch/arm/include/asm/switch_to.h
@@ -3,6 +3,7 @@
#define __ASM_ARM_SWITCH_TO_H
#include <linux/thread_info.h>
+#include <asm/smp_plat.h>
/*
* For v7 SMP cores running a preemptible kernel we may be pre-empted
@@ -40,8 +41,7 @@ static inline void set_ti_cpu(struct task_struct *p)
do { \
__complete_pending_tlbi(); \
set_ti_cpu(next); \
- if (IS_ENABLED(CONFIG_CURRENT_POINTER_IN_TPIDRURO) || \
- IS_ENABLED(CONFIG_SMP)) \
+ if (IS_ENABLED(CONFIG_CURRENT_POINTER_IN_TPIDRURO) || is_smp()) \
__this_cpu_write(__entry_task, next); \
last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \
} while (0)