aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorLIU Zhiwei <zhiwei_liu@c-sky.com>2021-09-01 20:45:39 +0800
committerAlistair Francis <alistair.francis@wdc.com>2021-09-21 07:56:49 +1000
commit15732b8ed290460334ee58dd25939da733f362fd (patch)
tree8c7f1bda016d5d06dbf4b44a071ab93b965928e6 /target
parenta44da25aa69a7a3588a33607a8067c87b3b5a68e (diff)
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 <zhiwei_liu@c-sky.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-id: 20210901124539.222868-1-zhiwei_liu@c-sky.com Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'target')
-rw-r--r--target/riscv/csr.c2
1 files changed, 1 insertions, 1 deletions
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;