Skip to content

uefi: Convert the firmware_uefi device to new resourcing model#3547

Open
smalis-msft wants to merge 9 commits into
microsoft:mainfrom
smalis-msft:uefi_resourcing
Open

uefi: Convert the firmware_uefi device to new resourcing model#3547
smalis-msft wants to merge 9 commits into
microsoft:mainfrom
smalis-msft:uefi_resourcing

Conversation

@smalis-msft
Copy link
Copy Markdown
Contributor

@smalis-msft smalis-msft commented May 21, 2026

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.

@smalis-msft smalis-msft requested a review from a team as a code owner May 21, 2026 20:16
Copilot AI review requested due to automatic review settings May 21, 2026 20:16
Copy link
Copy Markdown
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 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_resources crate 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::UefiDeviceResolver to build the actual UEFI device from a UefiDeviceHandle plus 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.

Comment thread vmm_core/vm_manifest_builder/src/lib.rs
Comment thread openhcl/underhill_core/src/emuplat/uefi.rs
Copilot AI review requested due to automatic review settings May 21, 2026 21:41
Copy link
Copy Markdown
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

Copilot reviewed 38 out of 39 changed files in this pull request and generated 5 comments.

Comment thread openvmm/openvmm_core/src/emuplat/uefi.rs
Comment thread openvmm/openvmm_core/src/emuplat/uefi.rs
Comment thread openhcl/underhill_core/src/emuplat/uefi.rs
Comment thread openhcl/underhill_core/src/emuplat/uefi.rs
Comment thread vm/devices/firmware/firmware_uefi/src/lib.rs
Copilot AI review requested due to automatic review settings May 21, 2026 23:18
Copy link
Copy Markdown
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

Copilot reviewed 39 out of 40 changed files in this pull request and generated 4 comments.

Comment thread openvmm/openvmm_core/src/emuplat/uefi.rs
Comment thread openvmm/openvmm_core/src/emuplat/uefi.rs
Comment thread openhcl/underhill_core/src/emuplat/uefi.rs
Comment thread openhcl/underhill_core/src/emuplat/uefi.rs
@github-actions

This comment was marked as outdated.

Comment thread vm/devices/firmware/firmware_uefi_resources/src/lib.rs
Comment thread openhcl/underhill_core/src/emuplat/uefi.rs
Comment thread vmm_core/vm_manifest_builder/src/lib.rs Outdated
Copilot AI review requested due to automatic review settings May 22, 2026 01:30
Copy link
Copy Markdown
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

Copilot reviewed 39 out of 40 changed files in this pull request and generated 4 comments.

//! 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;
@github-actions
Copy link
Copy Markdown

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