Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * S390 version |
Heiko Carstens | a53c8fa | 2012-07-20 11:15:04 +0200 | [diff] [blame] | 4 | * Copyright IBM Corp. 2002, 2006 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) |
| 6 | */ |
| 7 | |
| 8 | #ifndef _ASM_THREAD_INFO_H |
| 9 | #define _ASM_THREAD_INFO_H |
| 10 | |
Heiko Carstens | 92778b9 | 2015-10-06 16:23:39 +0200 | [diff] [blame] | 11 | #include <linux/const.h> |
| 12 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | /* |
Vasily Gorbik | 32ce55a | 2018-09-18 18:23:40 +0200 | [diff] [blame] | 14 | * General size of kernel stacks |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | */ |
Vasily Gorbik | 7fef92c | 2017-11-17 16:52:22 +0100 | [diff] [blame] | 16 | #ifdef CONFIG_KASAN |
Vasily Gorbik | 9fed920 | 2018-10-26 15:29:59 +0200 | [diff] [blame] | 17 | #define THREAD_SIZE_ORDER 4 |
Vasily Gorbik | 7fef92c | 2017-11-17 16:52:22 +0100 | [diff] [blame] | 18 | #else |
Heiko Carstens | 3a89038 | 2016-11-14 14:39:16 +0100 | [diff] [blame] | 19 | #define THREAD_SIZE_ORDER 2 |
Vasily Gorbik | 7fef92c | 2017-11-17 16:52:22 +0100 | [diff] [blame] | 20 | #endif |
Vasily Gorbik | 19733fe | 2018-01-12 12:46:00 +0100 | [diff] [blame] | 21 | #define BOOT_STACK_ORDER 2 |
Heiko Carstens | 3a89038 | 2016-11-14 14:39:16 +0100 | [diff] [blame] | 22 | #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
| 24 | #ifndef __ASSEMBLY__ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | #include <asm/lowcore.h> |
Christian Ehrhardt | 25097bf | 2009-04-14 15:36:16 +0200 | [diff] [blame] | 26 | #include <asm/page.h> |
| 27 | #include <asm/processor.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | |
Vasily Gorbik | 32ce55a | 2018-09-18 18:23:40 +0200 | [diff] [blame] | 29 | #define STACK_INIT_OFFSET \ |
| 30 | (THREAD_SIZE - STACK_FRAME_OVERHEAD - sizeof(struct pt_regs)) |
| 31 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | /* |
| 33 | * low level task data that entry.S needs immediate access to |
| 34 | * - this struct should fit entirely inside of one cache line |
| 35 | * - this struct shares the supervisor stack pages |
| 36 | * - if the contents of this structure are changed, the assembly constants must also be changed |
| 37 | */ |
| 38 | struct thread_info { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | unsigned long flags; /* low level flags */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | /* |
| 43 | * macros/functions for gaining access to the thread information structure |
| 44 | */ |
| 45 | #define INIT_THREAD_INFO(tsk) \ |
| 46 | { \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | .flags = 0, \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | } |
| 49 | |
Heiko Carstens | 2a5e91c | 2015-03-16 12:46:38 +0100 | [diff] [blame] | 50 | void arch_release_task_struct(struct task_struct *tsk); |
Heiko Carstens | 521b00c | 2016-05-07 12:15:21 +0200 | [diff] [blame] | 51 | int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); |
Heiko Carstens | 2a5e91c | 2015-03-16 12:46:38 +0100 | [diff] [blame] | 52 | |
Martin Schwidefsky | 2317b07 | 2018-04-20 10:21:21 +0200 | [diff] [blame] | 53 | void arch_setup_new_exec(void); |
| 54 | #define arch_setup_new_exec arch_setup_new_exec |
| 55 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | #endif |
| 57 | |
| 58 | /* |
| 59 | * thread information flags bit numbers |
| 60 | */ |
Jiri Slaby | 30d64f1 | 2017-02-13 19:42:33 -0600 | [diff] [blame] | 61 | /* _TIF_WORK bits */ |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 62 | #define TIF_NOTIFY_RESUME 0 /* callback before returning to user */ |
| 63 | #define TIF_SIGPENDING 1 /* signal pending */ |
| 64 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ |
Martin Schwidefsky | 916cda1 | 2016-01-26 14:10:34 +0100 | [diff] [blame] | 65 | #define TIF_UPROBE 3 /* breakpointed or single-stepping */ |
| 66 | #define TIF_GUARDED_STORAGE 4 /* load guarded storage control block */ |
Linus Torvalds | 76f1948 | 2017-05-02 18:24:16 -0700 | [diff] [blame] | 67 | #define TIF_PATCH_PENDING 5 /* pending live patching update */ |
Martin Schwidefsky | 23fefe1 | 2017-06-07 14:10:24 +0200 | [diff] [blame] | 68 | #define TIF_PGSTE 6 /* New mm's will use 4K page tables */ |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 69 | #define TIF_ISOLATE_BP 8 /* Run process with isolated BP */ |
| 70 | #define TIF_ISOLATE_BP_GUEST 9 /* Run KVM guests with isolated BP */ |
Jiri Slaby | 30d64f1 | 2017-02-13 19:42:33 -0600 | [diff] [blame] | 71 | |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 72 | #define TIF_31BIT 16 /* 32bit process */ |
| 73 | #define TIF_MEMDIE 17 /* is terminating due to OOM killer */ |
| 74 | #define TIF_RESTORE_SIGMASK 18 /* restore signal mask in do_signal() */ |
| 75 | #define TIF_SINGLE_STEP 19 /* This task is single stepped */ |
| 76 | #define TIF_BLOCK_STEP 20 /* This task is block stepped */ |
Jan Willeke | 2a0a5b2 | 2014-09-22 16:39:06 +0200 | [diff] [blame] | 77 | #define TIF_UPROBE_SINGLESTEP 21 /* This task is uprobe single stepped */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | |
Jiri Slaby | 30d64f1 | 2017-02-13 19:42:33 -0600 | [diff] [blame] | 79 | /* _TIF_TRACE bits */ |
| 80 | #define TIF_SYSCALL_TRACE 24 /* syscall trace active */ |
| 81 | #define TIF_SYSCALL_AUDIT 25 /* syscall auditing active */ |
| 82 | #define TIF_SECCOMP 26 /* secure computing */ |
| 83 | #define TIF_SYSCALL_TRACEPOINT 27 /* syscall tracepoint instrumentation */ |
| 84 | |
Heiko Carstens | 92778b9 | 2015-10-06 16:23:39 +0200 | [diff] [blame] | 85 | #define _TIF_NOTIFY_RESUME _BITUL(TIF_NOTIFY_RESUME) |
| 86 | #define _TIF_SIGPENDING _BITUL(TIF_SIGPENDING) |
| 87 | #define _TIF_NEED_RESCHED _BITUL(TIF_NEED_RESCHED) |
Jiri Slaby | 30d64f1 | 2017-02-13 19:42:33 -0600 | [diff] [blame] | 88 | #define _TIF_UPROBE _BITUL(TIF_UPROBE) |
Linus Torvalds | 76f1948 | 2017-05-02 18:24:16 -0700 | [diff] [blame] | 89 | #define _TIF_GUARDED_STORAGE _BITUL(TIF_GUARDED_STORAGE) |
Miroslav Benes | 2f09ca6 | 2017-02-13 19:42:34 -0600 | [diff] [blame] | 90 | #define _TIF_PATCH_PENDING _BITUL(TIF_PATCH_PENDING) |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 91 | #define _TIF_ISOLATE_BP _BITUL(TIF_ISOLATE_BP) |
| 92 | #define _TIF_ISOLATE_BP_GUEST _BITUL(TIF_ISOLATE_BP_GUEST) |
Jiri Slaby | 30d64f1 | 2017-02-13 19:42:33 -0600 | [diff] [blame] | 93 | |
| 94 | #define _TIF_31BIT _BITUL(TIF_31BIT) |
| 95 | #define _TIF_SINGLE_STEP _BITUL(TIF_SINGLE_STEP) |
| 96 | |
Heiko Carstens | 92778b9 | 2015-10-06 16:23:39 +0200 | [diff] [blame] | 97 | #define _TIF_SYSCALL_TRACE _BITUL(TIF_SYSCALL_TRACE) |
| 98 | #define _TIF_SYSCALL_AUDIT _BITUL(TIF_SYSCALL_AUDIT) |
| 99 | #define _TIF_SECCOMP _BITUL(TIF_SECCOMP) |
| 100 | #define _TIF_SYSCALL_TRACEPOINT _BITUL(TIF_SYSCALL_TRACEPOINT) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | #endif /* _ASM_THREAD_INFO_H */ |