diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-03-23 10:13:36 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-03-23 10:13:36 +0100 |
commit | eda2360ad18b7cde87728fad85c6735a52c2576e (patch) | |
tree | 2bc28704b40686c0d3d0fd5aa7d000f9d9dd153f /arch/x86/kernel/xsave.c | |
parent | 1d23c4518b1f3a03c278f23333149245c178d2a6 (diff) | |
parent | bc465aa9d045feb0e13b4a8f32cc33c1943f62d6 (diff) |
Merge tag 'v4.0-rc5' into x86/fpu, to prevent conflicts
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/xsave.c')
-rw-r--r-- | arch/x86/kernel/xsave.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c index de9dcf89a302..0bf82c5ac529 100644 --- a/arch/x86/kernel/xsave.c +++ b/arch/x86/kernel/xsave.c @@ -12,6 +12,7 @@ #include <asm/i387.h> #include <asm/fpu-internal.h> #include <asm/sigframe.h> +#include <asm/tlbflush.h> #include <asm/xcr.h> /* @@ -378,7 +379,7 @@ int __restore_xstate_sig(void __user *buf, void __user *buf_fx, int size) * thread's fpu state, reconstruct fxstate from the fsave * header. Sanitize the copied state etc. */ - struct xsave_struct *xsave = &tsk->thread.fpu.state->xsave; + struct fpu *fpu = &tsk->thread.fpu; struct user_i387_ia32_struct env; int err = 0; @@ -392,14 +393,15 @@ int __restore_xstate_sig(void __user *buf, void __user *buf_fx, int size) */ drop_fpu(tsk); - if (__copy_from_user(xsave, buf_fx, state_size) || + if (__copy_from_user(&fpu->state->xsave, buf_fx, state_size) || __copy_from_user(&env, buf, sizeof(env))) { + fpu_finit(fpu); err = -1; } else { sanitize_restored_xstate(tsk, &env, xstate_bv, fx_only); - set_used_math(); } + set_used_math(); if (use_eager_fpu()) { preempt_disable(); math_state_restore(); @@ -453,7 +455,7 @@ static void prepare_fx_sw_frame(void) */ static inline void xstate_enable(void) { - set_in_cr4(X86_CR4_OSXSAVE); + cr4_set_bits(X86_CR4_OSXSAVE); xsetbv(XCR_XFEATURE_ENABLED_MASK, pcntxt_mask); } |