Re: [PATCH v3] target/riscv: don't read CSR in riscv_csrrw_do64

2023-09-06 Thread Alistair Francis
On Tue, Aug 8, 2023 at 7:10 PM Nikita Shubin wrote: > > From: Nikita Shubin > > As per ISA: > > "For CSRRWI, if rd=x0, then the instruction shall not read the CSR and > shall not cause any of the side effects that might occur on a CSR read." > > trans_csrrwi() and trans_csrrw() call do_csrw() if

Re: [PATCH v3] target/riscv: don't read CSR in riscv_csrrw_do64

2023-09-06 Thread Alistair Francis
On Tue, Aug 8, 2023 at 7:10 PM Nikita Shubin wrote: > > From: Nikita Shubin > > As per ISA: > > "For CSRRWI, if rd=x0, then the instruction shall not read the CSR and > shall not cause any of the side effects that might occur on a CSR read." > > trans_csrrwi() and trans_csrrw() call do_csrw() if

[PATCH v3] target/riscv: don't read CSR in riscv_csrrw_do64

2023-08-08 Thread Nikita Shubin
From: Nikita Shubin As per ISA: "For CSRRWI, if rd=x0, then the instruction shall not read the CSR and shall not cause any of the side effects that might occur on a CSR read." trans_csrrwi() and trans_csrrw() call do_csrw() if rd=x0, do_csrw() calls riscv_csrrw_do64(), via helper_csrw()