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>
This commit is contained in:
Will Deacon
2020-05-15 14:11:05 +01:00
parent cc49c71d2a
commit 51189c7a7e
5 changed files with 12 additions and 14 deletions

View File

@@ -60,8 +60,7 @@ int scs_prepare(struct task_struct *tsk, int node)
if (!s)
return -ENOMEM;
task_scs(tsk) = s;
task_scs_offset(tsk) = 0;
task_scs(tsk) = task_scs_sp(tsk) = s;
scs_account(tsk, 1);
return 0;
}