diff --git a/lib/sbi/sbi_system.c b/lib/sbi/sbi_system.c index d1fa3495..e9302721 100644 --- a/lib/sbi/sbi_system.c +++ b/lib/sbi/sbi_system.c @@ -72,7 +72,8 @@ void __noreturn sbi_system_reset(u32 reset_type, u32 reset_reason) /* Send HALT IPI to every hart other than the current hart */ while (!sbi_hsm_hart_interruptible_mask(dom, hbase, &hmask)) { - if (hbase <= cur_hartid) + if ((hbase <= cur_hartid) + && (cur_hartid < hbase + BITS_PER_LONG)) hmask &= ~(1UL << (cur_hartid - hbase)); if (hmask) sbi_ipi_send_halt(hmask, hbase);