diff --git a/src/arch/riscv/sbi.c b/src/arch/riscv/sbi.c index 96522cae0..39b120c6f 100644 --- a/src/arch/riscv/sbi.c +++ b/src/arch/riscv/sbi.c @@ -309,13 +309,13 @@ struct sbiret sbi_rfence_handler(unsigned long fid) const size_t hart_mask_width = sizeof(hart_mask) * 8; if ((hart_mask_base != 0) && ((hart_mask_base >= hart_mask_width) || - ((hart_mask >> hart_mask_base) != 0))) + ((hart_mask << hart_mask_base) == 0))) { WARNING("sbi invalid hart_mask"); return (struct sbiret){SBI_ERR_INVALID_PARAM}; } - hart_mask = hart_mask >> hart_mask_base; + hart_mask = hart_mask << hart_mask_base; unsigned long phart_mask = vm_translate_to_pcpu_mask( cpu()->vcpu->vm, hart_mask, sizeof(hart_mask) * 8);