Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arch-riscv: Fix the behavior of write to status CSR
According to RISC V spec Volumn I, Section 11.1, the CSR will be written only if RS1 != 0 or imm != 0. However, after the change of CL(https://gem5-review.googlesource.com/c/public/gem5/+/67717), it will cause IllegalInstFault to write status CSR if we don't change the data. Example of Instruction Fault for mstatus ``` addi a5, zero, 8 csrc mstatus, a5 ``` It will cause instruction fault if mstatus value is 0 due to "newdata_all == olddata_all". We can just simply check if the data value is changed out of mask. Change-Id: Iab4ce7ac646a9105dc04e69c24d084572e28ebab Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/67897 Reviewed-by: Yu-hsin Wang <[email protected]> Maintainer: Jason Lowe-Power <[email protected]> Tested-by: kokoro <[email protected]>
- Loading branch information