Skip to content

Commit da3f033

Browse files
committed
x86: 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 x86. So no further action required here. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
1 parent 2958934 commit da3f033

2 files changed

Lines changed: 32 additions & 45 deletions

File tree

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 \

0 commit comments

Comments
 (0)