| .. | .. | 
|---|
| 56 | 56 |  struct thread_info { | 
|---|
| 57 | 57 |  	unsigned long		flags;		/* low level flags */ | 
|---|
| 58 | 58 |  	u32			status;		/* thread synchronous flags */ | 
|---|
| 59 |  | -	int			preempt_lazy_count;	/* 0 => lazy preemptable  | 
|---|
| 60 |  | -							  <0 => BUG */  | 
|---|
| 61 | 59 |  }; | 
|---|
| 62 | 60 |   | 
|---|
| 63 | 61 |  #define INIT_THREAD_INFO(tsk)			\ | 
|---|
| 64 | 62 |  {						\ | 
|---|
| 65 | 63 |  	.flags		= 0,			\ | 
|---|
| 66 |  | -	.preempt_lazy_count = 0,		\  | 
|---|
| 67 | 64 |  } | 
|---|
| 68 | 65 |   | 
|---|
| 69 | 66 |  #else /* !__ASSEMBLY__ */ | 
|---|
| 70 | 67 |   | 
|---|
| 71 | 68 |  #include <asm/asm-offsets.h> | 
|---|
| 72 |  | -  | 
|---|
| 73 |  | -#define GET_THREAD_INFO(reg) \  | 
|---|
| 74 |  | -	_ASM_MOV PER_CPU_VAR(cpu_current_top_of_stack),reg ; \  | 
|---|
| 75 |  | -	_ASM_SUB $(THREAD_SIZE),reg ;  | 
|---|
| 76 | 69 |   | 
|---|
| 77 | 70 |  #endif | 
|---|
| 78 | 71 |   | 
|---|
| .. | .. | 
|---|
| 95 | 88 |  #define TIF_USER_RETURN_NOTIFY	11	/* notify kernel of userspace return */ | 
|---|
| 96 | 89 |  #define TIF_UPROBE		12	/* breakpointed or singlestepping */ | 
|---|
| 97 | 90 |  #define TIF_PATCH_PENDING	13	/* pending live patching update */ | 
|---|
 | 91 | +#define TIF_NEED_FPU_LOAD	14	/* load FPU on return to userspace */  | 
|---|
| 98 | 92 |  #define TIF_NOCPUID		15	/* CPUID is not accessible in userland */ | 
|---|
| 99 | 93 |  #define TIF_NOTSC		16	/* TSC is not accessible in userland */ | 
|---|
| 100 | 94 |  #define TIF_IA32		17	/* IA32 compatibility process */ | 
|---|
| 101 |  | -#define TIF_NEED_RESCHED_LAZY	18	/* lazy rescheduling necessary */  | 
|---|
| 102 |  | -#define TIF_NOHZ		19	/* in adaptive nohz mode */  | 
|---|
 | 95 | +#define TIF_SLD			18	/* Restore split lock detection on context switch */  | 
|---|
 | 96 | +#define TIF_NOTIFY_SIGNAL	19	/* signal notifications exist */  | 
|---|
| 103 | 97 |  #define TIF_MEMDIE		20	/* is terminating due to OOM killer */ | 
|---|
| 104 | 98 |  #define TIF_POLLING_NRFLAG	21	/* idle is polling for TIF_NEED_RESCHED */ | 
|---|
| 105 | 99 |  #define TIF_IO_BITMAP		22	/* uses I/O bitmap */ | 
|---|
| .. | .. | 
|---|
| 109 | 103 |  #define TIF_SYSCALL_TRACEPOINT	28	/* syscall tracepoint instrumentation */ | 
|---|
| 110 | 104 |  #define TIF_ADDR32		29	/* 32-bit address space on 64 bits */ | 
|---|
| 111 | 105 |  #define TIF_X32			30	/* 32-bit native x86-64 binary */ | 
|---|
| 112 |  | -#define TIF_FSCHECK		31	/* Check FS is USER_DS on return */  | 
|---|
| 113 | 106 |   | 
|---|
| 114 | 107 |  #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE) | 
|---|
| 115 | 108 |  #define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME) | 
|---|
| .. | .. | 
|---|
| 125 | 118 |  #define _TIF_USER_RETURN_NOTIFY	(1 << TIF_USER_RETURN_NOTIFY) | 
|---|
| 126 | 119 |  #define _TIF_UPROBE		(1 << TIF_UPROBE) | 
|---|
| 127 | 120 |  #define _TIF_PATCH_PENDING	(1 << TIF_PATCH_PENDING) | 
|---|
 | 121 | +#define _TIF_NEED_FPU_LOAD	(1 << TIF_NEED_FPU_LOAD)  | 
