-
Notifications
You must be signed in to change notification settings - Fork 132
virt_whp: add support for MMIO hypercalls #1578
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
base: main
Are you sure you want to change the base?
Conversation
Support MMIO hypercalls from VTL2, but don't advertise this capability yet. This is currently just useful for private testing, but it provides the infrastructure to implement this in other places (e.g., virt_mshv_vtl).
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.
Pull Request Overview
This PR adds support for MMIO hypercalls for VTL2 testing, laying the groundwork to extend this support to other components.
- Introduces async handling of hypercalls in both x86 and aarch64 processors.
- Implements a new PendingHypercall enum to support asynchronous MMIO read and write operations.
- Updates hypercall dispatch and support functions across several hypervisor modules.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
vmm_core/virt_whp/src/vp.rs | Updated async handling for hypercalls in x86 and aarch64 contexts |
vmm_core/virt_whp/src/hypercalls.rs | Added PendingHypercall enum and new MMIO read/write implementations |
vm/hv1/hvdef/src/lib.rs | Added conversion implementation from HvResult<()> to HypercallOutput |
vm/hv1/hv1_hypercall/src/support.rs | Extended AsHandler trait and added hypercall completing helpers |
vm/hv1/hv1_hypercall/src/lib.rs | Re-exported new hypercall completing helpers |
vm/hv1/hv1_hypercall/src/imp.rs | Introduced new hypercall implementations for MMIO read/write |
vm/hv1/hv1_hypercall/src/aarch64.rs | Adjusted instruction pointer advancement behavior in AArch64 |
Comments suppressed due to low confidence (1)
vm/hv1/hv1_hypercall/src/aarch64.rs:93
- [nitpick] Resetting 'self.pre_advanced' without an inline comment can be confusing. Please add a comment clarifying why this flag is reset in this context.
self.pre_advanced = false;
@@ -90,6 +90,7 @@ impl<T: Arm64RegisterState> HypercallIo for Arm64RegisterIo<T> { | |||
if self.pre_advanced { | |||
let pc = self.inner.pc().wrapping_sub(4); | |||
self.inner.set_pc(pc); | |||
self.pre_advanced = false; |
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.
Is there a test we could add that would've caught this?
Support MMIO hypercalls from VTL2, but don't advertise this capability yet. This is currently just useful for private testing, but it provides the infrastructure to implement this in other places (e.g., virt_mshv_vtl).