From d988524af3b84b65e97f9584f104252fc15f5b96 Mon Sep 17 00:00:00 2001 From: bigmagic Date: Wed, 17 Aug 2022 17:34:42 +0800 Subject: [PATCH] fixed 64bit write mucounteren csr error --- target/riscv/csr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 657b28337d02..bcd91d859e71 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -1261,6 +1261,7 @@ static int write_mucounteren(CPURISCVState *env, int csrno, target_ulong val) { extern int use_icount; extern int icount_shift_flag; + val = val & 0xffffffff; if(first_run_flag == 0) { if(use_icount)