x86/fpu: Move CPU capability check into fpu__init_cpu_xstate()
authorIngo Molnar <mingo@kernel.org>
Sat, 25 Apr 2015 04:41:07 +0000 (06:41 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 May 2015 13:47:39 +0000 (15:47 +0200)
fpu__init_system_xstate() does an FPU capability check that is better
done in fpu__init_cpu_xstate(). This will allow us to call
fpu__init_cpu_xstate() directly on legacy CPUs as well.

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/kernel/fpu/xsave.c

index 961c25850c7f45a6f28ed3c1b63109655ce11f99..0610f431f77f9f2f3aa2af228c8797a5bdd9ed40 100644 (file)
@@ -465,7 +465,7 @@ static void prepare_fx_sw_frame(void)
  */
 void fpu__init_cpu_xstate(void)
 {
-       if (!xfeatures_mask)
+       if (!cpu_has_xsave || !xfeatures_mask)
                return;
 
        cr4_set_bits(X86_CR4_OSXSAVE);