hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/arch/riscv/include/asm/thread_info.h
....@@ -1,16 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2009 Chen Liqin <liqin.chen@sunplusct.com>
34 * Copyright (C) 2012 Regents of the University of California
45 * Copyright (C) 2017 SiFive
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License
8
- * as published by the Free Software Foundation, version 2.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
146 */
157
168 #ifndef _ASM_RISCV_THREAD_INFO_H
....@@ -19,11 +11,17 @@
1911 #include <asm/page.h>
2012 #include <linux/const.h>
2113
14
+#ifdef CONFIG_KASAN
15
+#define KASAN_STACK_ORDER 1
16
+#else
17
+#define KASAN_STACK_ORDER 0
18
+#endif
19
+
2220 /* thread information allocation */
2321 #ifdef CONFIG_64BIT
24
-#define THREAD_SIZE_ORDER (2)
22
+#define THREAD_SIZE_ORDER (2 + KASAN_STACK_ORDER)
2523 #else
26
-#define THREAD_SIZE_ORDER (1)
24
+#define THREAD_SIZE_ORDER (1 + KASAN_STACK_ORDER)
2725 #endif
2826 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
2927
....@@ -31,8 +29,6 @@
3129
3230 #include <asm/processor.h>
3331 #include <asm/csr.h>
34
-
35
-typedef unsigned long mm_segment_t;
3632
3733 /*
3834 * low level task data that entry.S needs immediate access to
....@@ -45,7 +41,6 @@
4541 struct thread_info {
4642 unsigned long flags; /* low level flags */
4743 int preempt_count; /* 0=>preemptible, <0=>BUG */
48
- mm_segment_t addr_limit;
4944 /*
5045 * These stack pointers are overwritten on every system call or
5146 * exception. SP is also saved to the stack it can be recovered when
....@@ -65,7 +60,6 @@
6560 { \
6661 .flags = 0, \
6762 .preempt_count = INIT_PREEMPT_COUNT, \
68
- .addr_limit = KERNEL_DS, \
6963 }
7064
7165 #endif /* !__ASSEMBLY__ */
....@@ -84,13 +78,25 @@
8478 #define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */
8579 #define TIF_MEMDIE 5 /* is terminating due to OOM killer */
8680 #define TIF_SYSCALL_TRACEPOINT 6 /* syscall tracepoint instrumentation */
81
+#define TIF_SYSCALL_AUDIT 7 /* syscall auditing */
82
+#define TIF_SECCOMP 8 /* syscall secure computing */
83
+#define TIF_NOTIFY_SIGNAL 9 /* signal notifications exist */
8784
8885 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
8986 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
9087 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
9188 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
89
+#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
90
+#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
91
+#define _TIF_SECCOMP (1 << TIF_SECCOMP)
92
+#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
9293
9394 #define _TIF_WORK_MASK \
94
- (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | _TIF_NEED_RESCHED)
95
+ (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | _TIF_NEED_RESCHED | \
96
+ _TIF_NOTIFY_SIGNAL)
97
+
98
+#define _TIF_SYSCALL_WORK \
99
+ (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_TRACEPOINT | _TIF_SYSCALL_AUDIT | \
100
+ _TIF_SECCOMP)
95101
96102 #endif /* _ASM_RISCV_THREAD_INFO_H */