]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
x86/smpboot: Restrict soft_restart_cpu() to SEV
authorThomas Gleixner <tglx@linutronix.de>
Tue, 28 Mar 2023 14:29:09 +0000 (16:29 +0200)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 30 Mar 2023 12:27:04 +0000 (14:27 +0200)
Now that the CPU0 hotplug cruft is gone, the only user is AMD SEV.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/callthunks.c
arch/x86/kernel/head_32.S
arch/x86/kernel/head_64.S

index 18bf92623d5f7e92052322dd23777ab963e112d1..660113055954df620d532069b82a34c13289c6d8 100644 (file)
@@ -133,7 +133,7 @@ static bool skip_addr(void *dest)
        /* Accounts directly */
        if (dest == ret_from_fork)
                return true;
-#ifdef CONFIG_HOTPLUG_CPU
+#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_AMD_MEM_ENCRYPT)
        if (dest == soft_restart_cpu)
                return true;
 #endif
index 805abf181f95b82385ca3b4e855fa5621bfa73dd..c9318993f9594562f8518d60d7182d9e1f483f1e 100644 (file)
@@ -138,20 +138,6 @@ SYM_CODE_START(startup_32)
        jmp .Ldefault_entry
 SYM_CODE_END(startup_32)
 
-#ifdef CONFIG_HOTPLUG_CPU
-/*
- * Entry point for soft restart of a CPU. Invoked from xxx_play_dead() for
- * restarting the boot CPU or for restarting SEV guest CPUs after CPU hot
- * unplug. Everything is set up already except the stack.
- */
-SYM_FUNC_START(soft_restart_cpu)
-       movl initial_stack, %ecx
-       movl %ecx, %esp
-       call *(initial_code)
-1:     jmp 1b
-SYM_FUNC_END(soft_restart_cpu)
-#endif
-
 /*
  * Non-boot CPU entry point; entered from trampoline.S
  * We can't lgdt here, because lgdt itself uses a data segment, but
index c6be5e62cbda51cb1810e400b668d798b40e2c8a..1600b38541fc9b24b537eca32915c692252d5083 100644 (file)
@@ -375,7 +375,7 @@ SYM_CODE_END(secondary_startup_64)
 #include "verify_cpu.S"
 #include "sev_verify_cbit.S"
 
-#ifdef CONFIG_HOTPLUG_CPU
+#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_AMD_MEM_ENCRYPT)
 /*
  * Entry point for soft restart of a CPU. Invoked from xxx_play_dead() for
  * restarting the boot CPU or for restarting SEV guest CPUs after CPU hot