uefi: Convert the firmware_uefi device to new resourcing model#3547
Open
smalis-msft wants to merge 9 commits into
Open
uefi: Convert the firmware_uefi device to new resourcing model#3547smalis-msft wants to merge 9 commits into
smalis-msft wants to merge 9 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR converts the Hyper-V UEFI helper chipset device (firmware_uefi) to the newer resource-handle/resolver model by moving its construction out of vmotherboard options and into vm_resource resolvers. It introduces a lightweight firmware_uefi_resources crate for config/handle definitions and updates OpenVMM/OpenHCL to register the necessary platform resolvers and build the manifest accordingly.
Changes:
- Added
firmware_uefi_resourcescrate to hold UEFI device resource definitions (config, handle kinds, platform traits) and updated call sites to depend on it instead of the full device crate. - Implemented
firmware_uefi::resolver::UefiDeviceResolverto build the actual UEFI device from aUefiDeviceHandleplus resolved platform resources. - Updated
vm_manifest_builder,openvmm_entry,openvmm_core, and Underhill to construct the UEFI device via manifests + registered platform resolvers (logger, NVRAM storage, watchdog platform, optional VSM config, and time source).
Reviewed changes
Copilot reviewed 35 out of 36 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vmm_core/vmotherboard/src/base_chipset.rs | Removes legacy option/dependency path for constructing the UEFI helper device directly in the base chipset builder. |
| vmm_core/vmotherboard/Cargo.toml | Drops now-unused UEFI-related dependencies from vmotherboard. |
| vmm_core/vm_manifest_builder/src/lib.rs | Adds UefiManifest and wires UEFI device handle emission into the manifest builder. |
| vmm_core/vm_manifest_builder/Cargo.toml | Adds dependency on the new firmware_uefi_resources crate. |
| vm/devices/firmware/firmware_uefi/src/service/nvram/mod.rs | Switches to resource-crate platform types/errors for NVRAM/VSM integration. |
| vm/devices/firmware/firmware_uefi/src/service/event_log.rs | Switches event logging traits/types to firmware_uefi_resources::platform. |
| vm/devices/firmware/firmware_uefi/src/service/diagnostics/mod.rs | Reuses firmware_uefi_resources::LogLevel instead of defining a local one. |
| vm/devices/firmware/firmware_uefi/src/resolver.rs | New async resolver building the UEFI chipset device from resource handles. |
| vm/devices/firmware/firmware_uefi/src/platform/nvram.rs | Removes now-relocated platform interfaces (moved to resources crate). |
| vm/devices/firmware/firmware_uefi/src/platform/mod.rs | Removes now-relocated platform module root. |
| vm/devices/firmware/firmware_uefi/src/platform/logger.rs | Removes now-relocated platform logging interfaces. |
| vm/devices/firmware/firmware_uefi/src/lib.rs | Exposes resolver module and switches to resource-crate types for config/platform traits. |
| vm/devices/firmware/firmware_uefi/fuzz/fuzz_nvram.rs | Updates EFI_TIME import after platform module removal. |
| vm/devices/firmware/firmware_uefi/fuzz/fuzz_diagnostics.rs | Uses firmware_uefi_resources::LogLevel for fuzzing diagnostics. |
| vm/devices/firmware/firmware_uefi/fuzz/Cargo.toml | Adds deps needed by updated fuzz targets (firmware_uefi_resources, uefi_specs). |
| vm/devices/firmware/firmware_uefi/Cargo.toml | Adds dependencies required for the new resolver implementation. |
| vm/devices/firmware/firmware_uefi_resources/src/lib.rs | New crate defining UEFI config, device handle, resource kinds, and platform traits. |
| vm/devices/firmware/firmware_uefi_resources/Cargo.toml | New crate manifest. |
| openvmm/openvmm_resources/src/lib.rs | Registers the new firmware_uefi::resolver::UefiDeviceResolver. |
| openvmm/openvmm_resources/Cargo.toml | Adds firmware_uefi dependency to expose/register its resolver. |
| openvmm/openvmm_entry/src/lib.rs | Builds and attaches UEFI device manifest using firmware_uefi_resources + VmManifestBuilder::with_uefi. |
| openvmm/openvmm_entry/Cargo.toml | Adds firmware_uefi_resources dependency. |
| openvmm/openvmm_core/src/worker/dispatch.rs | Replaces inline UEFI device construction with registration of platform-specific resolvers. |
| openvmm/openvmm_core/src/emuplat/uefi.rs | New OpenVMM platform resolvers for UEFI watchdog + VMGS/in-memory NVRAM storage. |
| openvmm/openvmm_core/src/emuplat/mod.rs | Exposes the new emuplat::uefi module. |
| openvmm/openvmm_core/src/emuplat/firmware.rs | Adds a resolver that provides the UEFI logger via platform resources. |
| openvmm/openvmm_core/Cargo.toml | Switches from firmware_uefi to firmware_uefi_resources dependency where appropriate. |
| openhcl/underhill_core/src/worker.rs | Converts Underhill UEFI setup to resource-model UEFI (register resolvers + attach manifest). |
| openhcl/underhill_core/src/emuplat/uefi.rs | New Underhill platform resolvers for UEFI logger, NVRAM, watchdog, and VSM config. |
| openhcl/underhill_core/src/emuplat/mod.rs | Exposes new Underhill emuplat::uefi module. |
| openhcl/underhill_core/src/emuplat/firmware.rs | Updates Underhill firmware logger/VSM config to implement resource-crate traits. |
| openhcl/underhill_core/Cargo.toml | Switches from firmware_uefi to firmware_uefi_resources. |
| openhcl/openvmm_hcl_resources/src/lib.rs | Registers firmware_uefi::resolver::UefiDeviceResolver for OpenHCL builds. |
| openhcl/openvmm_hcl_resources/Cargo.toml | Adds firmware_uefi dependency to expose/register its resolver. |
| Cargo.toml | Adds firmware_uefi_resources to workspace dependencies. |
| Cargo.lock | Adds the new crate and updates dependency graph accordingly. |
moor-coding
reviewed
May 21, 2026
This comment was marked as outdated.
This comment was marked as outdated.
jstarks
reviewed
May 22, 2026
jstarks
reviewed
May 22, 2026
jstarks
reviewed
May 22, 2026
| //! Resolvers for the per-platform [`firmware_uefi`] dependencies. | ||
|
|
||
| use crate::partition::HvlitePartition; | ||
| use crate::vmgs_non_volatile_store::HvLiteVmgsNonVolatileStore; |
| use vmm_core::partition_unit::Halt; | ||
| use watchdog_core::platform::BaseWatchdogPlatform; | ||
| use watchdog_core::platform::WatchdogCallback; | ||
| use watchdog_core::platform::WatchdogPlatform; |
|
|
||
| use crate::emuplat::firmware::UnderhillLogger; | ||
| use crate::emuplat::firmware::UnderhillVsmConfig; | ||
| use crate::emuplat::non_volatile_store::VmgsBrokerNonVolatileStore; |
| use vmm_core::emuplat::hcl_compat_uefi_nvram_storage::VmgsStorageBackendAdapter; | ||
| use vmm_core::partition_unit::Halt; | ||
| use watchdog_core::platform::WatchdogCallback; | ||
| use watchdog_core::platform::WatchdogPlatform; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Converts the UEFI device to the new resourcing model, and updates openvmm and openhcl as appropriate to construct it. This breaks petri's dependence on crypto.