diff options
author | Scott Johnson <scott.johnson@arilinc.com> | 2022-07-13 10:45:41 -0700 |
---|---|---|
committer | Scott Johnson <scott.johnson@arilinc.com> | 2022-07-13 18:57:56 -0700 |
commit | 3688fd8302d1b7b8eea1dd8f6206ceab1bedfb2c (patch) | |
tree | 1a481ce817e2e5e2ecd4c9badb5cf2e1385bff00 /riscv/csrs.cc | |
parent | b21a28bce174f2d1ac3e8a424bc9b9b1f01251a6 (diff) | |
download | spike-3688fd8302d1b7b8eea1dd8f6206ceab1bedfb2c.zip spike-3688fd8302d1b7b8eea1dd8f6206ceab1bedfb2c.tar.gz spike-3688fd8302d1b7b8eea1dd8f6206ceab1bedfb2c.tar.bz2 |
Properly log mstatush side effect updates
These have never been logged properly.
Diffstat (limited to 'riscv/csrs.cc')
-rw-r--r-- | riscv/csrs.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/riscv/csrs.cc b/riscv/csrs.cc index 7a52353..6f8f260 100644 --- a/riscv/csrs.cc +++ b/riscv/csrs.cc @@ -616,7 +616,9 @@ bool misa_csr_t::unlogged_write(const reg_t val) noexcept { | (1 << CAUSE_STORE_GUEST_PAGE_FAULT) ; state->medeleg->write(state->medeleg->read() & ~hypervisor_exceptions); - state->mstatus->write(state->mstatus->read() & ~(MSTATUS_GVA | MSTATUS_MPV)); + const reg_t new_mstatus = state->mstatus->read() & ~(MSTATUS_GVA | MSTATUS_MPV); + state->mstatus->write(new_mstatus); + if (state->mstatush) state->mstatush->write(new_mstatus >> 32); // log mstatush change state->mie->write_with_mask(MIP_HS_MASK, 0); // also takes care of hie, sie state->mip->write_with_mask(MIP_HS_MASK, 0); // also takes care of hip, sip, hvip state->hstatus->write(0); |