|---|
| 128 | 122 |  #define _TIF_NOCPUID		(1 << TIF_NOCPUID) | 
|---|
| 129 | 123 |  #define _TIF_NOTSC		(1 << TIF_NOTSC) | 
|---|
| 130 | 124 |  #define _TIF_IA32		(1 << TIF_IA32) | 
|---|
| 131 |  | -#define _TIF_NEED_RESCHED_LAZY	(1 << TIF_NEED_RESCHED_LAZY)  | 
|---|
| 132 |  | -#define _TIF_NOHZ		(1 << TIF_NOHZ)  | 
|---|
 | 125 | +#define _TIF_NOTIFY_SIGNAL	(1 << TIF_NOTIFY_SIGNAL)  | 
|---|
 | 126 | +#define _TIF_SLD		(1 << TIF_SLD)  | 
|---|
| 133 | 127 |  #define _TIF_POLLING_NRFLAG	(1 << TIF_POLLING_NRFLAG) | 
|---|
| 134 | 128 |  #define _TIF_IO_BITMAP		(1 << TIF_IO_BITMAP) | 
|---|
| 135 | 129 |  #define _TIF_FORCED_TF		(1 << TIF_FORCED_TF) | 
|---|
| .. | .. | 
|---|
| 138 | 132 |  #define _TIF_SYSCALL_TRACEPOINT	(1 << TIF_SYSCALL_TRACEPOINT) | 
|---|
| 139 | 133 |  #define _TIF_ADDR32		(1 << TIF_ADDR32) | 
|---|
| 140 | 134 |  #define _TIF_X32		(1 << TIF_X32) | 
|---|
| 141 |  | -#define _TIF_FSCHECK		(1 << TIF_FSCHECK)  | 
|---|
| 142 |  | -  | 
|---|
| 143 |  | -/*  | 
|---|
| 144 |  | - * work to do in syscall_trace_enter().  Also includes TIF_NOHZ for  | 
|---|
| 145 |  | - * enter_from_user_mode()  | 
|---|
| 146 |  | - */  | 
|---|
| 147 |  | -#define _TIF_WORK_SYSCALL_ENTRY	\  | 
|---|
| 148 |  | -	(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU | _TIF_SYSCALL_AUDIT |	\  | 
|---|
| 149 |  | -	 _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT |	\  | 
|---|
| 150 |  | -	 _TIF_NOHZ)  | 
|---|
| 151 |  | -  | 
|---|
| 152 |  | -/* work to do on any return to user space */  | 
|---|
| 153 |  | -#define _TIF_ALLWORK_MASK						\  | 
|---|
| 154 |  | -	(_TIF_SYSCALL_TRACE | _TIF_NOTIFY_RESUME | _TIF_SIGPENDING |	\  | 
|---|
| 155 |  | -	 _TIF_NEED_RESCHED | _TIF_SINGLESTEP | _TIF_SYSCALL_EMU |	\  | 
|---|
| 156 |  | -	 _TIF_SYSCALL_AUDIT | _TIF_USER_RETURN_NOTIFY | _TIF_UPROBE |	\  | 
|---|
| 157 |  | -	 _TIF_PATCH_PENDING | _TIF_NOHZ | _TIF_SYSCALL_TRACEPOINT |	\  | 
|---|
| 158 |  | -	 _TIF_FSCHECK)  | 
|---|
| 159 | 135 |   | 
|---|
| 160 | 136 |  /* flags to check in __switch_to() */ | 
|---|
| 161 |  | -#define _TIF_WORK_CTXSW_BASE						\  | 
|---|
| 162 |  | -	(_TIF_IO_BITMAP|_TIF_NOCPUID|_TIF_NOTSC|_TIF_BLOCKSTEP|		\  | 
|---|
| 163 |  | -	 _TIF_SSBD | _TIF_SPEC_FORCE_UPDATE)  | 
|---|
 | 137 | +#define _TIF_WORK_CTXSW_BASE					\  | 
