Skip to content

Commit 8183a89

Browse files
KAGA-KOKOgregkh
authored andcommitted
init: Invoke arch_cpu_finalize_init() earlier
commit 9df9d2f upstream X86 is reworking the boot process so that initializations which are not required during early boot can be moved into the late boot process and out of the fragile and restricted initial boot phase. arch_cpu_finalize_init() is the obvious place to do such initializations, but arch_cpu_finalize_init() is invoked too late in start_kernel() e.g. for initializing the FPU completely. fork_init() requires that the FPU is initialized as the size of task_struct on X86 depends on the size of the required FPU register buffer. Fortunately none of the init calls between calibrate_delay() and arch_cpu_finalize_init() is relevant for the functionality of arch_cpu_finalize_init(). Invoke it right after calibrate_delay() where everything which is relevant for arch_cpu_finalize_init() has been set up already. No functional change intended. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Rick Edgecombe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Sneddon <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a3342c6 commit 8183a89

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

init/main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,9 @@ asmlinkage __visible void __init __no_sanitize_address start_kernel(void)
11071107
late_time_init();
11081108
sched_clock_init();
11091109
calibrate_delay();
1110+
1111+
arch_cpu_finalize_init();
1112+
11101113
pid_idr_init();
11111114
anon_vma_init();
11121115
#ifdef CONFIG_X86
@@ -1135,8 +1138,6 @@ asmlinkage __visible void __init __no_sanitize_address start_kernel(void)
11351138

11361139
poking_init();
11371140

1138-
arch_cpu_finalize_init();
1139-
11401141
acpi_subsystem_init();
11411142
arch_post_acpi_subsys_init();
11421143
kcsan_init();

0 commit comments

Comments
 (0)