From a1695504799f733c2fb1f030d1313535bbb5b065 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Sun, 1 Dec 2019 07:23:59 +0100 Subject: cpu/x86/sipi: Add x86_64 support Enter long mode on secondary APs. Tested on Lenovo T410 with additional x86_64 patches. Tested on HP Z220 with additional x86_64 patches. Still boots on x86_32. Change-Id: I53eae082123d1a12cfa97ead1d87d84db4a334c0 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/45187 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Arthur Heymans Reviewed-by: Tim Wawrzynczak --- src/cpu/x86/sipi_vector.S | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/cpu/x86/sipi_vector.S') diff --git a/src/cpu/x86/sipi_vector.S b/src/cpu/x86/sipi_vector.S index 054f30d2c4..61d9e34466 100644 --- a/src/cpu/x86/sipi_vector.S +++ b/src/cpu/x86/sipi_vector.S @@ -5,6 +5,8 @@ #include #include +#define __RAMSTAGE__ + /* The SIPI vector is responsible for initializing the APs in the system. It * loads microcode, sets up MSRs, and enables caching before calling into * C code. */ @@ -192,11 +194,24 @@ load_msr: mov %eax, %cr4 #endif +#ifdef __x86_64__ + /* entry64.inc preserves ebx. */ +#include + + mov %rsi, %rdi /* cpu_num */ + + movl 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 + + halt_jump: hlt jmp halt_jump -- cgit v1.2.3