Skip to content

Commit 7601d18

Browse files
committed
Merge tag 'core-core-2025-09-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull TIF bit unification updates from Thomas Gleixner: "A set of changes to consolidate the generic TIF (thread info flag) bits accross architectures. All architectures define the same set of generic TIF bits. This makes it pointlessly hard to add a new generic TIF bit or to change an existing one. Provide a generic variant and convert the architectures which utilize the generic entry code over to use it. The TIF space is divided into 16 generic bits and 16 architecture specific bits, which turned out to provide enough space on both sides" * tag 'core-core-2025-09-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: LoongArch: Fix bitflag conflict for TIF_FIXADE riscv: Use generic TIF bits loongarch: Use generic TIF bits s390/entry: Remove unused TIF flags s390: Use generic TIF bits x86: Use generic TIF bits asm-generic: Provide generic TIF infrastructure
2 parents 22bdd6e + 3ec0934 commit 7601d18

10 files changed

Lines changed: 150 additions & 139 deletions

File tree

arch/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,6 +1778,10 @@ config ARCH_VMLINUX_NEEDS_RELOCS
17781778
relocations preserved. This is used by some architectures to
17791779
construct bespoke relocation tables for KASLR.
17801780

1781+
# Select if architecture uses the common generic TIF bits
1782+
config HAVE_GENERIC_TIF_BITS
1783+
bool
1784+
17811785
source "kernel/gcov/Kconfig"
17821786

17831787
source "scripts/gcc-plugins/Kconfig"

arch/loongarch/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ config LOONGARCH
142142
select HAVE_EBPF_JIT
143143
select HAVE_EFFICIENT_UNALIGNED_ACCESS if !ARCH_STRICT_ALIGN
144144
select HAVE_EXIT_THREAD
145+
select HAVE_GENERIC_TIF_BITS
145146
select HAVE_GUP_FAST
146147
select HAVE_FTRACE_GRAPH_FUNC
147148
select HAVE_FUNCTION_ARG_ACCESS_API

arch/loongarch/include/asm/thread_info.h

Lines changed: 34 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -65,50 +65,42 @@ register unsigned long current_stack_pointer __asm__("$sp");
6565
* access
6666
* - pending work-to-be-done flags are in LSW
6767
* - other flags in MSW
68+
*
69+
* Tell the generic TIF infrastructure which special bits loongarch supports
6870
*/
69-
#define TIF_NEED_RESCHED 0 /* rescheduling necessary */
70-
#define TIF_NEED_RESCHED_LAZY 1 /* lazy rescheduling necessary */
71-
#define TIF_SIGPENDING 2 /* signal pending */
72-
#define TIF_NOTIFY_RESUME 3 /* callback before returning to user */
73-
#define TIF_NOTIFY_SIGNAL 4 /* signal notifications exist */
74-
#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
75-
#define TIF_NOHZ 6 /* in adaptive nohz mode */
76-
#define TIF_UPROBE 7 /* breakpointed or singlestepping */
77-
#define TIF_USEDFPU 8 /* FPU was used by this task this quantum (SMP) */
78-
#define TIF_USEDSIMD 9 /* SIMD has been used this quantum */
79-
#define TIF_MEMDIE 10 /* is terminating due to OOM killer */
80-
#define TIF_FIXADE 11 /* Fix address errors in software */
81-
#define TIF_LOGADE 12 /* Log address errors to syslog */
82-
#define TIF_32BIT_REGS 13 /* 32-bit general purpose registers */
83-
#define TIF_32BIT_ADDR 14 /* 32-bit address space */
84-
#define TIF_LOAD_WATCH 15 /* If set, load watch registers */
85-
#define TIF_SINGLESTEP 16 /* Single Step */
86-
#define TIF_LSX_CTX_LIVE 17 /* LSX context must be preserved */
87-
#define TIF_LASX_CTX_LIVE 18 /* LASX context must be preserved */
88-
#define TIF_USEDLBT 19 /* LBT was used by this task this quantum (SMP) */
89-
#define TIF_LBT_CTX_LIVE 20 /* LBT context must be preserved */
90-
#define TIF_PATCH_PENDING 21 /* pending live patching update */
71+
#define HAVE_TIF_NEED_RESCHED_LAZY
72+
#define HAVE_TIF_RESTORE_SIGMASK
73+
74+
#include <asm-generic/thread_info_tif.h>
75+
76+
/* Architecture specific bits */
77+
#define TIF_NOHZ 16 /* in adaptive nohz mode */
78+
#define TIF_USEDFPU 17 /* FPU was used by this task this quantum (SMP) */
79+
#define TIF_USEDSIMD 18 /* SIMD has been used this quantum */
80+
#define TIF_FIXADE 19 /* Fix address errors in software */
81+
#define TIF_LOGADE 20 /* Log address errors to syslog */
82+
#define TIF_32BIT_REGS 21 /* 32-bit general purpose registers */
83+
#define TIF_32BIT_ADDR 22 /* 32-bit address space */
84+
#define TIF_LOAD_WATCH 23 /* If set, load watch registers */
85+
#define TIF_SINGLESTEP 24 /* Single Step */
86+
#define TIF_LSX_CTX_LIVE 25 /* LSX context must be preserved */
87+
#define TIF_LASX_CTX_LIVE 26 /* LASX context must be preserved */
88+
#define TIF_USEDLBT 27 /* LBT was used by this task this quantum (SMP) */
89+
#define TIF_LBT_CTX_LIVE 28 /* LBT context must be preserved */
9190

