Skip to content

Commit

Permalink
Define hardware error exception cause code (#1105)
Browse files Browse the repository at this point in the history
* Define hardware error and software check exception cause codes

* Add description of hardware error exception
  • Loading branch information
aswaterman authored Oct 26, 2023
1 parent 6a08882 commit a1edc2f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/hypervisor.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ causes (codes 16 and above).
12 +
13 +
15 +
18 +
19 +
20 +
21 +
22 +
Expand All @@ -358,6 +360,8 @@ Read-only 0 +
Writable +
Writable +
Writable +
Writable +
Writable +
Read-only 0 +
Read-only 0 +
Read-only 0 +
Expand All @@ -377,6 +381,8 @@ Environment call from M-mode +
Instruction page fault +
Load page fault +
Store/AMO page fault +
Software check +
Hardware error +
Instruction guest-page fault +
Load guest-page fault +
Virtual instruction +
Expand Down
19 changes: 18 additions & 1 deletion src/machine.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,10 @@ _Designated for platform use_
13 +
14 +
15 +
16-23 +
16-17 +
18 +
19 +
20-23 +
24-31 +
32-47 +
48-63 +
Expand All @@ -1733,6 +1736,9 @@ Load page fault +
_Reserved_ +
Store/AMO page fault +
_Reserved_ +
Software check +
Hardware error +
_Reserved_ +
_Designated for custom use_ +
_Reserved_ +
_Designated for custom use_ +
Expand Down Expand Up @@ -1807,6 +1813,17 @@ an instruction. Therefore, these exceptions have lower priority than
other instruction address exceptions.
====

[NOTE]
====
A Hardware Error is a synchronous exception triggered when corrupted or
uncorrectable data is accessed explicitly or implicitly by an instruction. In
this context, "data" encompasses all types of information used within a RISC-V
hart. The __x__epc CSR on delivery of the hardware error exception holds the
address of the instruction that attempted to access corrupted data, while the
__x__tval CSR is either set to 0 or holds the virtual address of an
instruction fetch, load, or store that attempted to access corrupted data.
====

==== Machine Trap Value Register (`mtval`)

The `mtval` register is an MXLEN-bit read-write register formatted as
Expand Down
1 change: 1 addition & 0 deletions src/priv-preface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ implemented.
SXLEN≥UXLEN.
* Clarified that WFI is not a HINT instruction.
* Clarified ordering rules when PBMT=IO is used on main-memory regions.
* Defined hardware error and software check exception codes.

[.big]*_Preface to Version 20211203_*

Expand Down
8 changes: 7 additions & 1 deletion src/supervisor.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,10 @@ _Designated for platform use_
13 +
14 +
15 +
16-23 +
16-17 +
18 +
19 +
20-23 +
24-31 +
32-47 +
48-63 +
Expand All @@ -499,6 +502,9 @@ Load page fault +
_Reserved_ +
Store/AMO page fault +
_Reserved_ +
Software check +
Hardware error +
_Reserved_ +
_Designated for custom use_ +
_Reserved_ +
_Designated for custom use_ +
Expand Down

0 comments on commit a1edc2f

Please sign in to comment.