0001
0002
0003
0004
0005 #include <asm/spec-ctrl.h>
0006
0007 void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p);
0008
0009
0010
0011
0012
0013 static inline void switch_to_extra(struct task_struct *prev,
0014 struct task_struct *next)
0015 {
0016 unsigned long next_tif = read_task_thread_flags(next);
0017 unsigned long prev_tif = read_task_thread_flags(prev);
0018
0019 if (IS_ENABLED(CONFIG_SMP)) {
0020
0021
0022
0023
0024
0025
0026 if (!static_branch_likely(&switch_to_cond_stibp)) {
0027 prev_tif &= ~_TIF_SPEC_IB;
0028 next_tif &= ~_TIF_SPEC_IB;
0029 }
0030 }
0031
0032
0033
0034
0035
0036 if (unlikely(next_tif & _TIF_WORK_CTXSW_NEXT ||
0037 prev_tif & _TIF_WORK_CTXSW_PREV))
0038 __switch_to_xtra(prev, next);
0039 }