diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-04-28 12:17:55 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-05-19 16:48:00 +0300 |
commit | 1ac91a767f1d2ac049dc11e5b7e4342c63c21538 (patch) | |
tree | 5a0397d21e5d47972a01adfe1f35014b5670c51f /arch/x86/include/asm/fpu/internal.h | |
parent | d0903193124132c6bb59a895eeb0656f86013da1 (diff) | |
download | linux-1ac91a767f1d2ac049dc11e5b7e4342c63c21538.tar.xz |
x86/fpu: Simplify fpstate_sanitize_xstate() calls
Remove the extra layer of __fpstate_sanitize_xstate():
if (!use_xsaveopt())
return;
__fpstate_sanitize_xstate(tsk);
and move the check for use_xsaveopt() into fpstate_sanitize_xstate().
In general we optimize for the presence of CPU features, not for
the absence of them. Furthermore there's little point in this inlining,
as the call sites are not super hot code paths.
Doing this uninlining shrinks the code a bit:
text data bss dec hex filename
14108751 2573624 1634304 18316679 1177d87 vmlinux.before
14108627 2573624 1634304 18316555 1177d0b vmlinux.after
Also remove a pointless '!fx' check from fpstate_sanitize_xstate().
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
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>
Diffstat (limited to 'arch/x86/include/asm/fpu/internal.h')
-rw-r--r-- | arch/x86/include/asm/fpu/internal.h | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h index 6b6fa46037f8..88fec3f108de 100644 --- a/arch/x86/include/asm/fpu/internal.h +++ b/arch/x86/include/asm/fpu/internal.h @@ -139,14 +139,7 @@ static inline void fx_finit(struct i387_fxsave_struct *fx) fx->mxcsr = MXCSR_DEFAULT; } -extern void __fpstate_sanitize_xstate(struct task_struct *); - -static inline void fpstate_sanitize_xstate(struct task_struct *tsk) -{ - if (!use_xsaveopt()) - return; - __fpstate_sanitize_xstate(tsk); -} +extern void fpstate_sanitize_xstate(struct task_struct *); #define user_insn(insn, output, input...) \ ({ \ |