From 4d75dbd1c1d6362c002a26a5c4e6de74b2816cdf Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Tue, 1 Nov 2022 23:57:24 +0100 Subject: cpu/x86: Set up a separate stack for APs APs use a lot less stack, so set up a separate stack for those in .bss. Now that CPU_INFO_V2 is the only code path that is used, there is no need to align stacks in c_start.S. Change-Id: I7a681a2e3003da0400843daa5d6d6180d952abf5 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/69123 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Werner Zeh --- src/cpu/x86/mp_init.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/cpu/x86/mp_init.c') diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index f00418547e..507da7d1be 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -215,6 +215,8 @@ static asmlinkage void ap_init(unsigned int index) park_this_cpu(NULL); } +static __aligned(16) uint8_t ap_stack[CONFIG_AP_STACK_SIZE * CONFIG_MAX_CPUS]; + static void setup_default_sipi_vector_params(struct sipi_params *sp) { sp->gdt = (uintptr_t)&gdt; @@ -222,8 +224,8 @@ static void setup_default_sipi_vector_params(struct sipi_params *sp) sp->idt_ptr = (uintptr_t)&idtarg; sp->per_cpu_segment_descriptors = (uintptr_t)&per_cpu_segment_descriptors; sp->per_cpu_segment_selector = per_cpu_segment_selector; - sp->stack_size = CONFIG_STACK_SIZE; - sp->stack_top = ALIGN_DOWN((uintptr_t)&_estack, CONFIG_STACK_SIZE); + sp->stack_size = CONFIG_AP_STACK_SIZE; + sp->stack_top = (uintptr_t)ap_stack + ARRAY_SIZE(ap_stack); } static const unsigned int fixed_mtrrs[NUM_FIXED_MTRRS] = { -- cgit v1.2.3