x86/cpu: Get rid of redundant switch_to_new_gdt() invocations
authorThomas Gleixner <tglx@linutronix.de>
Thu, 15 Sep 2022 11:10:42 +0000 (13:10 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 17 Oct 2022 14:40:56 +0000 (16:40 +0200)
commit1f19e2d50baf6515991844eaa8a84a0b0037da70
tree6d84eb4e93ff86a34b3678b284f802cf696db10c
parentb5636d45aae42aa345b4c7918bdef245ed63da68
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
arch/x86/include/asm/processor.h
arch/x86/kernel/cpu/common.c
arch/x86/kernel/setup_percpu.c
arch/x86/kernel/smpboot.c
arch/x86/xen/enlighten_pv.c