diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2023-03-27 12:37:27 +0300 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2023-04-04 19:34:56 +0300 |
commit | 22ca1e7738025ae38d07c05bae2af934b1b2c11f (patch) | |
tree | d727a91d27bd89cf66c1083327f726285a8e6315 /arch/s390/include/asm/processor.h | |
parent | 60afa6d1662c08dd266463231acc129488fffe6e (diff) | |
download | linux-22ca1e7738025ae38d07c05bae2af934b1b2c11f.tar.xz |
s390: move on_thread_stack() to processor.h
As preparation for the stackleak feature move on_thread_stack() to
processor.h like x86.
Also make it __always_inline, and slightly optimize it by reading
current task's kernel stack pointer from lowcore.
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/processor.h')
-rw-r--r-- | arch/s390/include/asm/processor.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h index 80ac0c1034dc..efffc28cbad8 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h @@ -226,6 +226,13 @@ static __always_inline unsigned long __current_stack_pointer(void) return sp; } +static __always_inline bool on_thread_stack(void) +{ + unsigned long ksp = S390_lowcore.kernel_stack; + + return !((ksp ^ current_stack_pointer) & ~(THREAD_SIZE - 1)); +} + static __always_inline unsigned short stap(void) { unsigned short cpu_address; |