]> git.openpandora.org Git - pandora-kernel.git/commitdiff
x86/fpu: Remove 'init_xstate_buf' bootmem allocation
authorIngo Molnar <mingo@kernel.org>
Sat, 25 Apr 2015 03:08:17 +0000 (05:08 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 May 2015 13:47:39 +0000 (15:47 +0200)
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>
arch/x86/include/asm/fpu/internal.h
arch/x86/include/asm/fpu/xsave.h
arch/x86/kernel/fpu/xsave.c

index 0292fcc4d44194ec5d273032236200815181dc8a..19b7cdf73efd89374251f2ec6f4d0440752f86cd 100644 (file)
@@ -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);
 }
 
 /*
Simple merge
Simple merge