From: Ingo Molnar Date: Sat, 25 Apr 2015 06:27:44 +0000 (+0200) Subject: x86/fpu: Do system-wide setup from fpu__detect() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=067051ccd209623cb56152cf4cb06616ee2bcc5c;p=linux-beck.git x86/fpu: Do system-wide setup from fpu__detect() fpu__cpu_init() is called on every CPU, so it is the wrong place to call fpu__init_system() from. Call it from fpu__detect(): this is early CPU init code, but we already have CPU features detected, so we can call the system-wide FPU init code from here. 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/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c index b3ea4f86d643..6e422cf1e197 100644 --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c @@ -245,7 +245,6 @@ void fpu__init_system(void) void fpu__cpu_init(void) { fpu__init_cpu(); - fpu__init_system(); } static int __init no_387(char *s) @@ -279,5 +278,6 @@ void fpu__detect(struct cpuinfo_x86 *c) else clear_cpu_cap(c, X86_FEATURE_FPU); + fpu__init_system(); /* The final cr0 value is set later, in fpu_init() */ }