htval
Hypervisor Trap Value Register
When a trap is taken into HS-mode, htval is written with additional exception-specific information, alongside stval, to assist software in handling the trap.
When a guest-page-fault trap is taken into HS-mode, htval is written with either zero or the guest physical address that faulted, shifted right by 2 bits. For other traps, htval is set to zero, but a future standard or extension may redefine htval’s setting for other traps.
A guest-page fault may arise due to an implicit memory access during first-stage (VS-stage) address translation, in which case a guest physical address written to htval is that of the implicit memory access that faulted-for example, the address of a VS-level page table entry that could not be read. (The guest physical address corresponding to the original virtual address is unknown when VS-stage translation fails to complete.) Additional information is provided in CSR htinst to disambiguate such situations.
Otherwise, for misaligned loads and stores that cause guest-page faults, a nonzero guest physical address in htval corresponds to the faulting portion of the access as indicated by the virtual address in stval. For instruction guest-page faults on systems with variable-length instructions, a nonzero htval corresponds to the faulting portion of the instruction as indicated by the virtual address in stval.
htval is a WARL register that must be able to hold zero and may be capable of holding only an arbitrary subset of other 2-bit-shifted guest physical addresses, if any.
Attributes
Defining Extension |
|
---|---|
CSR Address |
0x643 |
Length |
32 when CSR[misa].MXL == 0 64 when CSR[misa].MXL == 1 |
Privilege Mode |
M |
Format
This CSR format changes dynamically.
Field Summary
Name | Location | Type | Reset Value |
---|---|---|---|
* 31:0 when CSR[misa].MXL == 0 * 63:0 when CSR[misa].MXL == 1 |
[when,"(((REPORT_GPA_IN_TVAL_ON_LOAD_GUEST_PAGE_FAULT || REPORT_GPA_IN_TVAL_ON_STORE_AMO_GUEST_PAGE_FAULT) || REPORT_GPA_IN_TVAL_ON_INSTRUCTION_GUEST_PAGE_FAULT) || REPORT_GPA_IN_TVAL_ON_INTERMEDIATE_GUEST_PAGE_FAULT)"] RW-H [when,"!(((REPORT_GPA_IN_TVAL_ON_LOAD_GUEST_PAGE_FAULT || REPORT_GPA_IN_TVAL_ON_STORE_AMO_GUEST_PAGE_FAULT) || REPORT_GPA_IN_TVAL_ON_INSTRUCTION_GUEST_PAGE_FAULT) || REPORT_GPA_IN_TVAL_ON_INTERMEDIATE_GUEST_PAGE_FAULT)"] RO |
UNDEFINED_LEGAL |