aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/i387.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 82166519497a..f3775f5ef4ab 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -389,19 +389,17 @@ convert_from_fxsr(struct user_i387_ia32_struct *env, struct task_struct *tsk)
389#ifdef CONFIG_X86_64 389#ifdef CONFIG_X86_64
390 env->fip = fxsave->rip; 390 env->fip = fxsave->rip;
391 env->foo = fxsave->rdp; 391 env->foo = fxsave->rdp;
392 /*
393 * should be actually ds/cs at fpu exception time, but
394 * that information is not available in 64bit mode.
395 */
396 env->fcs = task_pt_regs(tsk)->cs;
392 if (tsk == current) { 397 if (tsk == current) {
393 /* 398 savesegment(ds, env->fos);
394 * should be actually ds/cs at fpu exception time, but
395 * that information is not available in 64bit mode.
396 */
397 asm("mov %%ds, %[fos]" : [fos] "=r" (env->fos));
398 asm("mov %%cs, %[fcs]" : [fcs] "=r" (env->fcs));
399 } else { 399 } else {
400 struct pt_regs *regs = task_pt_regs(tsk); 400 env->fos = tsk->thread.ds;
401
402 env->fos = 0xffff0000 | tsk->thread.ds;
403 env->fcs = regs->cs;
404 } 401 }
402 env->fos |= 0xffff0000;
405#else 403#else
406 env->fip = fxsave->fip; 404 env->fip = fxsave->fip;
407 env->fcs = (u16) fxsave->fcs | ((u32) fxsave->fop << 16); 405 env->fcs = (u16) fxsave->fcs | ((u32) fxsave->fop << 16);