|
@@ -287,6 +287,15 @@ static __always_inline void load_seg_legacy(unsigned short prev_index,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static __always_inline void x86_fsgsbase_load(struct thread_struct *prev,
|
|
|
+ struct thread_struct *next)
|
|
|
+{
|
|
|
+ load_seg_legacy(prev->fsindex, prev->fsbase,
|
|
|
+ next->fsindex, next->fsbase, FS);
|
|
|
+ load_seg_legacy(prev->gsindex, prev->gsbase,
|
|
|
+ next->gsindex, next->gsbase, GS);
|
|
|
+}
|
|
|
+
|
|
|
static unsigned long x86_fsgsbase_read_task(struct task_struct *task,
|
|
|
unsigned short selector)
|
|
|
{
|
|
@@ -597,10 +606,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
|
|
|
if (unlikely(next->ds | prev->ds))
|
|
|
loadsegment(ds, next->ds);
|
|
|
|
|
|
- load_seg_legacy(prev->fsindex, prev->fsbase,
|
|
|
- next->fsindex, next->fsbase, FS);
|
|
|
- load_seg_legacy(prev->gsindex, prev->gsbase,
|
|
|
- next->gsindex, next->gsbase, GS);
|
|
|
+ x86_fsgsbase_load(prev, next);
|
|
|
|
|
|
switch_fpu_finish(next_fpu, cpu);
|
|
|
|