Skip to content

Commit

Permalink
Merge pull request riscv#209 from ved-rivos/smrnmi
Browse files Browse the repository at this point in the history
Add Smrnmi handling
  • Loading branch information
ved-rivos committed Mar 15, 2024
2 parents b533fb4 + 4b56b14 commit bf22025
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cfi_forward.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,13 @@ at the privilege level the hart was previously in, and the `ELP` is set to
value `y`, then `ELP` is set to the value of `pelp` if `__y__LPE` is 1;
otherwise, it is set to `NO_LP_EXPECTED`.

When the Smrnmi extension is implemented, a `MNPELP` field (bit 9) is provided
in the `mnstatus` CSR to hold the previous `ELP` state on a trap to the RNMI
handler. When a RNMI trap is delivered, the `MNPELP` is set to `ELP` and `ELP`
set to `NO_LP_EXPECTED`. Upon a `MNRET`, if the `mnstatus.MNPP` holds the value
`y`, then `ELP` is set to the value of `MNPELP` if `yLPE` is 1; otherwise, it is
set to `NO_LP_EXPECTED`.

[NOTE]
====
The trap handler in privilege mode `x` must save the `__x__PELP` bit and the
Expand Down

0 comments on commit bf22025

Please sign in to comment.