diff options
author | Ingo Molnar | 2015-04-25 05:08:17 +0200 |
---|---|---|
committer | Ingo Molnar | 2015-05-19 15:47:39 +0200 |
commit | 3e5e1267740f47b1616aff5187b668cadd950047 (patch) | |
tree | d1425e566e3371db47e6dc5e3aed6d3d20be6c30 /arch/x86/include/asm | |
parent | x86/fpu: Make setup_init_fpu_buf() run-once explicitly (diff) | |
download | kernel-qcow2-linux-3e5e1267740f47b1616aff5187b668cadd950047.tar.gz kernel-qcow2-linux-3e5e1267740f47b1616aff5187b668cadd950047.tar.xz kernel-qcow2-linux-3e5e1267740f47b1616aff5187b668cadd950047.zip |
x86/fpu: Remove 'init_xstate_buf' bootmem allocation
Make init_xstate_buf allocated statically at build time.
This structure's maximum size is around 1KB - and it's allocated even on
most modern embedded x86 CPUs which strive for FPU instruction set parity
with desktop and server CPUs, so it's not like we can save much on smaller
systems.
This removes the last bootmem allocation from the FPU init path, allowing
it to be called earlier in the boot sequence.
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>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/fpu/internal.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/fpu/xsave.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h index 0292fcc4d441..19b7cdf73efd 100644 --- a/arch/x86/include/asm/fpu/internal.h +++ b/arch/x86/include/asm/fpu/internal.h @@ -373,9 +373,9 @@ static inline void drop_fpu(struct fpu *fpu) static inline void restore_init_xstate(void) { if (use_xsave()) - xrstor_state(init_xstate_buf, -1); + xrstor_state(&init_xstate_ctx, -1); else - fxrstor_checking(&init_xstate_buf->i387); + fxrstor_checking(&init_xstate_ctx.i387); } /* diff --git a/arch/x86/include/asm/fpu/xsave.h b/arch/x86/include/asm/fpu/xsave.h index fd564344783e..5c3ab4e17aea 100644 --- a/arch/x86/include/asm/fpu/xsave.h +++ b/arch/x86/include/asm/fpu/xsave.h @@ -50,7 +50,7 @@ extern unsigned int xstate_size; extern u64 xfeatures_mask; extern u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS]; -extern struct xsave_struct *init_xstate_buf; +extern struct xsave_struct init_xstate_ctx; extern void xsave_init(void); extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask); |