Skip to content

Commit cded367

Browse files
KAGA-KOKOPeter Zijlstra
authored andcommitted
x86/smpboot: Restrict soft_restart_cpu() to SEV
Now that the CPU0 hotplug cruft is gone, the only user is AMD SEV. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Michael Kelley <[email protected]> Tested-by: Oleksandr Natalenko <[email protected]> Tested-by: Helge Deller <[email protected]> # parisc Tested-by: Guilherme G. Piccoli <[email protected]> # Steam Deck Link: https://lore.kernel.org/r/[email protected]
1 parent 5475abb commit cded367

File tree

3 files changed

+2
-16
lines changed

3 files changed

+2
-16
lines changed

arch/x86/kernel/callthunks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static bool skip_addr(void *dest)
133133
/* Accounts directly */
134134
if (dest == ret_from_fork)
135135
return true;
136-
#ifdef CONFIG_HOTPLUG_CPU
136+
#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_AMD_MEM_ENCRYPT)
137137
if (dest == soft_restart_cpu)
138138
return true;
139139
#endif

arch/x86/kernel/head_32.S

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,6 @@ SYM_CODE_START(startup_32)
138138
jmp .Ldefault_entry
139139
SYM_CODE_END(startup_32)
140140

141-
#ifdef CONFIG_HOTPLUG_CPU
142-
/*
143-
* Entry point for soft restart of a CPU. Invoked from xxx_play_dead() for
144-
* restarting the boot CPU or for restarting SEV guest CPUs after CPU hot
145-
* unplug. Everything is set up already except the stack.
146-
*/
147-
SYM_FUNC_START(soft_restart_cpu)
148-
movl initial_stack, %ecx
149-
movl %ecx, %esp
150-
call *(initial_code)
151-
1: jmp 1b
152-
SYM_FUNC_END(soft_restart_cpu)
153-
#endif
154-
155141
/*
156142
* Non-boot CPU entry point; entered from trampoline.S
157143
* We can't lgdt here, because lgdt itself uses a data segment, but

arch/x86/kernel/head_64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ SYM_CODE_END(secondary_startup_64)
375375
#include "verify_cpu.S"
376376
#include "sev_verify_cbit.S"
377377

378-
#ifdef CONFIG_HOTPLUG_CPU
378+
#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_AMD_MEM_ENCRYPT)
379379
/*
380380
* Entry point for soft restart of a CPU. Invoked from xxx_play_dead() for
381381
* restarting the boot CPU or for restarting SEV guest CPUs after CPU hot

0 commit comments

Comments
 (0)