return -ENODEV;
fpu__activate_stopped(fpu);
- fpstate_sanitize_xstate(target);
+ fpstate_sanitize_xstate(fpu);
return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
&fpu->state.fxsave, 0, -1);
return -ENODEV;
fpu__activate_stopped(fpu);
- fpstate_sanitize_xstate(target);
+ fpstate_sanitize_xstate(fpu);
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&fpu->state.fxsave, 0, -1);
&fpu->state.fsave, 0,
-1);
- fpstate_sanitize_xstate(target);
+ fpstate_sanitize_xstate(fpu);
if (kbuf && pos == 0 && count == sizeof(env)) {
convert_from_fxsr(kbuf, target);
int ret;
fpu__activate_stopped(fpu);
-
- fpstate_sanitize_xstate(target);
+ fpstate_sanitize_xstate(fpu);
if (!static_cpu_has(X86_FEATURE_FPU))
return fpregs_soft_set(target, regset, pos, count, kbuf, ubuf);
* if the corresponding header bit is zero. This is to ensure that user-space doesn't
* see some stale state in the memory layout during signal handling, debugging etc.
*/
-void fpstate_sanitize_xstate(struct task_struct *tsk)
+void fpstate_sanitize_xstate(struct fpu *fpu)
{
- struct i387_fxsave_struct *fx = &tsk->thread.fpu.state.fxsave;
+ struct i387_fxsave_struct *fx = &fpu->state.fxsave;
int feature_bit;
u64 xfeatures;
if (!use_xsaveopt())
return;
- xfeatures = tsk->thread.fpu.state.xsave.header.xfeatures;
+ xfeatures = fpu->state.xsave.header.xfeatures;
/*
* None of the feature bits are in init state. So nothing else
if (ia32_fxstate)
fpu_fxsave(&tsk->thread.fpu);
} else {
- fpstate_sanitize_xstate(tsk);
+ fpstate_sanitize_xstate(&tsk->thread.fpu);
if (__copy_to_user(buf_fx, xsave, xstate_size))
return -1;
}