92-
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
93-
#define _TIF_NEED_RESCHED_LAZY (1<<TIF_NEED_RESCHED_LAZY)
94-
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
95-
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
96-
#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL)
97-
#define _TIF_NOHZ (1<<TIF_NOHZ)
98-
#define _TIF_UPROBE (1<<TIF_UPROBE)
99-
#define _TIF_USEDFPU (1<<TIF_USEDFPU)
100-
#define _TIF_USEDSIMD (1<<TIF_USEDSIMD)
101-
#define _TIF_FIXADE (1<<TIF_FIXADE)
102-
#define _TIF_LOGADE (1<<TIF_LOGADE)
103-
#define _TIF_32BIT_REGS (1<<TIF_32BIT_REGS)
104-
#define _TIF_32BIT_ADDR (1<<TIF_32BIT_ADDR)
105-
#define _TIF_LOAD_WATCH (1<<TIF_LOAD_WATCH)
106-
#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
107-
#define _TIF_LSX_CTX_LIVE (1<<TIF_LSX_CTX_LIVE)
108-
#define _TIF_LASX_CTX_LIVE (1<<TIF_LASX_CTX_LIVE)
109-
#define _TIF_USEDLBT (1<<TIF_USEDLBT)
110-
#define _TIF_LBT_CTX_LIVE (1<<TIF_LBT_CTX_LIVE)
111-
#define _TIF_PATCH_PENDING (1<<TIF_PATCH_PENDING)
91+
#define _TIF_NOHZ BIT(TIF_NOHZ)
92+
#define _TIF_USEDFPU BIT(TIF_USEDFPU)
93+
#define _TIF_USEDSIMD BIT(TIF_USEDSIMD)
94+
#define _TIF_FIXADE BIT(TIF_FIXADE)
95+
#define _TIF_LOGADE BIT(TIF_LOGADE)
96+
#define _TIF_32BIT_REGS BIT(TIF_32BIT_REGS)
97+
#define _TIF_32BIT_ADDR BIT(TIF_32BIT_ADDR)
98+
#define _TIF_LOAD_WATCH BIT(TIF_LOAD_WATCH)
99+
#define _TIF_SINGLESTEP BIT(TIF_SINGLESTEP)
100+
#define _TIF_LSX_CTX_LIVE BIT(TIF_LSX_CTX_LIVE)
101+
#define _TIF_LASX_CTX_LIVE BIT(TIF_LASX_CTX_LIVE)
102+
#define _TIF_USEDLBT BIT(TIF_USEDLBT)
103+
#define _TIF_LBT_CTX_LIVE BIT(TIF_LBT_CTX_LIVE)
112104

