.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2009 Chen Liqin <liqin.chen@sunplusct.com> |
---|
3 | 4 | * Copyright (C) 2012 Regents of the University of California |
---|
4 | 5 | * 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. |
---|
14 | 6 | */ |
---|
15 | 7 | |
---|
16 | 8 | #ifndef _ASM_RISCV_THREAD_INFO_H |
---|
.. | .. |
---|
19 | 11 | #include <asm/page.h> |
---|
20 | 12 | #include <linux/const.h> |
---|
21 | 13 | |
---|
| 14 | +#ifdef CONFIG_KASAN |
---|
| 15 | +#define KASAN_STACK_ORDER 1 |
---|
| 16 | +#else |
---|
| 17 | +#define KASAN_STACK_ORDER 0 |
---|
| 18 | +#endif |
---|
| 19 | + |
---|
22 | 20 | /* thread information allocation */ |
---|
23 | 21 | #ifdef CONFIG_64BIT |
---|
24 | | -#define THREAD_SIZE_ORDER (2) |
---|
| 22 | +#define THREAD_SIZE_ORDER (2 + KASAN_STACK_ORDER) |
---|
25 | 23 | #else |
---|
26 | | -#define THREAD_SIZE_ORDER (1) |
---|
| 24 | +#define THREAD_SIZE_ORDER (1 + KASAN_STACK_ORDER) |
---|
27 | 25 | #endif |
---|
28 | 26 | #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) |
---|
29 | 27 | |
---|
.. | .. |
---|
31 | 29 | |
---|
32 | 30 | #include <asm/processor.h> |
---|
33 | 31 | #include <asm/csr.h> |
---|
34 | | - |
---|
35 | | -typedef unsigned long mm_segment_t; |
---|
36 | 32 | |
---|
37 | 33 | /* |
---|
38 | 34 | * low level task data that entry.S needs immediate access to |
---|
.. | .. |
---|
45 | 41 | struct thread_info { |
---|
46 | 42 | unsigned long flags; /* low level flags */ |
---|
47 | 43 | int preempt_count; /* 0=>preemptible, <0=>BUG */ |
---|
48 | | - mm_segment_t addr_limit; |
---|
49 | 44 | /* |
---|
50 | 45 | * These stack pointers are overwritten on every system call or |
---|
51 | 46 | * exception. SP is also saved to the stack it can be recovered when |
---|
.. | .. |
---|
65 | 60 | { \ |
---|
66 | 61 | .flags = 0, \ |
---|
67 | 62 | .preempt_count = INIT_PREEMPT_COUNT, \ |
---|
68 | | - .addr_limit = KERNEL_DS, \ |
---|
69 | 63 | } |
---|
70 | 64 | |
---|
71 | 65 | #endif /* !__ASSEMBLY__ */ |
---|
.. | .. |
---|
84 | 78 | #define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */ |
---|
85 | 79 | #define TIF_MEMDIE 5 /* is terminating due to OOM killer */ |
---|
86 | 80 | #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 */ |
---|
87 | 84 | |
---|
88 | 85 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
---|
89 | 86 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
---|
90 | 87 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
---|
91 | 88 | #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) |
---|
92 | 93 | |
---|
93 | 94 | #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) |
---|
95 | 101 | |
---|
96 | 102 | #endif /* _ASM_RISCV_THREAD_INFO_H */ |
---|