diff options
author | Will Deacon <will@kernel.org> | 2020-05-15 15:56:05 +0200 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2020-05-18 18:47:40 +0200 |
commit | 88485be531f4aee841ddc53b56e2f6e6a338854d (patch) | |
tree | 10833e62803878f5163551402f0248494d57e3bf /kernel/scs.c | |
parent | arm64: scs: Use 'scs_sp' register alias for x18 (diff) | |
download | linux-88485be531f4aee841ddc53b56e2f6e6a338854d.tar.xz linux-88485be531f4aee841ddc53b56e2f6e6a338854d.zip |
scs: Move scs_overflow_check() out of architecture code
There is nothing architecture-specific about scs_overflow_check() as
it's just a trivial wrapper around scs_corrupted().
For parity with task_stack_end_corrupted(), rename scs_corrupted() to
task_scs_end_corrupted() and call it from schedule_debug() when
CONFIG_SCHED_STACK_END_CHECK_is enabled, which better reflects its
purpose as a debug feature to catch inadvertent overflow of the SCS.
Finally, remove the unused scs_overflow_check() function entirely.
This has absolutely no impact on architectures that do not support SCS
(currently arm64 only).
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 'kernel/scs.c')
-rw-r--r-- | kernel/scs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/scs.c b/kernel/scs.c index aea841cd7586..faf0ecd7b893 100644 --- a/kernel/scs.c +++ b/kernel/scs.c @@ -98,7 +98,8 @@ void scs_release(struct task_struct *tsk) if (!s) return; - WARN(scs_corrupted(tsk), "corrupted shadow stack detected when freeing task\n"); + WARN(task_scs_end_corrupted(tsk), + "corrupted shadow stack detected when freeing task\n"); scs_check_usage(tsk); scs_free(s); } |