Skip to content

Commit 41e871f

Browse files
committed
riscv: Use generic TIF bits
No point in defining generic items and the upcoming RSEQ optimizations are only available with this _and_ the generic entry infrastructure, which is already used by RISCV. So no further action required here. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent f962989 commit 41e871f

2 files changed

Lines changed: 14 additions & 18 deletions

File tree

arch/riscv/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ config RISCV
161161
select HAVE_FUNCTION_GRAPH_FREGS
162162
select HAVE_FUNCTION_TRACER if !XIP_KERNEL && HAVE_DYNAMIC_FTRACE
163163
select HAVE_EBPF_JIT if MMU
164+
select HAVE_GENERIC_TIF_BITS
164165
select HAVE_GUP_FAST if MMU
165166
select HAVE_FUNCTION_ARG_ACCESS_API
166167
select HAVE_FUNCTION_ERROR_INJECTION

arch/riscv/include/asm/thread_info.h

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,18 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
107107
* - pending work-to-be-done flags are in lowest half-word
108108
* - other flags in upper half-word(s)
109109
*/
110-
#define TIF_NEED_RESCHED 0 /* rescheduling necessary */
111-
#define TIF_NEED_RESCHED_LAZY 1 /* Lazy rescheduling needed */
112-
#define TIF_NOTIFY_RESUME 2 /* callback before returning to user */
113-
#define TIF_SIGPENDING 3 /* signal pending */
114-
#define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */
115-
#define TIF_MEMDIE 5 /* is terminating due to OOM killer */
116-
#define TIF_NOTIFY_SIGNAL 9 /* signal notifications exist */
117-
#define TIF_UPROBE 10 /* uprobe breakpoint or singlestep */
118-
#define TIF_32BIT 11 /* compat-mode 32bit process */
119-
#define TIF_RISCV_V_DEFER_RESTORE 12 /* restore Vector before returing to user */
120-
121-
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
122-
#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY)
123-
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
124-
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
125-
#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
126-
#define _TIF_UPROBE (1 << TIF_UPROBE)
127-
#define _TIF_RISCV_V_DEFER_RESTORE (1 << TIF_RISCV_V_DEFER_RESTORE)
110+
111+
/*
112+
* Tell the generic TIF infrastructure which bits riscv supports
113+
*/
114+
#define HAVE_TIF_NEED_RESCHED_LAZY
115+
#define HAVE_TIF_RESTORE_SIGMASK
116+
117+
#include <asm-generic/thread_info_tif.h>
118+
119+
#define TIF_32BIT 16 /* compat-mode 32bit process */
120+
#define TIF_RISCV_V_DEFER_RESTORE 17 /* restore Vector before returing to user */
121+
122+
#define _TIF_RISCV_V_DEFER_RESTORE BIT(TIF_RISCV_V_DEFER_RESTORE)
128123

129124
#endif /* _ASM_RISCV_THREAD_INFO_H */

0 commit comments

Comments
 (0)