-
Notifications
You must be signed in to change notification settings - Fork 161
petri: allow test to override default VTL2 allocation scheme #2224
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
Conversation
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 promotes VTL2 memory allocation configuration settings from internal OpenVMM config to the Petri VM builder API, making it easier to test different VTL2 memory allocation schemes. The changes extract hardcoded allocation logic and expose it through a builder method.
Key changes:
- Added
with_vtl2_base_address_type()builder method to configure VTL2 memory allocation - Refactored existing tests to use the new API instead of direct config modification
- Moved default VTL2 base address type logic from construct code to the Firmware initialization
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| petri/src/vm/mod.rs | Adds vtl2_base_address_type field to OpenHclConfig and with_vtl2_base_address_type() builder method; moves default allocation logic to Firmware::openhcl_uefi() |
| petri/src/vm/openvmm/construct.rs | Removes hardcoded VTL2 allocation logic and uses config from OpenHclConfig; adds logic to disable late map based on allocation type |
| vmm_tests/vmm_tests/tests/tests/x86_64/openhcl_linux_direct.rs | Refactors test to use new builder API instead of modifying backend config directly |
| vmm_tests/vmm_tests/tests/tests/x86_64/openhcl_uefi.rs | Adds VTL2 allocation configuration to nvme_relay test |
| petri/src/vm/hyperv/mod.rs | Adds TODO comment for future Hyper-V backend support |
smalis-msft
left a comment
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.
I think this looks good, but i'd like a sanity check from @chris-oo too.
Promote the settings that change how VTL2 memory is allocated to the Petri VM objects, rather than being hidden in the depths of the OpenVMM config. This is a convenience for additional tests coming as part of #2215 .