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 1604 1605 1605 sld_setup(c); 1606 1606 1607 - fpu__init_system(); 1608 - 1609 1607 #ifdef CONFIG_X86_32 1610 1608 /* 1611 1609 * Regardless of whether PCID is enumerated, the SDM says ··· 2285 2287 2286 2288 doublefault_init_cpu_tss(); 2287 2289 2288 - fpu__init_cpu(); 2289 - 2290 2290 if (is_uv_system()) 2291 2291 uv_cpu_init(); 2292 2292 ··· 2300 2304 */ 2301 2305 cpu_init_exception_handling(); 2302 2306 cpu_init(); 2307 + fpu__init_cpu(); 2303 2308 } 2304 2309 #endif 2305 2310 ··· 2392 2395 init_utsname()->machine[1] = 2393 2396 '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86); 2394 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(); 2395 2405 2396 2406 alternative_instructions(); 2397 2407