Skip to content

Commit 138beed

Browse files
committed
Use stval/stval2 for HS-mode exceptions, not htval/htval2
htval exists solely to communiate extra information to HS-mode about VS-mode faults to HS-mode, currently just the guest physical address for G-stage page faults. CHERI exceptions can and must (to align with other kinds of faults, including HS-mode's own faults) use stval/stval2 when trapping from HS-mode. Fixes #482
1 parent d6f2925 commit 138beed

File tree

3 files changed

+0
-64
lines changed

3 files changed

+0
-64
lines changed

src/hypervisor-integration.adoc

-30
Original file line numberDiff line numberDiff line change
@@ -56,36 +56,6 @@ The reset value is 0.
5656
Bit 28 of <<hedeleg>> now refers to a valid exception and so can be used to
5757
delegate CHERI exceptions to virtual supervisor mode.
5858
59-
[#htval,reftext="htval"]
60-
=== Hypervisor Trap Value Register (htval)
61-
62-
The <<htval>> register operates as described in cite:[riscv-priv-spec].
63-
64-
<<htval>> is updated following the same rules as <<mtval>> for CHERI exceptions
65-
which are taken in HS-mode.
66-
67-
.Hypervisor trap value register
68-
include::img/htvalreg.edn[]
69-
70-
[#htval2,reftext="htval2"]
71-
=== Hypervisor Trap Value Register 2 (htval2)
72-
73-
The <<htval2>> register is an HSXLEN-bit read-write register, which is added as
74-
part of {cheri_base_ext_name} when the hypervisor extension is supported. Its
75-
CSR address is 0x64b.
76-
77-
<<htval2>> is updated following the same rules as <<mtval2>> for CHERI exceptions,
78-
load page fault and store page fault exceptions which are taken in HS-mode.
79-
80-
The fields are identical to <<mtval2>> for CHERI exceptions.
81-
82-
NOTE: <<htval2>> is not a standard RISC-V CSR, but <<mtval2>>
83-
is.
84-
85-
.Hypervisor trap value register 2
86-
[#hstval2-format]
87-
include::img/htval2reg.edn[]
88-
8959
[#vsstatus,reftext="vsstatus"]
9060
=== Virtual Supervisor Status Register (vsstatus)
9161

src/img/htval2reg.edn

-20
This file was deleted.

src/img/htvalreg.edn

-14
This file was deleted.

0 commit comments

Comments
 (0)