From: LIU Zhiwei Date: Wed, 1 Sep 2021 12:45:39 +0000 (+0800) Subject: target/riscv: Fix satp write X-Git-Tag: v6.2.0-rc0~90^2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15732b8ed290460334ee58dd25939da733f362fd;p=thirdparty%2Fqemu.git target/riscv: Fix satp write 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 Reviewed-by: Bin Meng Reviewed-by: Alistair Francis Message-id: 20210901124539.222868-1-zhiwei_liu@c-sky.com Signed-off-by: Alistair Francis --- diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 50a2c3a3b49..ba9818f6a5c 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;