-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'crd-james' of https://github.com/riscv-software-src/ris…
…cv-unified-db into crd-james
- Loading branch information
Showing
51 changed files
with
2,649 additions
and
1,221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,5 @@ group :development do | |
gem "solargraph" | ||
gem 'rubocop-minitest' | ||
gem 'ruby-prof' | ||
gem "ruby-prof-flamegraph" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# yaml-language-server: $schema=../../../schemas/csr_schema.json | ||
|
||
htinst: | ||
address: 0x64a | ||
long_name: Hypervisor Trap Instruction Register | ||
description: | | ||
When a trap is taken into HS-mode, mtinst is written with a value that, if nonzero, | ||
provides information about the instruction that trapped, to assist software in handling the trap. | ||
The values that may be written to mtinst on a trap are documented in TODO. | ||
htinst is a WARL register that need only be able to hold the values that the implementation may automatically write to it on a trap. | ||
priv_mode: S | ||
length: SXLEN | ||
definedBy: H | ||
fields: | ||
VALUE: | ||
location_rv64: 63-0 | ||
location_rv32: 31-0 | ||
type(): | | ||
if ( (TINST_VALUE_ON_FINAL_LOAD_GUEST_PAGE_FAULT != "always zero") | ||
|| (TINST_VALUE_ON_FINAL_STORE_AMO_GUEST_PAGE_FAULT != "always zero") | ||
|| (TINST_VALUE_ON_FINAL_INSTRUCTION_GUEST_PAGE_FAULT != "always zero") | ||
|| (TINST_VALUE_ON_INSTRUCTION_ADDRESS_MISALIGNED != "always zero") | ||
|| (TINST_VALUE_ON_BREAKPOINT != "always zero") | ||
|| (TINST_VALUE_ON_VIRTUAL_INSTRUCTION != "always zero") | ||
|| (TINST_VALUE_ON_LOAD_ADDRESS_MISALIGNED != "always zero") | ||
|| (TINST_VALUE_ON_LOAD_ACCESS_FAULT != "always zero") | ||
|| (TINST_VALUE_ON_STORE_AMO_ADDRESS_MISALIGNED != "always zero") | ||
|| (TINST_VALUE_ON_STORE_AMO_ACCESS_FAULT != "always_zero") | ||
|| (TINST_VALUE_ON_UCALL != "always zero") | ||
|| (TINST_VALUE_ON_SCALL != "always zero") | ||
|| (TINST_VALUE_ON_MCALL != "always zero") | ||
|| (TINST_VALUE_ON_VSCALL != "always zero") | ||
|| (TINST_VALUE_ON_LOAD_PAGE_FAULT != "always zero") | ||
|| (TINST_VALUE_ON_STORE_AMO_PAGE_FAULT != "always zero")) { | ||
return CsrFieldType::RWH; | ||
} else { | ||
return CsrFieldType::RO; | ||
} | ||
description: | | ||
Exception-speicific information for a trap into HS-mode. | ||
reset_value: UNDEFINED_LEGAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# yaml-language-server: $schema=../../../schemas/csr_schema.json | ||
|
||
htval: | ||
address: 0x643 | ||
long_name: Hypervisor Trap Value Register | ||
description: | | ||
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. | ||
priv_mode: M | ||
length: MXLEN | ||
definedBy: H | ||
fields: | ||
VALUE: | ||
location_rv64: 63-0 | ||
location_rv32: 31-0 | ||
type(): | | ||
if (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) { | ||
return CsrFieldType::RWH; | ||
} else { | ||
return CsrFieldType::RO; | ||
} | ||
description: | | ||
Exception-speicific information for a trap into M-mode. | ||
reset_value: UNDEFINED_LEGAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# yaml-language-server: $schema=../../../schemas/csr_schema.json | ||
|
||
mtinst: | ||
address: 0x34a | ||
long_name: Machine Trap Instruction Register | ||
description: | | ||
When a trap is taken into M-mode, mtinst is written with a value that, if nonzero, | ||
provides information about the instruction that trapped, to assist software in handling the trap. | ||
The values that may be written to mtinst on a trap are documented in TODO. | ||
mtinst is a WARL register that need only be able to hold the values that the implementation may automatically write to it on a trap. | ||
priv_mode: M | ||
length: MXLEN | ||
definedBy: H | ||
fields: | ||
VALUE: | ||
location_rv64: 63-0 | ||
location_rv32: 31-0 | ||
type(): | | ||
if ( (TINST_VALUE_ON_FINAL_LOAD_GUEST_PAGE_FAULT != "always zero") | ||
|| (TINST_VALUE_ON_FINAL_STORE_AMO_GUEST_PAGE_FAULT != "always zero") | ||
|| (TINST_VALUE_ON_FINAL_INSTRUCTION_GUEST_PAGE_FAULT != "always zero") | ||
|| (TINST_VALUE_ON_INSTRUCTION_ADDRESS_MISALIGNED != "always zero") | ||
|| (TINST_VALUE_ON_BREAKPOINT != "always zero") | ||
|| (TINST_VALUE_ON_VIRTUAL_INSTRUCTION != "always zero") | ||
|| (TINST_VALUE_ON_LOAD_ADDRESS_MISALIGNED != "always zero") | ||
|| (TINST_VALUE_ON_LOAD_ACCESS_FAULT != "always zero") | ||
|| (TINST_VALUE_ON_STORE_AMO_ADDRESS_MISALIGNED != "always zero") | ||
|| (TINST_VALUE_ON_STORE_AMO_ACCESS_FAULT != "always_zero") | ||
|| (TINST_VALUE_ON_UCALL != "always zero") | ||
|| (TINST_VALUE_ON_SCALL != "always zero") | ||
|| (TINST_VALUE_ON_MCALL != "always zero") | ||
|| (TINST_VALUE_ON_VSCALL != "always zero") | ||
|| (TINST_VALUE_ON_LOAD_PAGE_FAULT != "always zero") | ||
|| (TINST_VALUE_ON_STORE_AMO_PAGE_FAULT != "always zero")) { | ||
return CsrFieldType::RWH; | ||
} else { | ||
return CsrFieldType::RO; | ||
} | ||
description: | | ||
Exception-speicific information for a trap into M-mode. | ||
reset_value: UNDEFINED_LEGAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# yaml-language-server: $schema=../../../schemas/csr_schema.json | ||
|
||
mtval2: | ||
address: 0x34b | ||
long_name: Machine Second Trap Value Register | ||
description: | | ||
When a trap is taken into M-mode from a virtual mode, mtval2 is written with additional exception-specific information, | ||
alongside mtval, to assist software in handling the trap. | ||
When a guest-page-fault trap is taken into M-mode, mtval2 is written with either zero or the guest physical address that faulted, shifted right by 2 bits. For other traps, mtval2 is set to zero, but a future standard or extension may redefine mtval2's setting for other traps. | ||
If a guest-page fault is due to an implicit memory access during first-stage (VS-stage) address translation, a guest physical address written to mtval2 is that of the implicit memory access that faulted. Additional information is provided in CSR mtinst to disambiguate such situations. | ||
Otherwise, for misaligned loads and stores that cause guest-page faults, a nonzero guest physical address in mtval2 corresponds to the faulting portion of the access as indicated by the virtual address in mtval. For instruction guest-page faults on systems with variable-length instructions, a nonzero mtval2 corresponds to the faulting portion of the instruction as indicated by the virtual address in mtval. | ||
mtval2 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. | ||
priv_mode: M | ||
length: MXLEN | ||
definedBy: H | ||
fields: | ||
VALUE: | ||
location_rv64: 63-0 | ||
location_rv32: 31-0 | ||
type(): | | ||
if (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) { | ||
return CsrFieldType::RWH; | ||
} else { | ||
return CsrFieldType::RO; | ||
} | ||
description: | | ||
Exception-speicific information for a trap into M-mode. | ||
reset_value: UNDEFINED_LEGAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.