Commit-ID: 815418890e2a3984d8b04c433072df1a42573f96 Gitweb: http://git.kernel.org/tip/815418890e2a3984d8b04c433072df1a42573f96 Author: Ingo Molnar <mingo@xxxxxxxxxx> AuthorDate: Thu, 30 Apr 2015 11:21:59 +0200 Committer: Ingo Molnar <mingo@xxxxxxxxxx> CommitDate: Tue, 19 May 2015 15:48:08 +0200 x86/fpu: Move restore_init_xstate() out of fpu/internal.h Move restore_init_xstate() next to its sole caller. Also rename it to copy_init_fpstate_to_fpregs() and add some comments about what it does. Cc: Andy Lutomirski <luto@xxxxxxxxxxxxxx> Cc: Borislav Petkov <bp@xxxxxxxxx> Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> Cc: Fenghua Yu <fenghua.yu@xxxxxxxxx> Cc: H. Peter Anvin <hpa@xxxxxxxxx> Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx> --- arch/x86/include/asm/fpu/internal.h | 8 -------- arch/x86/kernel/fpu/core.c | 14 +++++++++++++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h index 792fdbe..a1810eb 100644 --- a/arch/x86/include/asm/fpu/internal.h +++ b/arch/x86/include/asm/fpu/internal.h @@ -341,14 +341,6 @@ static inline void fpregs_deactivate(struct fpu *fpu) __fpregs_deactivate_hw(); } -static inline void restore_init_xstate(void) -{ - if (use_xsave()) - xrstor_state(&init_fpstate.xsave, -1); - else - fxrstor_checking(&init_fpstate.fxsave); -} - /* * Definitions for the eXtended Control Register instructions */ diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c index a396f80..2ea9e2f 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c @@ -392,6 +392,18 @@ void fpu__drop(struct fpu *fpu) } /* + * Clear FPU registers by setting them up from + * the init fpstate: + */ +static inline void copy_init_fpstate_to_fpregs(void) +{ + if (use_xsave()) + xrstor_state(&init_fpstate.xsave, -1); + else + fxrstor_checking(&init_fpstate.fxsave); +} + +/* * Clear the FPU state back to init state. * * Called by sys_execve(), by the signal handler code and by various @@ -409,7 +421,7 @@ void fpu__clear(struct fpu *fpu) fpu__activate_curr(fpu); user_fpu_begin(); } - restore_init_xstate(); + copy_init_fpstate_to_fpregs(); } } -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
![]() |