Browse Source

TSR is read-only 0 when S-mode is not supported. (#890)

According the privileged spec, TSR is read-only 0 when S-mode is not supported. (56515289e5/src/machine.tex (L860-L861))
pull/892/head
sven 4 years ago
committed by GitHub
parent
commit
d1f2019ec1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      riscv/csrs.cc

3
riscv/csrs.cc

@ -439,7 +439,8 @@ bool mstatus_csr_t::unlogged_write(const reg_t val) noexcept {
const reg_t mask = sstatus_write_mask
| MSTATUS_MIE | MSTATUS_MPIE | MSTATUS_MPRV
| MSTATUS_MPP | MSTATUS_TW | MSTATUS_TSR
| MSTATUS_MPP | MSTATUS_TW
| (proc->extension_enabled('S') ? MSTATUS_TSR : 0)
| (has_page ? MSTATUS_TVM : 0)
| (has_gva ? MSTATUS_GVA : 0)
| (has_mpv ? MSTATUS_MPV : 0);

Loading…
Cancel
Save