Re: [PATCH] target/riscv: raise an exception when CSRRS/CSRRC writes a read-only CSR

2024-03-09 Thread Richard Henderson
On 3/7/24 22:40, Yu-Ming Chang via wrote: Both CSRRS and CSRRC always read the addressed CSR and cause any read side effects regardless of rs1 and rd fields. Note that if rs1 specifies a register holding a zero value other than x0, the instruction will still attempt to write the unmodified value

[PATCH] target/riscv: raise an exception when CSRRS/CSRRC writes a read-only CSR

2024-03-08 Thread Yu-Ming Chang via
Both CSRRS and CSRRC always read the addressed CSR and cause any read side effects regardless of rs1 and rd fields. Note that if rs1 specifies a register holding a zero value other than x0, the instruction will still attempt to write the unmodified value back to the CSR and will cause any attendant