Skip to content

vmm_tests: vmgstool copy-igvmfile and boot from VMGS - #4300

Open
Katja (gruvian) wants to merge 4 commits into
microsoft:mainfrom
gruvian:kmomcilov/vmgstool-integration-tests
Open

vmm_tests: vmgstool copy-igvmfile and boot from VMGS#4300
Katja (gruvian) wants to merge 4 commits into
microsoft:mainfrom
gruvian:kmomcilov/vmgstool-integration-tests

Conversation

@gruvian

Copy link
Copy Markdown

Summary

  • Adds Petri support for booting OpenHCL from an IGVM stored in VMGS on Hyper-V.
  • Makes the vmfirmwareigvm resource ID configurable while preserving resource ID 1 for existing callers.
  • Builds and registers an x64 SNP OpenHCL resource DLL only when requested by the new test.
  • Adds an integration test that runs vmgstool copy-igvmfile, boots an SNP VM from the resulting VMGS, and verifies that OpenHCL is responsive.
  • Regenerates the affected Flowey workflows.

Validation

  • Clippy, documentation, and formatting validation passed.
  • cargo check -p vmm_tests --test tests passed.
  • The targeted Petri PowerShell test passed.
  • The existing vmgstool IGVM read/write test passed.
  • [PENDING] CI SNP test

@gruvian
Katja (gruvian) requested review from a team as code owners August 21, 2026 13:51
Copilot AI lite review requested due to automatic review settings August 21, 2026 13:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 extends the Petri test framework and Flowey pipelines to support booting OpenHCL on Hyper-V from an IGVM stored inside a VMGS, and adds an integration test that validates vmgstool copy-igvmfile by performing an actual SNP boot and responsiveness check.

Changes:

  • Add Petri VM config plumbing to optionally load OpenHCL from the VMGS “guest firmware” file instead of supplying a firmware IGVM path.
  • Introduce a new x64 CVM OpenHCL resource-DLL artifact and Flowey build/registration wiring for it (built only when requested).
  • Add a new VMM integration test that creates a VMGS, injects the IGVM via vmgstool copy-igvmfile, boots from VMGS, and verifies OpenHCL responsiveness.

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vmm_tests/vmm_tests/tests/tests/multiarch/vmgs.rs Adds a new Hyper-V SNP integration test that boots OpenHCL from IGVM-in-VMGS and validates copy-igvmfile.
vmm_tests/vmm_tests/Cargo.toml Adds vmgs_format dependency for VMGS sizing constants used by the new test helper.
vmm_tests/petri_artifacts_vmm_test/src/lib.rs Declares a new vmfw_dll::LATEST_CVM_X64 artifact and its expected filename.
vmm_tests/petri_artifact_resolver_openvmm_known_paths/src/lib.rs Resolves the new DLL artifact from the test content directory and provides an xflowey hint to build it if missing.
petri/src/vm/openvmm/construct.rs Rejects load_openhcl_from_vmgs for the non-Hyper-V OpenVMM backend.
petri/src/vm/mod.rs Adds load_openhcl_from_vmgs to PetriVmConfig and exposes with_openhcl_from_vmgs() on the builder.
petri/src/vm/hyperv/powershell.rs Adds an explicit EnableOpenHCL argument path and a unit test for VSSD property behavior.
petri/src/vm/hyperv/mod.rs Avoids creating/copying a local IGVM file when OpenHCL is loaded from VMGS.
petri/src/vm/hyperv/hyperv.psm1 Adds Set-OpenHclVssdProperties helper and supports EnableOpenHCL independent of a firmware file path.
openhcl/vmfirmwareigvm_dll/resources.rc Switches the VMFW resource ID from fixed 1 to a build-time macro (UH_RESOURCE_ID).
openhcl/vmfirmwareigvm_dll/build.rs Plumbs UH_RESOURCE_ID env var (defaulting to 1) into resource compilation macros.
flowey/flowey_lib_hvlite/src/init_vmm_tests_env.rs Copies the new CVM x64 firmware DLL into the vmm-tests content directory when requested.
flowey/flowey_lib_hvlite/src/build_vmfirmwareigvm_dll.rs Adds a resource-id parameter and a helper to build the CVM x64 test DLL (SNP resource ID).
flowey/flowey_lib_hvlite/src/_jobs/local_custom_vmfirmwareigvm_dll.rs Sets an explicit resource ID (1) for the local custom DLL pipeline.
flowey/flowey_lib_hvlite/src/_jobs/local_build_and_run_nextest_vmm_tests.rs Adds build selection and registration wiring for the CVM x64 firmware DLL.
flowey/flowey_lib_hvlite/src/_jobs/consume_and_test_nextest_vmm_tests_archive.rs Adds archive-consumption wiring to build/register the CVM x64 firmware DLL from an OpenHCL CVM IGVM source.
flowey/flowey_lib_hvlite/Cargo.toml Adds petri_artifacts_vmm_test dependency needed for artifact filename/constants.
flowey/flowey_hvlite/src/pipelines/vmm_tests_run.rs Ensures selecting the new DLL artifact triggers the right build selections (DLL + OpenHCL CVM IGVM).
flowey/flowey_hvlite/src/pipelines/checkin_gates.rs Wires the CVM IGVM output as the source for building the CVM x64 firmware DLL in SNP gates.
Cargo.lock Updates lockfile for new/adjusted workspace dependencies.
.github/workflows/openvmm-pr.yaml Regenerated Flowey workflow to include added steps/artifacts for the new DLL build path.
.github/workflows/openvmm-pr-release.yaml Regenerated Flowey workflow to include added steps/artifacts for the new DLL build path.
.github/workflows/openvmm-ci.yaml Regenerated Flowey workflow to include added steps/artifacts for the new DLL build path.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread petri/src/vm/hyperv/powershell.rs Outdated
Comment thread flowey/flowey_lib_hvlite/src/build_vmfirmwareigvm_dll.rs Outdated
Comment thread petri/src/vm/hyperv/hyperv.psm1 Outdated
Comment thread petri/src/vm/hyperv/powershell.rs Outdated
Comment thread petri/src/vm/hyperv/mod.rs Outdated
Comment thread petri/src/vm/hyperv/powershell.rs Outdated
Comment thread petri/src/vm/mod.rs Outdated
Comment thread vmm_tests/vmm_tests/tests/tests/multiarch/vmgs.rs Outdated
.run()
.await?;

