summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/scs.h
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2020-05-15 16:11:05 +0300
committerWill Deacon <will@kernel.org>2020-05-18 19:47:22 +0300
commit51189c7a7ed1b4ed4493e27275d466ff60406d3a (patch)
treec06448db0ce33c2d4a5ae1494806a3b81082aa96 /arch/arm64/include/asm/scs.h
parentcc49c71d2abe99c1c2c9bedf0693ad2d3ee4a067 (diff)
downloadlinux-51189c7a7ed1b4ed4493e27275d466ff60406d3a.tar.xz
arm64: scs: Store absolute SCS stack pointer value in thread_info
Storing the SCS information in thread_info as a {base,offset} pair introduces an additional load instruction on the ret-to-user path, since the SCS stack pointer in x18 has to be converted back to an offset by subtracting the base. Replace the offset with the absolute SCS stack pointer value instead and avoid the redundant load. Tested-by: Sami Tolvanen <samitolvanen@google.com> Reviewed-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm/scs.h')
-rw-r--r--arch/arm64/include/asm/scs.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/arm64/include/asm/scs.h b/arch/arm64/include/asm/scs.h
index 96549353b0cb..6b8cf4352fe3 100644
--- a/arch/arm64/include/asm/scs.h
+++ b/arch/arm64/include/asm/scs.h
@@ -4,16 +4,15 @@
#ifdef __ASSEMBLY__
+#include <asm/asm-offsets.h>
+
#ifdef CONFIG_SHADOW_CALL_STACK
.macro scs_load tsk, tmp
- ldp x18, \tmp, [\tsk, #TSK_TI_SCS_BASE]
- add x18, x18, \tmp
+ ldr x18, [\tsk, #TSK_TI_SCS_SP]
.endm
.macro scs_save tsk, tmp
- ldr \tmp, [\tsk, #TSK_TI_SCS_BASE]
- sub \tmp, x18, \tmp
- str \tmp, [\tsk, #TSK_TI_SCS_OFFSET]
+ str x18, [\tsk, #TSK_TI_SCS_SP]
.endm
#else
.macro scs_load tsk, tmp