Skip to content

Conversation

@mattkur
Copy link
Contributor

@mattkur mattkur commented Oct 21, 2025

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 .

@mattkur mattkur requested review from a team and tjones60 October 21, 2025 13:59
@mattkur mattkur requested a review from a team as a code owner October 21, 2025 13:59
Copilot AI review requested due to automatic review settings October 21, 2025 13:59
Copy link
Contributor

Copilot AI left a 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

@github-actions
Copy link

Copy link
Contributor

@smalis-msft smalis-msft left a 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.

@mattkur mattkur merged commit 83bccbf into microsoft:main Oct 22, 2025
53 checks passed
@mattkur mattkur deleted the set-vtl2-ram-test branch October 22, 2025 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants