forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/arch/arm64/include/asm/thread_info.h
....@@ -1,25 +1,12 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Based on arch/arm/include/asm/thread_info.h
34 *
45 * Copyright (C) 2002 Russell King.
56 * 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/>.
187 */
198 #ifndef __ASM_THREAD_INFO_H
209 #define __ASM_THREAD_INFO_H
21
-
22
-#ifdef __KERNEL__
2310
2411 #include <linux/compiler.h>
2512
....@@ -42,10 +29,22 @@
4229 #ifdef CONFIG_ARM64_SW_TTBR0_PAN
4330 u64 ttbr0; /* saved TTBR0_EL1 */
4431 #endif
45
- int preempt_count; /* 0 => preemptable, <0 => bug */
46
- int preempt_lazy_count; /* 0 => preemptable, <0 => bug */
32
+ int preempt_lazy_count; /* 0 => preemptable, <0 => bug */
33
+ union {
34
+ u64 preempt_count; /* 0 => preemptible, <0 => bug */
35
+ struct {
36
+#ifdef CONFIG_CPU_BIG_ENDIAN
37
+ u32 need_resched;
38
+ u32 count;
39
+#else
40
+ u32 count;
41
+ u32 need_resched;
42
+#endif
43
+ } preempt;
44
+ };
4745 #ifdef CONFIG_SHADOW_CALL_STACK
48
- void *shadow_call_stack;
46
+ void *scs_base;
47
+ void *scs_sp;
4948 #endif
5049 };
5150
....@@ -63,29 +62,20 @@
6362
6463 #endif
6564
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
65
+#define TIF_SIGPENDING 0 /* signal pending */
66
+#define TIF_NEED_RESCHED 1 /* rescheduling necessary */
7967 #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */
8068 #define TIF_FOREIGN_FPSTATE 3 /* CPU's FP state is not current's */
8169 #define TIF_UPROBE 4 /* uprobe breakpoint or singlestep */
8270 #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
71
+#define TIF_MTE_ASYNC_FAULT 6 /* MTE Asynchronous Tag Check Fault */
72
+#define TIF_NOTIFY_SIGNAL 7 /* signal notifications exist */
73
+#define TIF_NEED_RESCHED_LAZY 8
74
+#define TIF_SYSCALL_TRACE 9 /* syscall trace active */
75
+#define TIF_SYSCALL_AUDIT 10 /* syscall auditing */
76
+#define TIF_SYSCALL_TRACEPOINT 11 /* syscall tracepoint for ftrace */
77
+#define TIF_SECCOMP 12 /* syscall secure computing */
78
+#define TIF_SYSCALL_EMU 13 /* syscall emulation active */
8979 #define TIF_MEMDIE 18 /* is terminating due to OOM killer */
9080 #define TIF_FREEZE 19
9181 #define TIF_RESTORE_SIGMASK 20
....@@ -100,33 +90,44 @@
10090 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
10191 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
10292 #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)
10593 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
10694 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
10795 #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
10896 #define _TIF_SECCOMP (1 << TIF_SECCOMP)
97
+#define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU)
10998 #define _TIF_UPROBE (1 << TIF_UPROBE)
11099 #define _TIF_FSCHECK (1 << TIF_FSCHECK)
111100 #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
112101 #define _TIF_32BIT (1 << TIF_32BIT)
113102 #define _TIF_SVE (1 << TIF_SVE)
103
+#define _TIF_MTE_ASYNC_FAULT (1 << TIF_MTE_ASYNC_FAULT)
104
+#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY)
105
+#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
114106
115107 #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
116108 _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \
117
- _TIF_UPROBE | _TIF_FSCHECK | _TIF_NEED_RESCHED_LAZY)
109
+ _TIF_UPROBE | _TIF_FSCHECK | _TIF_MTE_ASYNC_FAULT | \
110
+ _TIF_NEED_RESCHED_LAZY | _TIF_NOTIFY_SIGNAL)
118111
119112 #define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)
120113 #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
121114 _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \
122
- _TIF_NOHZ)
115
+ _TIF_SYSCALL_EMU)
116
+
117
+#ifdef CONFIG_SHADOW_CALL_STACK
118
+#define INIT_SCS \
119
+ .scs_base = init_shadow_call_stack, \
120
+ .scs_sp = init_shadow_call_stack,
121
+#else
122
+#define INIT_SCS
123
+#endif
123124
124125 #define INIT_THREAD_INFO(tsk) \
125126 { \
126127 .flags = _TIF_FOREIGN_FPSTATE, \
127128 .preempt_count = INIT_PREEMPT_COUNT, \
128129 .addr_limit = KERNEL_DS, \
130
+ INIT_SCS \
129131 }
130132
131
-#endif /* __KERNEL__ */
132133 #endif /* __ASM_THREAD_INFO_H */