Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add extra information into exception reporting #373

Merged
merged 17 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/img/stval2reg.edn
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
(def left-margin 100)
(def right-margin 100)
(def boxes-per-row 32)
(draw-column-headers {:height 20 :font-size 18 :labels (reverse ["0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "MXLEN-1"])})
(draw-column-headers {:height 20 :font-size 18 :labels (reverse ["0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "SXLEN-1"])})

(draw-box "Addr" {:span 32})

(draw-box "MXLEN" {:span 32 :borders {}})
(draw-box "SXLEN" {:span 32 :borders {}})
----
tariqkurd-repo marked this conversation as resolved.
Show resolved Hide resolved
24 changes: 23 additions & 1 deletion src/riscv-integration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,8 @@ authorising capability which caused the exception.

<<mtval2>> is set to zero for all PCC faults, and follows the standard rules for non-CHERI exceptions.
tariqkurd-repo marked this conversation as resolved.
Show resolved Hide resolved
tariqkurd-repo marked this conversation as resolved.
Show resolved Hide resolved

If <<mtval>> is read-only-zero then <<mtval2>> is also read-only-zero.

.Machine trap value register 2
[#mtval2-format]
include::img/mtval2reg.edn[]
Expand Down Expand Up @@ -1032,17 +1034,37 @@ The fields are identical to <<mtval>> for CHERI exceptions.

The <<stval2>> register is an SXLEN-bit read-write register.

The CSR address is 0x14b.
The CSR address is 0x24b.

When a fault is taken into S-mode <<stval2>> is updated as for <<mtval2>> for all CHERI memory access traps.
tariqkurd-repo marked this conversation as resolved.
Show resolved Hide resolved
tariqkurd-repo marked this conversation as resolved.
Show resolved Hide resolved
It is set to zero in all other cases.

NOTE: This is not a standard RISC-V CSR, but <<mtval2>> is. 0x14b is the regular location for the CSR.

<<stval2>> holds the same set of values that <<mtval2>> can hold.

.Supervisor trap value register 2
[#stval2-format]
include::img/stval2reg.edn[]

[#vstval2,reftext="vstval2"]
==== Virtual Supervisor Trap Value Register 2 (vstval2)
tariqkurd-repo marked this conversation as resolved.
Show resolved Hide resolved

The <<vstval2>> register is an SXLEN-bit read-write register.

The CSR address is 0x24b.

When a fault is taken into VS-mode <<vstval2>> is updated as for <<mtval2>> for all CHERI memory access traps.
It is set to zero in all other cases.

NOTE: This is not a standard RISC-V CSR, but <<mtval2>> is. 0x24b is the regular location for the CSR.

<<vstval2>> holds the same set of values that <<stval2>> can hold.

.Virtual supervisor trap value register 2
[#vstval2-format]
include::img/vstval2reg.edn[]
tariqkurd-repo marked this conversation as resolved.
Show resolved Hide resolved

=== Unprivileged CSRs

Unlike machine and supervisor level CSRs, {cheri_base_ext_name} does not require
Expand Down
Loading