aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/thread_info.h
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2020-05-15 14:11:05 +0100
committerWill Deacon <will@kernel.org>2020-05-18 17:47:22 +0100
commit51189c7a7ed1b4ed4493e27275d466ff60406d3a (patch)
treec06448db0ce33c2d4a5ae1494806a3b81082aa96 /arch/arm64/include/asm/thread_info.h
parentefi/libstub: Disable Shadow Call Stack (diff)
downloadlinux-dev-51189c7a7ed1b4ed4493e27275d466ff60406d3a.tar.xz
linux-dev-51189c7a7ed1b4ed4493e27275d466ff60406d3a.zip
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/thread_info.h')
-rw-r--r--arch/arm64/include/asm/thread_info.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h
index 9df79c0a4c43..6ea8b6a26ae9 100644
--- a/arch/arm64/include/asm/thread_info.h
+++ b/arch/arm64/include/asm/thread_info.h
@@ -43,7 +43,7 @@ struct thread_info {
};
#ifdef CONFIG_SHADOW_CALL_STACK
void *scs_base;
- unsigned long scs_offset;
+ void *scs_sp;
#endif
};
@@ -107,7 +107,7 @@ void arch_release_task_struct(struct task_struct *tsk);
#ifdef CONFIG_SHADOW_CALL_STACK
#define INIT_SCS \
.scs_base = init_shadow_call_stack, \
- .scs_offset = 0,
+ .scs_sp = init_shadow_call_stack,
#else
#define INIT_SCS
#endif