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

2024-03-11 Thread LIU Zhiwei
On 2024/3/11 11:08, Yu-Ming Chang 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

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

2024-03-10 Thread Richard Henderson
On 3/10/24 17:08, 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 v2] target/riscv: raise an exception when CSRRS/CSRRC writes a read-only CSR

2024-03-10 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