diff options
Diffstat (limited to 'src/cpu/x86')
-rw-r--r-- | src/cpu/x86/Kconfig | 7 | ||||
-rw-r--r-- | src/cpu/x86/mp_init.c | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/cpu/x86/Kconfig b/src/cpu/x86/Kconfig index 2253e18ade..7e5817537e 100644 --- a/src/cpu/x86/Kconfig +++ b/src/cpu/x86/Kconfig @@ -202,4 +202,11 @@ config RESERVE_MTRRS_FOR_OS However, modern OSes use PAT to control cacheability instead of using MTRRs. +config AP_STACK_SIZE + hex + default 0x800 + help + This is the amount of stack each AP needs. The BSP stack size can be + larger and is set with STACK_SIZE. + endif # ARCH_X86 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] = { |