Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58147 )
Change subject: cpu/x86: Remove cpu parameter to ap_init ......................................................................
cpu/x86: Remove cpu parameter to ap_init
We now pre-populate cpu_info before jumping to the C handler. We no longer need this parameter.
I moved the stack alignment closer to the actual invocation of the C handler so it's easier to reason about.
BUG=b:194391185, b:179699789 TEST=Boot guybrush to OS and verify all CPUs still function
Signed-off-by: Raul E Rangel rrangel@chromium.org Change-Id: I8997683b6613b7031784cabf7039a400f0efdea1 --- M src/cpu/x86/mp_init.c M src/cpu/x86/sipi_vector.S 2 files changed, 3 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/47/58147/1
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index d395377..81ce101 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -181,7 +181,7 @@
/* By the time APs call ap_init() caching has been setup, and microcode has * been loaded. */ -static void asmlinkage ap_init(unsigned int cpu) +static void asmlinkage ap_init(void) { struct cpu_info *info = cpu_info();
diff --git a/src/cpu/x86/sipi_vector.S b/src/cpu/x86/sipi_vector.S index 55256de..b8cac96 100644 --- a/src/cpu/x86/sipi_vector.S +++ b/src/cpu/x86/sipi_vector.S @@ -118,11 +118,6 @@ add per_cpu_segment_selector, %eax mov %eax, %gs
- andl $0xfffffff0, %esp /* ensure stack alignment */ - - /* Save CPU number. */ - mov %ecx, %esi - /* * The following code only needs to run on Intel platforms and thus the caller * doesn't provide a microcode_ptr if not on Intel. @@ -235,19 +230,15 @@ mov %eax, %cr4 #endif
+ andl $0xfffffff0, %esp /* ensure stack alignment */ + #if ENV_X86_64 /* entry64.inc preserves ebx. */ #include <cpu/x86/64bit/entry64.inc>
- mov %rsi, %rdi /* cpu_num */ - movabs c_handler, %eax call *%rax #else - /* c_handler(cpu_num), preserve proper stack alignment */ - sub $12, %esp - push %esi /* cpu_num */ - mov c_handler, %eax call *%eax #endif