113105
#endif /* __KERNEL__ */
114106
#endif /* _ASM_THREAD_INFO_H */

arch/riscv/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ config RISCV
164164
select HAVE_FUNCTION_GRAPH_FREGS
165165
select HAVE_FUNCTION_TRACER if !XIP_KERNEL && HAVE_DYNAMIC_FTRACE
166166
select HAVE_EBPF_JIT if MMU
167+
select HAVE_GENERIC_TIF_BITS
167168
select HAVE_GUP_FAST if MMU
168169
select HAVE_FUNCTION_ARG_ACCESS_API
169170
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 */

arch/s390/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ config S390
206206
select HAVE_DYNAMIC_FTRACE_WITH_REGS
207207
select HAVE_EBPF_JIT if HAVE_MARCH_Z196_FEATURES
208208
select HAVE_EFFICIENT_UNALIGNED_ACCESS
209+
select HAVE_GENERIC_TIF_BITS
209210
select HAVE_GUP_FAST
210211
select HAVE_FENTRY
211212
select HAVE_FTRACE_GRAPH_FUNC

arch/s390/include/asm/thread_info.h

Lines changed: 16 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -56,49 +56,31 @@ void arch_setup_new_exec(void);
5656

5757
/*
5858
* thread information flags bit numbers
59+
*
60+
* Tell the generic TIF infrastructure which special bits s390 supports
5961
*/
60-
#define TIF_NOTIFY_RESUME 0 /* callback before returning to user */
61-
#define TIF_SIGPENDING 1 /* signal pending */
62-
#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
63-
#define TIF_NEED_RESCHED_LAZY 3 /* lazy rescheduling needed */
64-
#define TIF_UPROBE 4 /* breakpointed or single-stepping */
65-
#define TIF_PATCH_PENDING 5 /* pending live patching update */
66-
#define TIF_ASCE_PRIMARY 6 /* primary asce is kernel asce */
67-
#define TIF_NOTIFY_SIGNAL 7 /* signal notifications exist */
68-
#define TIF_GUARDED_STORAGE 8 /* load guarded storage control block */
69-
#define TIF_ISOLATE_BP_GUEST 9 /* Run KVM guests with isolated BP */
70-
#define TIF_PER_TRAP 10 /* Need to handle PER trap on exit to usermode */
71-
#define TIF_31BIT 16 /* 32bit process */
72-
#define TIF_MEMDIE 17 /* is terminating due to OOM killer */
73-
#define TIF_RESTORE_SIGMASK 18 /* restore signal mask in do_signal() */
74-
#define TIF_SINGLE_STEP 19 /* This task is single stepped */
75-
#define TIF_BLOCK_STEP 20 /* This task is block stepped */
76-
#define TIF_UPROBE_SINGLESTEP 21 /* This task is uprobe single stepped */
77-
#define TIF_SYSCALL_TRACE 24 /* syscall trace active */
78-
#define TIF_SYSCALL_AUDIT 25 /* syscall auditing active */
79-
#define TIF_SECCOMP 26 /* secure computing */
80-
#define TIF_SYSCALL_TRACEPOINT 27 /* syscall tracepoint instrumentation */
62+
#define HAVE_TIF_NEED_RESCHED_LAZY
63+
#define HAVE_TIF_RESTORE_SIGMASK
64+
65+
#include <asm-generic/thread_info_tif.h>
66+
67+
/* Architecture specific bits */
68+
#define TIF_ASCE_PRIMARY 16 /* primary asce is kernel asce */
69+
#define TIF_GUARDED_STORAGE 17 /* load guarded storage control block */
70+
#define TIF_ISOLATE_BP_GUEST 18 /* Run KVM guests with isolated BP */
71+
#define TIF_PER_TRAP 19 /* Need to handle PER trap on exit to usermode */
72+
#define TIF_31BIT 20 /* 32bit process */
73+
#define TIF_SINGLE_STEP 21 /* This task is single stepped */
74+
#define TIF_BLOCK_STEP 22 /* This task is block stepped */
75+
#define TIF_UPROBE_SINGLESTEP 23 /* This task is uprobe single stepped */
8176

