@@ -26,4 +26,6 @@ secondary_func_t secondary_cinit(struct secondary_data *data);
void smp_boot_secondary(int cpu, void (*func)(void));
void smp_boot_secondary_nofail(int cpu, void (*func)(void));
+void set_cpu_started(int cpu, bool started);
+
#endif /* _ASMRISCV_SMP_H_ */
@@ -74,3 +74,11 @@ void smp_boot_secondary_nofail(int cpu, void (*func)(void))
while (!cpu_online(cpu))
smp_wait_for_event();
}
+
+void set_cpu_started(int cpu, bool started)
+{
+ if (started)
+ cpumask_set_cpu(cpu, &cpu_started);
+ else
+ cpumask_clear_cpu(cpu, &cpu_started);
+}
When a CPU abruptly stops during the RISC-V SBI hart stop tests, it is considered to be offline. As such, it should be removed from the cpu_started mask so that future tests can initiate another smp_boot_secondary. Add a helper method to allow the RISC-V SBI boot hart to remove a dead CPU from the mask. Signed-off-by: James Raphael Tiovalen <jamestiotio@gmail.com> --- lib/riscv/asm/smp.h | 2 ++ lib/riscv/smp.c | 8 ++++++++ 2 files changed, 10 insertions(+)