From: Ingo Molnar Date: Sat, 25 Apr 2015 03:08:17 +0000 (+0200) Subject: x86/fpu: Remove 'init_xstate_buf' bootmem allocation X-Git-Tag: omap-for-v4.2/fixes-rc1^2~174^2~155 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e5e1267740f47b1616aff5187b668cadd950047;p=pandora-kernel.git 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 Cc: Andy Lutomirski Cc: Dave Hansen Cc: Fenghua Yu Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Thomas Gleixner Signed-off-by: Ingo Molnar --- 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); } /* Reading git-diff-tree failed