Skip to content

Commit

Permalink
Merge pull request riscv#8 from deepak0414/typo_fix
Browse files Browse the repository at this point in the history
cfi_forward: Typo fixes and updating csr name
  • Loading branch information
ved-rivos authored Nov 22, 2022
2 parents e3375c2 + ced8daa commit 769f5a4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cfi_forward.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ The operation of this instruction is as follows:
[source, text]
----
If xFCFIACT == 1
lplr.ML = inst.MLPL
lplr.UL = inst.ULPL
else
[rd] = 0;
endif
Expand Down Expand Up @@ -329,18 +329,18 @@ bar:
A trap may need to be delivered to the same or higher privilege level on
completion of JALR but before the instruction at the target of JALR was decoded.
To avoid losing previous ELP state, MPELP and SPELP bits are provided in the
mcfistatus CSR for M-mode and HS/S-mode respectively. The `SPELP` bits can be
accessed through the `scfistatus` CSR. To avoid losing `ELP` state on traps to
VS-mode, `SPELP` bits are provided in `vcfistatus` (VS-modes version of
`scfistatus`) to hold the `ELP`. When a trap is taken into VS-mode, the `SPELP`
bits of `vcfistatus` CSR are updated with `ELP`. When `V=1`, `scfistatus`
aliases to `vcfistatus` CSR. The `xPELP` fields in `mcfistatus` and `vcfistatus`
mstatus CSR for M-mode and HS/S-mode respectively. The `SPELP` bits can be
accessed through the `sstatus` CSR. To avoid losing `ELP` state on traps to
VS-mode, `SPELP` bits are provided in `vsstatus` (VS-modes version of
`sstatus`) to hold the `ELP`. When a trap is taken into VS-mode, the `SPELP`
bits of `vsstatus` CSR are updated with `ELP`. When `V=1`, `sstatus`
aliases to `vsstatus` CSR. The `xPELP` fields in `mstatus` and `vsstatus`
are WARL fields. The trap handler should preserve the `lplr` CSR.

When a trap is taken into privilege mode `x`, the `xELP` bits are updated with
current `ELP` and `ELP` is set to `NO_LP_EXPECTED`.

`MRET` or `SRET` instruction is used to return from a trap in M-mode or S-mode
respectively. When executing an `xRET` instruction, the `ELP` is set to `xPELP`
and xPELP is set to `NO_LP_EXPECTED`. The trap handler should put back the
and xPELP is set to `NO_LP_EXPECTED`. The trap handler should restore the
preserved `lplr` value before invoking `SRET` or `MRET`.

0 comments on commit 769f5a4

Please sign in to comment.