Hi there,
I am having some difficulties to bring up all 32 cores of a Rocket Chip on Linux 5.10, using OpenSBI v0.9.
After Linux boots as described in this
instrumented log, only 16 cores appear on /proc/cpuinfo. The ones that successfully boot are those with hart id in [0,15].
Right now, it seems to me that the most likely culprit is OpenSBI, since it mediates all hart start actions by intercepting the ecalls coming from Linux (arch/riscv/kernel/cpu_ops_sbi.c,
function sbi_hsm_hart_start).
By inspecting FPGA nets during boot with Vivado probes, I could confirm that at least hart 1 (the first to be started by hart 0) is booting right after receiving a local interrupt from the latter, while hart 31 (which is not working) never receives any interrupt.
Also, I am inclined to believe that the problem is not in RC's implementation of CLINT (mainly defined in
devices/tilelink/CLINT.scala), because (1) its comments briefly mention that it should support up to 4095 devices and (2) my own inspection of its memory mapped scheme ranging from 0x0 to
0x10000 suggests that it should be able to index 4096 hart-private MIP registers.
My question is finally this: are OpenSBI constants and other default parameters making any assumptions that could prevent more than 16 cores from being indexed by CLINT for booting purposes? In particular, is SBI_PLATFORM_DEFAULT_HART_STACK_SIZE (include/sbi/sbi_platform.h) default value of 8192 enough for allowing hart 0 to communicate with all other cores?
And just to confirm a final point, the fact that each core can only describe up to 16 PMP regions should not have anything to do with it, right?
Any insights on this would be of very welcome.
Thanks,
Lucas