|---|
 | 138 | +	(_TIF_NOCPUID | _TIF_NOTSC | _TIF_BLOCKSTEP |		\  | 
|---|
 | 139 | +	 _TIF_SSBD | _TIF_SPEC_FORCE_UPDATE | _TIF_SLD)  | 
|---|
| 164 | 140 |   | 
|---|
| 165 | 141 |  /* | 
|---|
| 166 | 142 |   * Avoid calls to __switch_to_xtra() on UP as STIBP is not evaluated. | 
|---|
| .. | .. | 
|---|
| 171 | 147 |  # define _TIF_WORK_CTXSW	(_TIF_WORK_CTXSW_BASE) | 
|---|
| 172 | 148 |  #endif | 
|---|
| 173 | 149 |   | 
|---|
| 174 |  | -#define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)  | 
|---|
| 175 |  | -#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)  | 
|---|
 | 150 | +#ifdef CONFIG_X86_IOPL_IOPERM  | 
|---|
 | 151 | +# define _TIF_WORK_CTXSW_PREV	(_TIF_WORK_CTXSW| _TIF_USER_RETURN_NOTIFY | \  | 
|---|
 | 152 | +				 _TIF_IO_BITMAP)  | 
|---|
 | 153 | +#else  | 
|---|
 | 154 | +# define _TIF_WORK_CTXSW_PREV	(_TIF_WORK_CTXSW| _TIF_USER_RETURN_NOTIFY)  | 
|---|
 | 155 | +#endif  | 
|---|
| 176 | 156 |   | 
|---|
| 177 |  | -#define _TIF_NEED_RESCHED_MASK	(_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)  | 
|---|
 | 157 | +#define _TIF_WORK_CTXSW_NEXT	(_TIF_WORK_CTXSW)  | 
|---|
| 178 | 158 |   | 
|---|
| 179 | 159 |  #define STACK_WARN		(THREAD_SIZE/8) | 
|---|
| 180 | 160 |   | 
|---|
| .. | .. | 
|---|
| 270 | 250 |  #define in_ia32_syscall() (IS_ENABLED(CONFIG_IA32_EMULATION) && \ | 
|---|
| 271 | 251 |  			   current_thread_info()->status & TS_COMPAT) | 
|---|
| 272 | 252 |  #endif | 
|---|
| 273 |  | -  | 
|---|
| 274 |  | -/*  | 
|---|
| 275 |  | - * Force syscall return via IRET by making it look as if there was  | 
|---|
| 276 |  | - * some work pending. IRET is our most capable (but slowest) syscall  | 
|---|
| 277 |  | - * return path, which is able to restore modified SS, CS and certain  | 
|---|
| 278 |  | - * EFLAGS values that other (fast) syscall return instructions  | 
|---|
| 279 |  | - * are not able to restore properly.  | 
|---|
| 280 |  | - */  | 
|---|
| 281 |  | -#define force_iret() set_thread_flag(TIF_NOTIFY_RESUME)  | 
|---|
| 282 | 253 |   | 
|---|
| 283 | 254 |  extern void arch_task_cache_init(void); | 
|---|
| 284 | 255 |  extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); | 
|---|