Skip to content

Commit 377ffbc

Browse files
Suresh SiddhaH. Peter Anvin
authored andcommitted
x86, fpu: remove unnecessary user_fpu_end() in save_xstate_sig()
Few lines below we do drop_fpu() which is more safer. Remove the unnecessary user_fpu_end() in save_xstate_sig(), which allows the drop_fpu() to ignore any pending exceptions from the user-space and drop the current fpu. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Link: http://lkml.kernel.org/r/1345842782-24175-3-git-send-email-suresh.b.siddha@intel.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
1 parent e962591 commit 377ffbc

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

arch/x86/include/asm/fpu-internal.h

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -412,22 +412,11 @@ static inline void __drop_fpu(struct task_struct *tsk)
412412
}
413413

414414
/*
415-
* The actual user_fpu_begin/end() functions
416-
* need to be preemption-safe.
415+
* Need to be preemption-safe.
417416
*
418-
* NOTE! user_fpu_end() must be used only after you
419-
* have saved the FP state, and user_fpu_begin() must
420-
* be used only immediately before restoring it.
421-
* These functions do not do any save/restore on
422-
* their own.
417+
* NOTE! user_fpu_begin() must be used only immediately before restoring
418+
* it. This function does not do any save/restore on their own.
423419
*/
424-
static inline void user_fpu_end(void)
425-
{
426-
preempt_disable();
427-
__thread_fpu_end(current);
428-
preempt_enable();
429-
}
430-
431420
static inline void user_fpu_begin(void)
432421
{
433422
preempt_disable();

arch/x86/kernel/xsave.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ int save_xstate_sig(void __user *buf, void __user *buf_fx, int size)
255255
/* Update the thread's fxstate to save the fsave header. */
256256
if (ia32_fxstate)
257257
fpu_fxsave(&tsk->thread.fpu);
258-
user_fpu_end();
259258
} else {
260259
sanitize_i387_state(tsk);
261260
if (__copy_to_user(buf_fx, xsave, xstate_size))

0 commit comments

Comments
 (0)