.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Based on arch/arm/include/asm/thread_info.h |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2002 Russell King. |
---|
5 | 6 | * Copyright (C) 2012 ARM Ltd. |
---|
6 | | - * |
---|
7 | | - * This program is free software; you can redistribute it and/or modify |
---|
8 | | - * it under the terms of the GNU General Public License version 2 as |
---|
9 | | - * published by the Free Software Foundation. |
---|
10 | | - * |
---|
11 | | - * This program is distributed in the hope that it will be useful, |
---|
12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | | - * GNU General Public License for more details. |
---|
15 | | - * |
---|
16 | | - * You should have received a copy of the GNU General Public License |
---|
17 | | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
18 | 7 | */ |
---|
19 | 8 | #ifndef __ASM_THREAD_INFO_H |
---|
20 | 9 | #define __ASM_THREAD_INFO_H |
---|
21 | | - |
---|
22 | | -#ifdef __KERNEL__ |
---|
23 | 10 | |
---|
24 | 11 | #include <linux/compiler.h> |
---|
25 | 12 | |
---|
.. | .. |
---|
42 | 29 | #ifdef CONFIG_ARM64_SW_TTBR0_PAN |
---|
43 | 30 | u64 ttbr0; /* saved TTBR0_EL1 */ |
---|
44 | 31 | #endif |
---|
45 | | - int preempt_count; /* 0 => preemptable, <0 => bug */ |
---|
46 | | - int preempt_lazy_count; /* 0 => preemptable, <0 => bug */ |
---|
| 32 | + union { |
---|
| 33 | + u64 preempt_count; /* 0 => preemptible, <0 => bug */ |
---|
| 34 | + struct { |
---|
| 35 | +#ifdef CONFIG_CPU_BIG_ENDIAN |
---|
| 36 | + u32 need_resched; |
---|
| 37 | + u32 count; |
---|
| 38 | +#else |
---|
| 39 | + u32 count; |
---|
| 40 | + u32 need_resched; |
---|
| 41 | +#endif |
---|
| 42 | + } preempt; |
---|
| 43 | + }; |
---|
47 | 44 | #ifdef CONFIG_SHADOW_CALL_STACK |
---|
48 | | - void *shadow_call_stack; |
---|
| 45 | + void *scs_base; |
---|
| 46 | + void *scs_sp; |
---|
49 | 47 | #endif |
---|
50 | 48 | }; |
---|
51 | 49 | |
---|
.. | .. |
---|
63 | 61 | |
---|
64 | 62 | #endif |
---|
65 | 63 | |
---|
66 | | -/* |
---|
67 | | - * thread information flags: |
---|
68 | | - * TIF_SYSCALL_TRACE - syscall trace active |
---|
69 | | - * TIF_SYSCALL_TRACEPOINT - syscall tracepoint for ftrace |
---|
70 | | - * TIF_SYSCALL_AUDIT - syscall auditing |
---|
71 | | - * TIF_SECOMP - syscall secure computing |
---|
72 | | - * TIF_SIGPENDING - signal pending |
---|
73 | | - * TIF_NEED_RESCHED - rescheduling necessary |
---|
74 | | - * TIF_NOTIFY_RESUME - callback before returning to user |
---|
75 | | - * TIF_USEDFPU - FPU was used by this task this quantum (SMP) |
---|
76 | | - */ |
---|
77 | | -#define TIF_SIGPENDING 0 |
---|
78 | | -#define TIF_NEED_RESCHED 1 |
---|
| 64 | +#define TIF_SIGPENDING 0 /* signal pending */ |
---|
| 65 | +#define TIF_NEED_RESCHED 1 /* rescheduling necessary */ |
---|
79 | 66 | #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ |
---|
80 | 67 | #define TIF_FOREIGN_FPSTATE 3 /* CPU's FP state is not current's */ |
---|
81 | 68 | #define TIF_UPROBE 4 /* uprobe breakpoint or singlestep */ |
---|
82 | 69 | #define TIF_FSCHECK 5 /* Check FS is USER_DS on return */ |
---|
83 | | -#define TIF_NEED_RESCHED_LAZY 6 |
---|
84 | | -#define TIF_NOHZ 7 |
---|
85 | | -#define TIF_SYSCALL_TRACE 8 |
---|
86 | | -#define TIF_SYSCALL_AUDIT 9 |
---|
87 | | -#define TIF_SYSCALL_TRACEPOINT 10 |
---|
88 | | -#define TIF_SECCOMP 11 |
---|
| 70 | +#define TIF_MTE_ASYNC_FAULT 6 /* MTE Asynchronous Tag Check Fault */ |
---|
| 71 | +#define TIF_NOTIFY_SIGNAL 7 /* signal notifications exist */ |
---|
| 72 | +#define TIF_SYSCALL_TRACE 8 /* syscall trace active */ |
---|
| 73 | +#define TIF_SYSCALL_AUDIT 9 /* syscall auditing */ |
---|
| 74 | +#define TIF_SYSCALL_TRACEPOINT 10 /* syscall tracepoint for ftrace */ |
---|
| 75 | +#define TIF_SECCOMP 11 /* syscall secure computing */ |
---|
| 76 | +#define TIF_SYSCALL_EMU 12 /* syscall emulation active */ |
---|
89 | 77 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ |
---|
90 | 78 | #define TIF_FREEZE 19 |
---|
91 | 79 | #define TIF_RESTORE_SIGMASK 20 |
---|
.. | .. |
---|
100 | 88 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
---|
101 | 89 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
---|
102 | 90 | #define _TIF_FOREIGN_FPSTATE (1 << TIF_FOREIGN_FPSTATE) |
---|
103 | | -#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY) |
---|
104 | | -#define _TIF_NOHZ (1 << TIF_NOHZ) |
---|
105 | 91 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
---|
106 | 92 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) |
---|
107 | 93 | #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) |
---|
108 | 94 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) |
---|
| 95 | +#define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU) |
---|
109 | 96 | #define _TIF_UPROBE (1 << TIF_UPROBE) |
---|
110 | 97 | #define _TIF_FSCHECK (1 << TIF_FSCHECK) |
---|
111 | 98 | #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) |
---|
112 | 99 | #define _TIF_32BIT (1 << TIF_32BIT) |
---|
113 | 100 | #define _TIF_SVE (1 << TIF_SVE) |
---|
| 101 | +#define _TIF_MTE_ASYNC_FAULT (1 << TIF_MTE_ASYNC_FAULT) |
---|
| 102 | +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL) |
---|
114 | 103 | |
---|
115 | 104 | #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ |
---|
116 | 105 | _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \ |
---|
117 | | - _TIF_UPROBE | _TIF_FSCHECK | _TIF_NEED_RESCHED_LAZY) |
---|
| 106 | + _TIF_UPROBE | _TIF_FSCHECK | _TIF_MTE_ASYNC_FAULT | \ |
---|
| 107 | + _TIF_NOTIFY_SIGNAL) |
---|
118 | 108 | |
---|
119 | | -#define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY) |
---|
120 | 109 | #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ |
---|
121 | 110 | _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \ |
---|
122 | | - _TIF_NOHZ) |
---|
| 111 | + _TIF_SYSCALL_EMU) |
---|
| 112 | + |
---|
| 113 | +#ifdef CONFIG_SHADOW_CALL_STACK |
---|
| 114 | +#define INIT_SCS \ |
---|
| 115 | + .scs_base = init_shadow_call_stack, \ |
---|
| 116 | + .scs_sp = init_shadow_call_stack, |
---|
| 117 | +#else |
---|
| 118 | +#define INIT_SCS |
---|
| 119 | +#endif |
---|
123 | 120 | |
---|
124 | 121 | #define INIT_THREAD_INFO(tsk) \ |
---|
125 | 122 | { \ |
---|
126 | 123 | .flags = _TIF_FOREIGN_FPSTATE, \ |
---|
127 | 124 | .preempt_count = INIT_PREEMPT_COUNT, \ |
---|
128 | 125 | .addr_limit = KERNEL_DS, \ |
---|
| 126 | + INIT_SCS \ |
---|
129 | 127 | } |
---|
130 | 128 | |
---|
131 | | -#endif /* __KERNEL__ */ |
---|
132 | 129 | #endif /* __ASM_THREAD_INFO_H */ |
---|