aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/kernel/process.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index 0cb93abbf564..81111835722d 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -527,8 +527,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
527 int cpu = smp_processor_id(); 527 int cpu = smp_processor_id();
528 struct tss_struct *tss = &per_cpu(init_tss, cpu); 528 struct tss_struct *tss = &per_cpu(init_tss, cpu);
529 529
530 unlazy_fpu(prev_p);
531
532 /* 530 /*
533 * Reload esp0, LDT and the page table pointer: 531 * Reload esp0, LDT and the page table pointer:
534 */ 532 */
@@ -586,11 +584,14 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
586 } 584 }
587 585
588 /* 586 /*
589 * Switch the PDA context. 587 * Switch the PDA and FPU contexts.
590 */ 588 */
591 prev->userrsp = read_pda(oldrsp); 589 prev->userrsp = read_pda(oldrsp);
592 write_pda(oldrsp, next->userrsp); 590 write_pda(oldrsp, next->userrsp);
593 write_pda(pcurrent, next_p); 591 write_pda(pcurrent, next_p);
592 /* This must be here to ensure both math_state_restore() and
593 kernel_fpu_begin() work consistently. */
594 unlazy_fpu(prev_p);
594 write_pda(kernelstack, 595 write_pda(kernelstack,
595 task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET); 596 task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET);
596 597