82-
#define _TIF_NOTIFY_RESUME BIT(TIF_NOTIFY_RESUME)
83-
#define _TIF_SIGPENDING BIT(TIF_SIGPENDING)
84-
#define _TIF_NEED_RESCHED BIT(TIF_NEED_RESCHED)
85-
#define _TIF_NEED_RESCHED_LAZY BIT(TIF_NEED_RESCHED_LAZY)
86-
#define _TIF_UPROBE BIT(TIF_UPROBE)
87-
#define _TIF_PATCH_PENDING BIT(TIF_PATCH_PENDING)
8877
#define _TIF_ASCE_PRIMARY BIT(TIF_ASCE_PRIMARY)
89-
#define _TIF_NOTIFY_SIGNAL BIT(TIF_NOTIFY_SIGNAL)
9078
#define _TIF_GUARDED_STORAGE BIT(TIF_GUARDED_STORAGE)
9179
#define _TIF_ISOLATE_BP_GUEST BIT(TIF_ISOLATE_BP_GUEST)
9280
#define _TIF_PER_TRAP BIT(TIF_PER_TRAP)
9381
#define _TIF_31BIT BIT(TIF_31BIT)
94-
#define _TIF_MEMDIE BIT(TIF_MEMDIE)
95-
#define _TIF_RESTORE_SIGMASK BIT(TIF_RESTORE_SIGMASK)
9682
#define _TIF_SINGLE_STEP BIT(TIF_SINGLE_STEP)
9783
#define _TIF_BLOCK_STEP BIT(TIF_BLOCK_STEP)
9884
#define _TIF_UPROBE_SINGLESTEP BIT(TIF_UPROBE_SINGLESTEP)
99-
#define _TIF_SYSCALL_TRACE BIT(TIF_SYSCALL_TRACE)
100-
#define _TIF_SYSCALL_AUDIT BIT(TIF_SYSCALL_AUDIT)
101-
#define _TIF_SECCOMP BIT(TIF_SECCOMP)
102-
#define _TIF_SYSCALL_TRACEPOINT BIT(TIF_SYSCALL_TRACEPOINT)
10385

10486
#endif /* _ASM_THREAD_INFO_H */

arch/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ config X86
239239
select HAVE_EFFICIENT_UNALIGNED_ACCESS
240240
select HAVE_EISA if X86_32
241241
select HAVE_EXIT_THREAD
242+
select HAVE_GENERIC_TIF_BITS
242243
select HAVE_GUP_FAST
243244
select HAVE_FENTRY if X86_64 || DYNAMIC_FTRACE
244245
select HAVE_FTRACE_GRAPH_FUNC if HAVE_FUNCTION_GRAPH_TRACER

arch/x86/include/asm/thread_info.h

