[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/33] target/riscv: Fix hgeie, hgeip
|
From: |
Alistair Francis |
|
Subject: |
[PULL 26/33] target/riscv: Fix hgeie, hgeip |
|
Date: |
Wed, 1 Sep 2021 12:09:51 +1000 |
From: Richard Henderson <richard.henderson@linaro.org>
We failed to write into *val for these read functions;
replace them with read_zero. Only warn about unsupported
non-zero value when writing a non-zero value.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20210823195529.560295-18-richard.henderson@linaro.org
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
target/riscv/csr.c | 26 ++++++++------------------
1 file changed, 8 insertions(+), 18 deletions(-)
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index 16bd859121..50a2c3a3b4 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -1124,17 +1124,12 @@ static RISCVException write_hcounteren(CPURISCVState
*env, int csrno,
return RISCV_EXCP_NONE;
}
-static RISCVException read_hgeie(CPURISCVState *env, int csrno,
- target_ulong *val)
-{
- qemu_log_mask(LOG_UNIMP, "No support for a non-zero GEILEN.");
- return RISCV_EXCP_NONE;
-}
-
static RISCVException write_hgeie(CPURISCVState *env, int csrno,
target_ulong val)
{
- qemu_log_mask(LOG_UNIMP, "No support for a non-zero GEILEN.");
+ if (val) {
+ qemu_log_mask(LOG_UNIMP, "No support for a non-zero GEILEN.");
+ }
return RISCV_EXCP_NONE;
}
@@ -1165,17 +1160,12 @@ static RISCVException write_htinst(CPURISCVState *env,
int csrno,
return RISCV_EXCP_NONE;
}
-static RISCVException read_hgeip(CPURISCVState *env, int csrno,
- target_ulong *val)
-{
- qemu_log_mask(LOG_UNIMP, "No support for a non-zero GEILEN.");
- return RISCV_EXCP_NONE;
-}
-
static RISCVException write_hgeip(CPURISCVState *env, int csrno,
target_ulong val)
{
- qemu_log_mask(LOG_UNIMP, "No support for a non-zero GEILEN.");
+ if (val) {
+ qemu_log_mask(LOG_UNIMP, "No support for a non-zero GEILEN.");
+ }
return RISCV_EXCP_NONE;
}
@@ -1601,10 +1591,10 @@ riscv_csr_operations csr_ops[CSR_TABLE_SIZE] = {
[CSR_HIP] = { "hip", hmode, NULL, NULL, rmw_hip
},
[CSR_HIE] = { "hie", hmode, read_hie, write_hie
},
[CSR_HCOUNTEREN] = { "hcounteren", hmode, read_hcounteren,
write_hcounteren },
- [CSR_HGEIE] = { "hgeie", hmode, read_hgeie,
write_hgeie },
+ [CSR_HGEIE] = { "hgeie", hmode, read_zero,
write_hgeie },
[CSR_HTVAL] = { "htval", hmode, read_htval,
write_htval },
[CSR_HTINST] = { "htinst", hmode, read_htinst,
write_htinst },
- [CSR_HGEIP] = { "hgeip", hmode, read_hgeip,
write_hgeip },
+ [CSR_HGEIP] = { "hgeip", hmode, read_zero,
write_hgeip },
[CSR_HGATP] = { "hgatp", hmode, read_hgatp,
write_hgatp },
[CSR_HTIMEDELTA] = { "htimedelta", hmode, read_htimedelta,
write_htimedelta },
[CSR_HTIMEDELTAH] = { "htimedeltah", hmode32, read_htimedeltah,
write_htimedeltah },
--
2.31.1
- [PULL 17/33] target/riscv: Use gen_arith for mulh and mulhu, (continued)
- [PULL 17/33] target/riscv: Use gen_arith for mulh and mulhu, Alistair Francis, 2021/08/31
- [PULL 14/33] target/riscv: Introduce DisasExtend and new helpers, Alistair Francis, 2021/08/31
- [PULL 18/33] target/riscv: Move gen_* helpers for RVM, Alistair Francis, 2021/08/31
- [PULL 19/33] target/riscv: Move gen_* helpers for RVB, Alistair Francis, 2021/08/31
- [PULL 20/33] target/riscv: Add DisasExtend to gen_unary, Alistair Francis, 2021/08/31
- [PULL 21/33] target/riscv: Use DisasExtend in shift operations, Alistair Francis, 2021/08/31
- [PULL 23/33] target/riscv: Use get_gpr in branches, Alistair Francis, 2021/08/31
- [PULL 22/33] target/riscv: Use extracts for sraiw and srliw, Alistair Francis, 2021/08/31
- [PULL 25/33] target/riscv: Fix rmw_sip, rmw_vsip, rmw_hsip vs write-only operation, Alistair Francis, 2021/08/31
- [PULL 24/33] target/riscv: Use {get, dest}_gpr for integer load/store, Alistair Francis, 2021/08/31
- [PULL 26/33] target/riscv: Fix hgeie, hgeip,
Alistair Francis <=
- [PULL 27/33] target/riscv: Reorg csr instructions, Alistair Francis, 2021/08/31
- [PULL 28/33] target/riscv: Use {get,dest}_gpr for RVA, Alistair Francis, 2021/08/31
- [PULL 29/33] target/riscv: Use gen_shift_imm_fn for slli_uw, Alistair Francis, 2021/08/31
- [PULL 30/33] target/riscv: Use {get,dest}_gpr for RVF, Alistair Francis, 2021/08/31
- [PULL 32/33] target/riscv: Tidy trans_rvh.c.inc, Alistair Francis, 2021/08/31
- [PULL 31/33] target/riscv: Use {get,dest}_gpr for RVD, Alistair Francis, 2021/08/31
- [PULL 33/33] target/riscv: Use {get,dest}_gpr for RVV, Alistair Francis, 2021/08/31