Commit-ID: e9dbfd673a9cc9d3ef90e3ea4e136a833dab3674 Gitweb: http://git.kernel.org/tip/e9dbfd673a9cc9d3ef90e3ea4e136a833dab3674 Author: Ingo Molnar <mingo@xxxxxxxxxx> AuthorDate: Sat, 25 Apr 2015 06:47:24 +0200 Committer: Ingo Molnar <mingo@xxxxxxxxxx> CommitDate: Tue, 19 May 2015 15:47:40 +0200 x86/fpu: Move legacy check to fpu__init_system_xstate() Now that legacy code can execute fpu__init_cpu_xstate() in xsave_init(), we can move the once per boot legacy check into fpu__init_system_xstate(), where it belongs. Reviewed-by: Borislav Petkov <bp@xxxxxxxxx> Cc: Andy Lutomirski <luto@xxxxxxxxxxxxxx> Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> Cc: Fenghua Yu <fenghua.yu@xxxxxxxxx> Cc: H. Peter Anvin <hpa@xxxxxxxxx> Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx> --- arch/x86/kernel/fpu/xsave.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/fpu/xsave.c b/arch/x86/kernel/fpu/xsave.c index 0610f43..fd656cb 100644 --- a/arch/x86/kernel/fpu/xsave.c +++ b/arch/x86/kernel/fpu/xsave.c @@ -653,6 +653,11 @@ void fpu__init_system_xstate(void) { unsigned int eax, ebx, ecx, edx; + if (!cpu_has_xsave) { + pr_info("x86/fpu: Legacy x87 FPU detected.\n"); + return; + } + if (boot_cpu_data.cpuid_level < XSTATE_CPUID) { WARN(1, "x86/fpu: XSTATE_CPUID missing!\n"); return; @@ -711,14 +716,6 @@ void xsave_init(void) { static char on_boot_cpu = 1; - if (!cpu_has_xsave) { - if (on_boot_cpu) { - on_boot_cpu = 0; - pr_info("x86/fpu: Legacy x87 FPU detected.\n"); - } - return; - } - if (on_boot_cpu) { on_boot_cpu = 0; fpu__init_system_xstate(); -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
![]() |