diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c index 3302213c..32055958 100644 --- a/lib/sbi/sbi_domain.c +++ b/lib/sbi/sbi_domain.c @@ -149,7 +149,7 @@ static bool is_region_valid(const struct sbi_domain_memregion *reg) if (reg->order == __riscv_xlen && reg->base != 0) return FALSE; - if (reg->base & (BIT(reg->order) - 1)) + if (reg->order < __riscv_xlen && (reg->base & (BIT(reg->order) - 1))) return FALSE; return TRUE;