Files
opensbi/lib/sbi/Kconfig
T
Evgeny Voevodin e134d52106 lib: sbi: Apply budget restriction when polling Zkr CSR state transition
Zkr architecture doesn't define a time limit on state transitions
which results in hanging on unresponsive or event-driven platforms.
To prevent this, we need to limit polling iterations and fall back
in case the budget is over, and stack guard keeps its initial value.
The budget is configurable with CONFIG_ZKR_POLL_BUDGET, defaulting
to 1000 iterations. Successful reads do not consume a try.

Signed-off-by: Evgeny Voevodin <evvoevod@tenstorrent.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260519225014.244672-1-evvoevod@tenstorrent.com
Signed-off-by: Anup Patel <anup@brainfault.org>
2026-06-12 18:21:47 +05:30

85 lines
1.7 KiB
Plaintext

# SPDX-License-Identifier: BSD-2-Clause
menu "Generic SBI Support"
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