Skip to content

Commit fb14b4e

Browse files
oleg-nesterovIngo Molnar
authored andcommitted
x86/fpu: Document user_fpu_begin()
Currently, user_fpu_begin() has a single caller and it is not clear why do we actually need it and why we should not worry about preemption right after preempt_enable(). Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Pekka Riikonen <priikone@iki.fi> Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com> Cc: Rik van Riel <riel@redhat.com> Cc: Suresh Siddha <sbsiddha@gmail.com> Link: http://lkml.kernel.org/r/20150311173409.GC5032@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent eda2360 commit fb14b4e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,12 @@ static inline int restore_xstate_sig(void __user *buf, int ia32_frame)
508508
}
509509

510510
/*
511-
* Need to be preemption-safe.
511+
* Needs to be preemption-safe.
512512
*
513513
* NOTE! user_fpu_begin() must be used only immediately before restoring
514-
* it. This function does not do any save/restore on their own.
514+
* the save state. It does not do any saving/restoring on its own. In
515+
* lazy FPU mode, it is just an optimization to avoid a #NM exception,
516+
* the task can lose the FPU right after preempt_enable().
515517
*/
516518
static inline void user_fpu_begin(void)
517519
{

0 commit comments

Comments
 (0)