Description / Steps to reproduce the issue
- riscv_percpu_init will first initialize and add g_percpu to g_freelist, the g_percpu[i].irq_stack is sequential initialized.
static void riscv_percpu_init(void) {
...
for (i = 0; i < HART_CNT; i++)
{
/* Set interrupt stack (if any) */
#if CONFIG_ARCH_INTERRUPTSTACK > 15
g_percpu[i].irq_stack = (uintptr_t)g_intstacktop - i * INT_STACK_SIZE;
#endif
sq_addlast((struct sq_entry_s *) &g_percpu[i], &g_freelist);
}
...
}
-
riscv_percpu_add_hart(...) will dequeue the g_freelist and assign the g_percpu to the booting hart
but the hart booting order will mismatch with the sequential order.
-
riscv_percpu_get_irqstack will get irq_stack.
On which OS does this issue occur?
[OS: Linux]
What is the version of your OS?
Ubuntu24.04
NuttX Version
96f440f0c068f278cc11a956c2c6cf52ff79cf01
Issue Architecture
[Arch: risc-v]
Issue Area
[Area: Kernel]
Host information
No response
Verification
Description / Steps to reproduce the issue
static void riscv_percpu_init(void) {
...
for (i = 0; i < HART_CNT; i++)
{
/* Set interrupt stack (if any) */
#if CONFIG_ARCH_INTERRUPTSTACK > 15
g_percpu[i].irq_stack = (uintptr_t)g_intstacktop - i * INT_STACK_SIZE;
#endif
...
}
riscv_percpu_add_hart(...) will dequeue the g_freelist and assign the g_percpu to the booting hart
but the hart booting order will mismatch with the sequential order.
riscv_percpu_get_irqstack will get irq_stack.
On which OS does this issue occur?
[OS: Linux]
What is the version of your OS?
Ubuntu24.04
NuttX Version
96f440f0c068f278cc11a956c2c6cf52ff79cf01
Issue Architecture
[Arch: risc-v]
Issue Area
[Area: Kernel]
Host information
No response
Verification