vm.test_inspect_openhcl().await?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now, but let's think about how we could verify that we really did load the igvm from the vmgs (as opposed to the .bin file used in other tests or the in-box dll).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would comparing the runtime launch measurement with the expected value from openhcl-snp.json work? Or exposing SNP ID key digest and comparing it somehow?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That might work for SNP, but ideally we would have something that would work for GP as well.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we get different builds on a CI run today?

@tjones60 Trevor Jones (tjones60) changed the title Boot from vmgstool's VMGS integration test vmm_tests: vmgstool copy-igvmfile and boot from VMGS Aug 21, 2026
Copilot AI review requested due to automatic review settings August 24, 2026 15:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.

Some(ctx.reqv(|v| crate::build_vmfirmwareigvm_dll::Request {
arch: CommonArch::X86_64,
igvm_bin: crate::build_vmfirmwareigvm_dll::IgvmInput::File(igvm_bin),
resource_id: 13515,
igvm_bin: flowey_lib_hvlite::build_vmfirmwareigvm_dll::IgvmInput::Openhcl(
ctx.use_typed_artifact(&use_openhcl_cvm),
),
resource_id: 13515,
MissingCommand::XFlowey {
description: "x64 CVM vmfirmwareigvm test DLL",
xflowey_args: &[
"vmm-tests-run",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the command to build the file (custom-vmfirmwareigvm-dll should right? I haven't used it personally), not the command to run the tests. Admittedly though, this concept is a bit outdated now that we automatically build stuff for the tests.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This builds the DLL without running the test. custom-vmfirmwareigvm-dll produces a different DLL with resource ID 1, while this test uses ID 13515. You're right that this might be unnecessary if we build the stuff automatically, I think I left this as a fallback. Would you prefer I remove it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh it's fine, but maybe we should extend custom-vmfirmwareigvm-dll to support setting the resource ID. Could be a separate PR though.

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.

4 participants