-
Notifications
You must be signed in to change notification settings - Fork 171
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
Hypervisor extension #612
base: master
Are you sure you want to change the base?
Hypervisor extension #612
Conversation
- Add several hypervisor extension specific CSRs - Add fields to existing machine-level CSRs - Refactor MStatus to use 64 bits and split accesses for RV32
- Impl read_CSR for hypervisor CSRs - Impl write_CSR for hypervisor CSRs - Set initial values for hypervisor CSRs - Set initial value for misa[H]
- Model trap through TrapCause union - Add H-ext exceptions - Add H-ext interrupts - Use TrapContext struct to pass exception exception - Delegate to virtualized mode based on hedeleg
MPV : 39, | ||
GVA : 38, | ||
MBE : 37, | ||
SBE : 36, | ||
|
||
// The SXL and UXL fields don't exist on RV32, so they are modelled | ||
// via explicit getters and setters; see below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is out of date.
|
||
function get_hstatus_VSXL(h : Hstatus) -> arch_xlen = { | ||
if sizeof(xlen) == 32 | ||
then arch_to_bits(RV32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"When HSXLEN=32, VSXL field does not exist." The spec isn't terribly clear on what that means, but I'd assume WPRI, so the read should be 0b00 and not 0b01.
I see this code was inspired by the UXL field of the sstatus register, so I'll send a patch for that, unless you know something I missed.
Thanks.
register mstatush : Mstatush | ||
|
||
bitfield Mstatus : xlenbits = { | ||
bitfield Mstatus : bits(64) = { | ||
SD : xlen - 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a version of the hypervisor extension ported on a more recent version of the model. Feel welcome to provide any feedback
In order to verify the modifications & additions to this version of the model, the following tests are used:
By booting Linux on top of Xvisor on top of OpenSBI(My current setup requires terminal input which is not already implemented nor part of the hypervisor spec.)PS I closed #334 in favor of this pull request.