target/riscv: use riscv_csrr in riscv_csr_read
Commit38c83e8d3a("target/riscv: raise an exception when CSRRS/CSRRC writes a read-only CSR") changed the behavior of riscv_csrrw, which would formerly be treated as read-only if the write mask were set to 0. Fixes an exception being raised when accessing read-only vector CSRs like vtype. Fixes:38c83e8d3a("target/riscv: raise an exception when CSRRS/CSRRC writes a read-only CSR") Signed-off-by: stove <stove@rivosinc.com> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Message-ID: <20250827203617.79947-1-stove@rivosinc.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
c69fc80035
commit
cebaf7434b
1 changed files with 1 additions and 1 deletions
|
|
@ -874,7 +874,7 @@ static inline void riscv_csr_write(CPURISCVState *env, int csrno,
|
|||
static inline target_ulong riscv_csr_read(CPURISCVState *env, int csrno)
|
||||
{
|
||||
target_ulong val = 0;
|
||||
riscv_csrrw(env, csrno, &val, 0, 0, 0);
|
||||
riscv_csrr(env, csrno, &val);
|
||||
return val;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue