[tip: x86/cpu] x86/cpu: Move 32-bit SEP setup into identify_cpu()

From: tip-bot2 for Ihor Solodrai

Date: Wed Sep 16 2026 - 22:04:50 EST


The following commit has been merged into the x86/cpu branch of tip:

Commit-ID: db349783ca7aa99345f3809523bff2db8f8714de
Gitweb: https://git.kernel.org/tip/db349783ca7aa99345f3809523bff2db8f8714de
Author: Ihor Solodrai <ihor.solodrai@xxxxxxxxx>
AuthorDate: Wed, 16 Sep 2026 12:52:02 -07:00
Committer: Borislav Petkov (AMD) <bp@xxxxxxxxx>
CommitterDate: Thu, 17 Sep 2026 02:02:18 +02:00

x86/cpu: Move 32-bit SEP setup into identify_cpu()

identify_boot_cpu() and identify_secondary_cpu() both call
enable_sep_cpu() under CONFIG_X86_32 immediately after identify_cpu().

Do it once and drop the ifdefs while at it.

No functional changes.

Signed-off-by: Ihor Solodrai <ihor.solodrai@xxxxxxxxx>
Signed-off-by: Borislav Petkov (AMD) <bp@xxxxxxxxx>
Reviewed-by: Nikolay Borisov <nik.borisov@xxxxxxxx>
Link: https://patch.msgid.link/20260916195203.1099646-5-ihor.solodrai@xxxxxxxxx
---
arch/x86/kernel/cpu/common.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 79a1260..156a7b8 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -2128,6 +2128,9 @@ no_cpuid:
mcheck_cpu_init(c);

numa_add_cpu(smp_processor_id());
+
+ if (IS_ENABLED(CONFIG_X86_32))
+ enable_sep_cpu();
}

/*
@@ -2165,9 +2168,6 @@ static __init void identify_boot_cpu(void)
identify_cpu(&boot_cpu_data);
if (HAS_KERNEL_IBT && cpu_feature_enabled(X86_FEATURE_IBT))
pr_info("CET detected: Indirect Branch Tracking enabled\n");
-#ifdef CONFIG_X86_32
- enable_sep_cpu();
-#endif
cpu_detect_tlb(&boot_cpu_data);
setup_cr_pinning();

@@ -2187,9 +2187,6 @@ void identify_secondary_cpu(unsigned int cpu)
c->cpu_index = cpu;

identify_cpu(c);
-#ifdef CONFIG_X86_32
- enable_sep_cpu();
-#endif
x86_spec_ctrl_setup_ap();
update_srbds_msr();
if (boot_cpu_has_bug(X86_BUG_GDS))