x86/fpu: Rename unlazy_fpu() to fpu__save()
authorIngo Molnar <mingo@kernel.org>
Fri, 3 Apr 2015 08:58:52 +0000 (10:58 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 May 2015 13:47:09 +0000 (15:47 +0200)
This function is a misnomer on two levels:

1) it doesn't really manipulate TS on modern CPUs anymore, its
   primary purpose is to save FPU state, used:

      - when executing fork()/clone(): to copy current FPU state
        to the child's FPU state.

      - when handling math exceptions: to generate the math error
        si_code in the signal frame.

2) even on legacy CPUs it doesn't actually 'unlazy', if then
   it lazies the FPU state: as a side effect of the old FNSAVE
   instruction which clears (destroys) FPU state it's necessary
   to set CR0::TS.

So rename it to fpu__save() to better reflect its purpose.

Reviewed-by: Borislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/fpu-internal.h
arch/x86/include/asm/i387.h
arch/x86/kernel/i387.c
arch/x86/kernel/traps.c

index da5e967..49db044 100644 (file)
@@ -602,7 +602,7 @@ static inline void fpu_copy(struct task_struct *dst, struct task_struct *src)
                struct fpu *dfpu = &dst->thread.fpu;
                struct fpu *sfpu = &src->thread.fpu;
 
-               unlazy_fpu(src);
+               fpu__save(src);
                memcpy(dfpu->state, sfpu->state, xstate_size);
        }
 }
Simple merge
Simple merge
Simple merge