Skip to content

Commit

Permalink
Merge pull request #43 from ved-rivos/0622_2
Browse files Browse the repository at this point in the history
update SRET and MRET behavior for clearing xDT
  • Loading branch information
ved-rivos authored Jun 22, 2024
2 parents 650bf7c + 4865b9f commit 0ed5196
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/riscv-double-trap.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ taken into M-mode. The `mtval2` register is then set to what would be otherwise
written into the `mcause` register by the _unexpected trap_. The `mcause`
register is set to 16, the double-trap exception code.

An `SRET` instruction sets the `SDT` bit to 0.
When executing in S-mode, the `SRET` instruction sets `sstatus.SDT` to 0, and
when executing in VS-mode, it sets `vsstatus.SDT` to 0. If the new privilege
mode is less privileged than VS-mode, it also sets `vsstatus.SDT` to 0.

[NOTE]
====
Expand Down Expand Up @@ -220,7 +222,9 @@ are platform-specific. The range of possible actions include restarting
the affected hart or restarting the entire platform, among others.
====

The `MRET` and `SRET` instructions set the `MDT` bit to 0.
The `MRET` and `SRET` instructions, when executed in M-mode, set the `MDT` bit
to 0. If the new privilege mode is less privileged than S/HS-mode, `sstatus.SDT`
is set to 0. If it is less privileged than VS-mode, `vsstatus.SDT` is set to 0.

The Smdbltrp extension introduces a read-write critical-error-trigger (`cetrig`)
field (bit 19) to the `dcsr` CSR cite:[DBG]. When `cetrig` is set to 1, a hart
Expand Down

0 comments on commit 0ed5196

Please sign in to comment.