Files
opensbi/lib/sbi/Kconfig
T
Oriol Catalan d936372eab lib: sbi: Make per-HART stack size configurable via Kconfig
The per-HART stack size for exception/interrupt handling is currently
hardcoded to 8192 bytes in SBI_PLATFORM_DEFAULT_HART_STACK_SIZE. This
may not be sufficient for platforms with deeper call stacks (e.g. those
enabling additional SBI extensions) or may be wasteful for minimal
platforms.

Introduce a HART_STACK_SIZE Kconfig option in lib/sbi/Kconfig with a
valid range of 8192 to 1048576 bytes and a default of 8192 bytes to
preserve existing behavior. The SBI_PLATFORM_DEFAULT_HART_STACK_SIZE
macro now resolves to CONFIG_HART_STACK_SIZE, allowing all platforms
to benefit from a single configuration knob without any source changes.

Signed-off-by: Oriol Catalan <oriol.catalan@openchip.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/VI0P192MB3062735A6194BB6DA72083499E002@VI0P192MB3062.EURP192.PROD.OUTLOOK.COM
Signed-off-by: Anup Patel <anup@brainfault.org>
2026-06-16 19:21:11 +05:30

90 lines
1.8 KiB
Plaintext

# SPDX-License-Identifier: BSD-2-Clause
menu "Generic SBI Support"
config DEFAULT_HART_STACK_SIZE
int "Default per-HART stack size (bytes)"
range 8192 1048576
default 8192
config CONSOLE_EARLY_BUFFER_SIZE
int "Early console buffer size (bytes)"
default 256
config ZKR_POLL_BUDGET
int "Zkr seed polling budget (iterations)"
default 1000
help
Maximum number of iterations to poll CSR_SEED when initializing
the stack guard variable. The Zkr specification doesn't define
a time limit on transitioning to ES16 between polls, which
makes it impossible to tell whether entropy is being
accumulated slowly or the entropy source is not functioning.
This also limits the wait time on systems with an event-driven
entropy source. A successful read doesn't consume a try.
config SBI_ECALL_TIME
bool "Timer extension"
default y
config SBI_ECALL_RFENCE
bool "RFENCE extension"
default y
config SBI_ECALL_IPI
bool "IPI extension"
default y
config SBI_ECALL_HSM
bool "Hart State Management extension"
default y
config SBI_ECALL_SRST
bool "System Reset extension"
default y
config SBI_ECALL_SUSP
bool "System Suspend extension"
default y
config SBI_ECALL_PMU
bool "Performance Monitoring Unit extension"
default y
config SBI_ECALL_DBCN
bool "Debug Console extension"
default y
config SBI_ECALL_CPPC
bool "CPPC extension"
default y
config SBI_ECALL_FWFT
bool "Firmware Feature extension"
default y
config SBI_ECALL_LEGACY
bool "SBI v0.1 legacy extensions"
default y
config SBI_ECALL_VENDOR
bool "Platform-defined vendor extensions"
default y
config SBI_ECALL_DBTR
bool "Debug Trigger Extension"
default y
config SBIUNIT
bool "Enable SBIUNIT tests"
default n
config SBI_ECALL_SSE
bool "SSE extension"
default y
config SBI_ECALL_MPXY
bool "MPXY extension"
default y
endmenu