From 0e0199387ab85505db02e2ded7ad46d952df59a9 Mon Sep 17 00:00:00 2001 From: "Charles E. Youse" Date: Tue, 9 Jul 2019 16:15:26 -0700 Subject: [PATCH] arch/x86: set default stack sizes Using the arch Kconfig here, instead of kernel/Kconfig. Intel64 with the SysV ABI requires some pretty big stacks. These 4K-8K defaults are arguably a bit small, but the Zephyr defaults are REALLY too small. Signed-off-by: Charles E. Youse --- arch/x86/core/Kconfig.intel64 | 18 ++++++++++++++++++ arch/x86/core/intel64/locore.S | 10 ++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/arch/x86/core/Kconfig.intel64 b/arch/x86/core/Kconfig.intel64 index 382fb3f3104..0662362635a 100644 --- a/arch/x86/core/Kconfig.intel64 +++ b/arch/x86/core/Kconfig.intel64 @@ -5,4 +5,22 @@ if X86_LONGMODE +config MAIN_STACK_SIZE + default 8192 + +config IDLE_STACK_SIZE + default 4096 + +config ISR_STACK_SIZE + default 4096 + +config TEST_EXTRA_STACKSIZE + default 4096 + +config SYSTEM_WORKQUEUE_STACK_SIZE + default 8192 + +config OFFLOAD_WORKQUEUE_STACK_SIZE + default 8192 + endif # X86_LONGMODE diff --git a/arch/x86/core/intel64/locore.S b/arch/x86/core/intel64/locore.S index fa57c6923c1..f49a1383641 100644 --- a/arch/x86/core/intel64/locore.S +++ b/arch/x86/core/intel64/locore.S @@ -10,8 +10,6 @@ #include #include -#define IST1_SIZE 4096 /* must be a multiple of 16 */ - .section .locore,"ax" .code32 @@ -52,7 +50,7 @@ __start: movw %ax, %fs movw %ax, %gs - movl $(ist1 + IST1_SIZE), %esp + movl $(ist1 + CONFIG_ISR_STACK_SIZE), %esp /* transition to long mode, by the book. */ @@ -158,7 +156,7 @@ __swap: movq %r14, _thread_offset_to_r14(%rsi) movq %r15, _thread_offset_to_r15(%rsi) - movq $(ist1 + IST1_SIZE), %rsp + movq $(ist1 + CONFIG_ISR_STACK_SIZE), %rsp /* fall through to __resume */ @@ -237,7 +235,7 @@ tss: .long 0 .long 0, 0 /* RSP1 */ .long 0, 0 /* RSP2 */ .long 0, 0 - .long (ist1 + IST1_SIZE), 0 /* IST1 */ + .long (ist1 + CONFIG_ISR_STACK_SIZE), 0 /* IST1 */ .long 0, 0 /* IST2 */ .long 0, 0 /* IST3 */ .long 0, 0 /* IST4 */ @@ -479,5 +477,5 @@ pdp: .long 0x00000183 /* 0x183 = G, 1GB, R/W, P */ .align 16 ist1: - .fill IST1_SIZE, 1, 0xFF + .fill CONFIG_ISR_STACK_SIZE, 1, 0xFF