On Wed, Sep 1, 2021 at 10:51 PM LIU Zhiwei <zhiwei_...@c-sky.com> wrote: > > These variables should be target_ulong. If truncated to int, > the bool conditions they indicate will be wrong. > > As satp is very important for Linux, this bug almost fails every boot. > > Signed-off-by: LIU Zhiwei <zhiwei_...@c-sky.com>
Thanks! Applied to riscv-to-apply.next Alistair > --- > target/riscv/csr.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/target/riscv/csr.c b/target/riscv/csr.c > index 50a2c3a3b4..ba9818f6a5 100644 > --- a/target/riscv/csr.c > +++ b/target/riscv/csr.c > @@ -986,7 +986,7 @@ static RISCVException read_satp(CPURISCVState *env, int > csrno, > static RISCVException write_satp(CPURISCVState *env, int csrno, > target_ulong val) > { > - int vm, mask, asid; > + target_ulong vm, mask, asid; > > if (!riscv_feature(env, RISCV_FEATURE_MMU)) { > return RISCV_EXCP_NONE; > -- > 2.25.1 > >