Lines changed: 31 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -80,56 +80,42 @@ struct thread_info {
8080
#endif
8181

8282
/*
83-
* thread information flags
84-
* - these are process state flags that various assembly files
85-
* may need to access
83+
* Tell the generic TIF infrastructure which bits x86 supports
8684
*/
87-
#define TIF_NOTIFY_RESUME 1 /* callback before returning to user */
88-
#define TIF_SIGPENDING 2 /* signal pending */
89-
#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
90-
#define TIF_NEED_RESCHED_LAZY 4 /* Lazy rescheduling needed */
91-
#define TIF_SINGLESTEP 5 /* reenable singlestep on user return*/
92-
#define TIF_SSBD 6 /* Speculative store bypass disable */
93-
#define TIF_SPEC_IB 9 /* Indirect branch speculation mitigation */
94-
#define TIF_SPEC_L1D_FLUSH 10 /* Flush L1D on mm switches (processes) */
95-
#define TIF_USER_RETURN_NOTIFY 11 /* notify kernel of userspace return */
96-
#define TIF_UPROBE 12 /* breakpointed or singlestepping */
97-
#define TIF_PATCH_PENDING 13 /* pending live patching update */
98-
#define TIF_NEED_FPU_LOAD 14 /* load FPU on return to userspace */
99-
#define TIF_NOCPUID 15 /* CPUID is not accessible in userland */
100-
#define TIF_NOTSC 16 /* TSC is not accessible in userland */
101-
#define TIF_NOTIFY_SIGNAL 17 /* signal notifications exist */
102-
#define TIF_MEMDIE 20 /* is terminating due to OOM killer */
103-
#define TIF_POLLING_NRFLAG 21 /* idle is polling for TIF_NEED_RESCHED */
85+
#define HAVE_TIF_NEED_RESCHED_LAZY
86+
#define HAVE_TIF_POLLING_NRFLAG
87+
#define HAVE_TIF_SINGLESTEP
88+
89+
#include <asm-generic/thread_info_tif.h>
90+
91+
/* Architecture specific TIF space starts at 16 */
92+
#define TIF_SSBD 16 /* Speculative store bypass disable */
93+
#define TIF_SPEC_IB 17 /* Indirect branch speculation mitigation */
94+
#define TIF_SPEC_L1D_FLUSH 18 /* Flush L1D on mm switches (processes) */
95+
#define TIF_NEED_FPU_LOAD 19 /* load FPU on return to userspace */
96+
#define TIF_NOCPUID 20 /* CPUID is not accessible in userland */
97+
#define TIF_NOTSC 21 /* TSC is not accessible in userland */
10498
#define TIF_IO_BITMAP 22 /* uses I/O bitmap */
10599
#define TIF_SPEC_FORCE_UPDATE 23 /* Force speculation MSR update in context switch */
106100
#define TIF_FORCED_TF 24 /* true if TF in eflags artificially */
107-
#define TIF_BLOCKSTEP 25 /* set when we want DEBUGCTLMSR_BTF */
101+
#define TIF_SINGLESTEP 25 /* reenable singlestep on user return*/
102+
#define TIF_BLOCKSTEP 26 /* set when we want DEBUGCTLMSR_BTF */
108103
#define TIF_LAZY_MMU_UPDATES 27 /* task is updating the mmu lazily */
109-
#define TIF_ADDR32 29 /* 32-bit address space on 64 bits */
110-
111-
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
112-
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
113-
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
114-
#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY)
115-
#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
116-
#define _TIF_SSBD (1 << TIF_SSBD)
117-
#define _TIF_SPEC_IB (1 << TIF_SPEC_IB)
118-
#define _TIF_SPEC_L1D_FLUSH (1 << TIF_SPEC_L1D_FLUSH)
119-
#define _TIF_USER_RETURN_NOTIFY (1 << TIF_USER_RETURN_NOTIFY)
120-
#define _TIF_UPROBE (1 << TIF_UPROBE)
121-
#define _TIF_PATCH_PENDING (1 << TIF_PATCH_PENDING)
122-
#define _TIF_NEED_FPU_LOAD (1 << TIF_NEED_FPU_LOAD)
123-
#define _TIF_NOCPUID (1 << TIF_NOCPUID)
124-
#define _TIF_NOTSC (1 << TIF_NOTSC)
125-
#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
126-
#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
127-
#define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP)
128-
#define _TIF_SPEC_FORCE_UPDATE (1 << TIF_SPEC_FORCE_UPDATE)
129-
#define _TIF_FORCED_TF (1 << TIF_FORCED_TF)
130-
#define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP)
131-
#define _TIF_LAZY_MMU_UPDATES (1 << TIF_LAZY_MMU_UPDATES)
132-
#define _TIF_ADDR32 (1 << TIF_ADDR32)
104+
#define TIF_ADDR32 28 /* 32-bit address space on 64 bits */
105+
106+
#define _TIF_SSBD BIT(TIF_SSBD)
107+
#define _TIF_SPEC_IB BIT(TIF_SPEC_IB)
108+
#define _TIF_SPEC_L1D_FLUSH BIT(TIF_SPEC_L1D_FLUSH)
109+
#define _TIF_NEED_FPU_LOAD BIT(TIF_NEED_FPU_LOAD)
110+
#define _TIF_NOCPUID BIT(TIF_NOCPUID)
111+
#define _TIF_NOTSC BIT(TIF_NOTSC)
112+
#define _TIF_IO_BITMAP BIT(TIF_IO_BITMAP)
113+
#define _TIF_SPEC_FORCE_UPDATE BIT(TIF_SPEC_FORCE_UPDATE)
114+
#define _TIF_FORCED_TF BIT(TIF_FORCED_TF)
115+
#define _TIF_BLOCKSTEP BIT(TIF_BLOCKSTEP)
116+
#define _TIF_SINGLESTEP BIT(TIF_SINGLESTEP)
117+
#define _TIF_LAZY_MMU_UPDATES BIT(TIF_LAZY_MMU_UPDATES)
118+
#define _TIF_ADDR32 BIT(TIF_ADDR32)
133119

134120
/* flags to check in __switch_to() */
135121
#define _TIF_WORK_CTXSW_BASE \
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _ASM_GENERIC_THREAD_INFO_TIF_H_
3+
#define _ASM_GENERIC_THREAD_INFO_TIF_H_
4+
5+
#include <vdso/bits.h>
6+
7+
/* Bits 16-31 are reserved for architecture specific purposes */
8+
9+
#define TIF_NOTIFY_RESUME 0 // callback before returning to user
10+
#define _TIF_NOTIFY_RESUME BIT(TIF_NOTIFY_RESUME)
11+
12+
#define TIF_SIGPENDING 1 // signal pending
13+
#define _TIF_SIGPENDING BIT(TIF_SIGPENDING)
14+
15+
#define TIF_NOTIFY_SIGNAL 2 // signal notifications exist
16+
#define _TIF_NOTIFY_SIGNAL BIT(TIF_NOTIFY_SIGNAL)
17+
18+
#define TIF_MEMDIE 3 // is terminating due to OOM killer
19+
#define _TIF_MEMDIE BIT(TIF_MEMDIE)
20+
21+
#define TIF_NEED_RESCHED 4 // rescheduling necessary
22+
#define _TIF_NEED_RESCHED BIT(TIF_NEED_RESCHED)
23+
24+
#ifdef HAVE_TIF_NEED_RESCHED_LAZY
25+
# define TIF_NEED_RESCHED_LAZY 5 // Lazy rescheduling needed
26+
# define _TIF_NEED_RESCHED_LAZY BIT(TIF_NEED_RESCHED_LAZY)
27+
#endif
28+
29+
#ifdef HAVE_TIF_POLLING_NRFLAG
30+
# define TIF_POLLING_NRFLAG 6 // idle is polling for TIF_NEED_RESCHED
31+
# define _TIF_POLLING_NRFLAG BIT(TIF_POLLING_NRFLAG)
32+
#endif
33+
34+
#define TIF_USER_RETURN_NOTIFY 7 // notify kernel of userspace return
35+
#define _TIF_USER_RETURN_NOTIFY BIT(TIF_USER_RETURN_NOTIFY)
36+
37+
#define TIF_UPROBE 8 // breakpointed or singlestepping
38+
#define _TIF_UPROBE BIT(TIF_UPROBE)
39+
40+
#define TIF_PATCH_PENDING 9 // pending live patching update
41+
#define _TIF_PATCH_PENDING BIT(TIF_PATCH_PENDING)
42+
43+
#ifdef HAVE_TIF_RESTORE_SIGMASK
44+
# define TIF_RESTORE_SIGMASK 10 // Restore signal mask in do_signal() */
45+
# define _TIF_RESTORE_SIGMASK BIT(TIF_RESTORE_SIGMASK)
46+
#endif
47+
48+
#endif /* _ASM_GENERIC_THREAD_INFO_TIF_H_ */

0 commit comments

Comments
 (0)