vmm_tests: vmgstool copy-igvmfile and boot from VMGS - #4300
vmm_tests: vmgstool copy-igvmfile and boot from VMGS#4300Katja (gruvian) wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
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.
| .run() | ||
| .await?; | ||
|
|
||
| vm.test_inspect_openhcl().await?; |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
That might work for SNP, but ideally we would have something that would work for GP as well.
There was a problem hiding this comment.
do we get different builds on a CI run today?
| 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", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Eh it's fine, but maybe we should extend custom-vmfirmwareigvm-dll to support setting the resource ID. Could be a separate PR though.
Summary
vmfirmwareigvmresource ID configurable while preserving resource ID1for existing callers.vmgstool copy-igvmfile, boots an SNP VM from the resulting VMGS, and verifies that OpenHCL is responsive.Validation
cargo check -p vmm_tests --test testspassed.