lib: make SBI_HARTMASK_MAX_BITS customizable, default 256

Linux has raised the default number of 64bit CPUs to 256 in commit
0fa749771993 ("riscv: Raise default NR_CPUS for 64BIT to 256").
OpenSBI should use a matching value for SBI_HARTMASK_MAX_BITS.

Introduce configuration variable CONFIG_HARTMASK_MAX_BITS with
range 32-512 and default 256.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260706160544.697409-1-heinrich.schuchardt@canonical.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Heinrich Schuchardt
2026-08-20 17:57:19 +05:30
committed by Anup Patel
parent c5e90d4286
commit 3876e7574d
2 changed files with 13 additions and 0 deletions
+4
View File
@@ -20,7 +20,11 @@
* also represents the maximum number of HART ids generic OpenSBI * also represents the maximum number of HART ids generic OpenSBI
* can handle. * can handle.
*/ */
#ifdef CONFIG_HARTMASK_MAX_BITS
#define SBI_HARTMASK_MAX_BITS CONFIG_HARTMASK_MAX_BITS
#else
#define SBI_HARTMASK_MAX_BITS 128 #define SBI_HARTMASK_MAX_BITS 128
#endif
/** Representation of hartmask */ /** Representation of hartmask */
struct sbi_hartmask { struct sbi_hartmask {
+9
View File
@@ -2,6 +2,15 @@
menu "Generic SBI Support" menu "Generic SBI Support"
config HARTMASK_MAX_BITS
int "Maximum number of hart mask bits (32-512)"
range 32 512
default 256
help
The hartmask is indexed using physical hart IDs so this setting
also represents the maximum number of hart IDs generic OpenSBI
can handle.
config DEFAULT_HART_STACK_SIZE config DEFAULT_HART_STACK_SIZE
int "Default per-HART stack size (bytes)" int "Default per-HART stack size (bytes)"
range 8192 1048576 range 8192 1048576