x86/fpu: Move FPU initialization into arch_cpu_finalize_init()

Initializing the FPU during the early boot process is a pointless
exercise. Early boot is convoluted and fragile enough.

Nothing requires that the FPU is set up early. It has to be initialized
before fork_init() because the task_struct size depends on the FPU register
buffer size.

Move the initialization to arch_cpu_finalize_init() which is the perfect
place to do so.

No functional change.

This allows to remove quite some of the custom early command line parsing,
but that's subject to the next installment.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230613224545.902376621@linutronix.de

+8 -4
+8 -4
arch/x86/kernel/cpu/common.c
··· 1604 1605 sld_setup(c); 1606 1607 - fpu__init_system(); 1608 - 1609 #ifdef CONFIG_X86_32 1610 /* 1611 * Regardless of whether PCID is enumerated, the SDM says ··· 2285 2286 doublefault_init_cpu_tss(); 2287 2288 - fpu__init_cpu(); 2289 - 2290 if (is_uv_system()) 2291 uv_cpu_init(); 2292 ··· 2300 */ 2301 cpu_init_exception_handling(); 2302 cpu_init(); 2303 } 2304 #endif 2305 ··· 2392 init_utsname()->machine[1] = 2393 '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86); 2394 } 2395 2396 alternative_instructions(); 2397
··· 1604 1605 sld_setup(c); 1606 1607 #ifdef CONFIG_X86_32 1608 /* 1609 * Regardless of whether PCID is enumerated, the SDM says ··· 2287 2288 doublefault_init_cpu_tss(); 2289 2290 if (is_uv_system()) 2291 uv_cpu_init(); 2292 ··· 2304 */ 2305 cpu_init_exception_handling(); 2306 cpu_init(); 2307 + fpu__init_cpu(); 2308 } 2309 #endif 2310 ··· 2395 init_utsname()->machine[1] = 2396 '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86); 2397 } 2398 + 2399 + /* 2400 + * Must be before alternatives because it might set or clear 2401 + * feature bits. 2402 + */ 2403 + fpu__init_system(); 2404 + fpu__init_cpu(); 2405 2406 alternative_instructions(); 2407