aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel/process.c')
-rw-r--r--arch/i386/kernel/process.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index ba243a4cc119..d9492058aaf3 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -700,23 +700,27 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
700 700
701 /* 701 /*
702 * Restore %fs and %gs if needed. 702 * Restore %fs and %gs if needed.
703 *
704 * Glibc normally makes %fs be zero, and %gs is one of
705 * the TLS segments.
703 */ 706 */
704 if (unlikely(prev->fs | prev->gs | next->fs | next->gs)) { 707 if (unlikely(prev->fs | next->fs))
705 loadsegment(fs, next->fs); 708 loadsegment(fs, next->fs);
709
710 if (prev->gs | next->gs)
706 loadsegment(gs, next->gs); 711 loadsegment(gs, next->gs);
707 }
708 712
709 /* 713 /*
710 * Now maybe reload the debug registers 714 * Now maybe reload the debug registers
711 */ 715 */
712 if (unlikely(next->debugreg[7])) { 716 if (unlikely(next->debugreg[7])) {
713 set_debugreg(current->thread.debugreg[0], 0); 717 set_debugreg(next->debugreg[0], 0);
714 set_debugreg(current->thread.debugreg[1], 1); 718 set_debugreg(next->debugreg[1], 1);
715 set_debugreg(current->thread.debugreg[2], 2); 719 set_debugreg(next->debugreg[2], 2);
716 set_debugreg(current->thread.debugreg[3], 3); 720 set_debugreg(next->debugreg[3], 3);
717 /* no 4 and 5 */ 721 /* no 4 and 5 */
718 set_debugreg(current->thread.debugreg[6], 6); 722 set_debugreg(next->debugreg[6], 6);
719 set_debugreg(current->thread.debugreg[7], 7); 723 set_debugreg(next->debugreg[7], 7);
720 } 724 }
721 725
722 if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr)) 726 if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr))