From a8bcd10a51bdad457c688318956d7d8a19f94e7c Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Sat, 25 Mar 2006 16:29:25 +0100 Subject: [PATCH] --- yaml --- r: 23798 b: refs/heads/master c: 45948d7720e8bd0104696087c6305fdd90e3b298 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/x86_64/kernel/process.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 01fc08fc1157..9646af340888 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2b514e74f4e59e3b8e54891580fef2c9ff6c7bd0 +refs/heads/master: 45948d7720e8bd0104696087c6305fdd90e3b298 diff --git a/trunk/arch/x86_64/kernel/process.c b/trunk/arch/x86_64/kernel/process.c index 0cb93abbf564..81111835722d 100644 --- a/trunk/arch/x86_64/kernel/process.c +++ b/trunk/arch/x86_64/kernel/process.c @@ -527,8 +527,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) int cpu = smp_processor_id(); struct tss_struct *tss = &per_cpu(init_tss, cpu); - unlazy_fpu(prev_p); - /* * Reload esp0, LDT and the page table pointer: */ @@ -586,11 +584,14 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) } /* - * Switch the PDA context. + * Switch the PDA and FPU contexts. */ prev->userrsp = read_pda(oldrsp); write_pda(oldrsp, next->userrsp); write_pda(pcurrent, next_p); + /* This must be here to ensure both math_state_restore() and + kernel_fpu_begin() work consistently. */ + unlazy_fpu(prev_p); write_pda(kernelstack, task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET);