diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2022-09-15 13:10:42 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2022-10-17 16:40:56 +0200 |
commit | 1f19e2d50baf6515991844eaa8a84a0b0037da70 (patch) | |
tree | 6d84eb4e93ff86a34b3678b284f802cf696db10c /arch/x86/kernel/smpboot.c | |
parent | b5636d45aae42aa345b4c7918bdef245ed63da68 (diff) | |
download | linux-stable-1f19e2d50baf6515991844eaa8a84a0b0037da70.tar.gz linux-stable-1f19e2d50baf6515991844eaa8a84a0b0037da70.tar.bz2 linux-stable-1f19e2d50baf6515991844eaa8a84a0b0037da70.zip |
x86/cpu: Get rid of redundant switch_to_new_gdt() invocations
The only place where switch_to_new_gdt() is required is early boot to
switch from the early GDT to the direct GDT. Any other invocation is
completely redundant because it does not change anything.
Secondary CPUs come out of the ASM code with GDT and GSBASE correctly set
up. The same is true for XEN_PV.
Remove all the voodoo invocations which are left overs from the ancient
past, rename the function to switch_gdt_and_percpu_base() and mark it init.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220915111143.198076128@infradead.org
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r-- | arch/x86/kernel/smpboot.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 3f3ea0287f69..ce8728d2e5ef 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1453,7 +1453,11 @@ void arch_thaw_secondary_cpus_end(void) void __init native_smp_prepare_boot_cpu(void) { int me = smp_processor_id(); - switch_to_new_gdt(me); + + /* SMP handles this from setup_per_cpu_areas() */ + if (!IS_ENABLED(CONFIG_SMP)) + switch_gdt_and_percpu_base(me); + /* already set me in cpu_online_mask in boot_cpu_init() */ cpumask_set_cpu(me, cpu_callout_mask); cpu_set_state_online(me); |