Patch "x86/fpu: Move FPU initialization into arch_cpu_finalize_init()" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    x86/fpu: Move FPU initialization into arch_cpu_finalize_init()

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     x86-fpu-move-fpu-initialization-into-arch_cpu_finalize_init.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 009507c1cdfb8f4d0b01ec7d3353fe66c8350c42 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Date: Tue, 1 Aug 2023 16:07:11 +0200
Subject: x86/fpu: Move FPU initialization into arch_cpu_finalize_init()

From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

commit b81fac906a8f9e682e513ddd95697ec7a20878d4 upstream

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@xxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/20230613224545.902376621@xxxxxxxxxxxxx
Signed-off-by: Daniel Sneddon <daniel.sneddon@xxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 arch/x86/kernel/cpu/common.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1604,8 +1604,6 @@ static void __init early_identify_cpu(st
 
 	sld_setup(c);
 
-	fpu__init_system();
-
 #ifdef CONFIG_X86_32
 	/*
 	 * Regardless of whether PCID is enumerated, the SDM says
@@ -2287,8 +2285,6 @@ void cpu_init(void)
 
 	doublefault_init_cpu_tss();
 
-	fpu__init_cpu();
-
 	if (is_uv_system())
 		uv_cpu_init();
 
@@ -2304,6 +2300,7 @@ void cpu_init_secondary(void)
 	 */
 	cpu_init_exception_handling();
 	cpu_init();
+	fpu__init_cpu();
 }
 #endif
 
@@ -2398,6 +2395,13 @@ void __init arch_cpu_finalize_init(void)
 			'0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86);
 	}
 
+	/*
+	 * Must be before alternatives because it might set or clear
+	 * feature bits.
+	 */
+	fpu__init_system();
+	fpu__init_cpu();
+
 	alternative_instructions();
 
 	if (IS_ENABLED(CONFIG_X86_64)) {


Patches currently in stable-queue which might be from tglx@xxxxxxxxxxxxx are

queue-6.4/x86-cpu-switch-to-arch_cpu_finalize_init.patch
queue-6.4/arm-cpu-switch-to-arch_cpu_finalize_init.patch
queue-6.4/um-cpu-switch-to-arch_cpu_finalize_init.patch
queue-6.4/mips-cpu-switch-to-arch_cpu_finalize_init.patch
queue-6.4/x86-mem_encrypt-unbreak-the-amd_mem_encrypt-n-build.patch
queue-6.4/init-x86-move-mem_encrypt_init-into-arch_cpu_finalize_init.patch
queue-6.4/sh-cpu-switch-to-arch_cpu_finalize_init.patch
queue-6.4/init-invoke-arch_cpu_finalize_init-earlier.patch
queue-6.4/x86-xen-fix-secondary-processors-fpu-initialization.patch
queue-6.4/x86-fpu-move-fpu-initialization-into-arch_cpu_finalize_init.patch
queue-6.4/loongarch-cpu-switch-to-arch_cpu_finalize_init.patch
queue-6.4/init-remove-check_bugs-leftovers.patch
queue-6.4/init-provide-arch_cpu_finalize_init.patch
queue-6.4/m68k-cpu-switch-to-arch_cpu_finalize_init.patch
queue-6.4/x86-init-initialize-signal-frame-size-late.patch
queue-6.4/sparc-cpu-switch-to-arch_cpu_finalize_init.patch
queue-6.4/x86-fpu-mark-init-functions-__init.patch
queue-6.4/ia64-cpu-switch-to-arch_cpu_finalize_init.patch
queue-6.4/x86-fpu-remove-cpuinfo-argument-from-init-functions.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux