Add power management device support to chipset resources#3317
Open
moor-coding wants to merge 2 commits intomicrosoft:mainfrom
Open
Add power management device support to chipset resources#3317moor-coding wants to merge 2 commits intomicrosoft:mainfrom
moor-coding wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Contributor
moor-coding
commented
Apr 17, 2026
- Add HyperVPowerManagementDeviceHandle and Piix4PowerManagementDeviceHandle with PmTimerAssistHandleKind for platform-resolved PM timer assist
- Add HyperVPowerManagementResolver and Piix4PowerManagementResolver
- PIIX4 PM uses LegacyPciChipsetDeviceHandle with explicit bus name and BDF
- Underhill registers UnderhillPmTimerAssistResolver for PlatformResource, activated via VmManifestBuilder::with_platform_pm_timer_assist()
Contributor
There was a problem hiding this comment.
Pull request overview
This PR moves x86 power management devices (Hyper-V PM and PIIX4 PM) onto the resource-resolution path, and adds an optional “platform PM timer assist” resource hook (used by Underhill) instead of wiring PM timer assist directly through BaseChipsetDevices deps.
Changes:
- Add
chipset_resources::pmhandles/kinds for Hyper-V / PIIX4 PM devices plus aPmTimerAssistHandleKindthat can resolve fromPlatformResource. - Introduce async resource resolvers for Hyper-V PM (
chipset::pm) and PIIX4 PM (chipset_legacy::piix4_pm) and register them in the OpenVMM resolver registries. - Extend
VmManifestBuilderwithwith_platform_pm_timer_assist()and plumb it through Underhill via a newUnderhillPmTimerAssistResolver.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vmm_core/vmotherboard/src/base_chipset.rs | Removes direct PM device construction and PM deps from the base chipset builder path. |
| vmm_core/vm_manifest_builder/src/lib.rs | Adds with_platform_pm_timer_assist() and attaches PM device handles (Hyper-V / PIIX4) with optional platform PM timer assist resource. |
| vm/devices/chipset_resources/src/lib.rs | Adds pm resource module: PM device handles, PM timer assist kind/trait, and default constants. |
| vm/devices/chipset_legacy/src/piix4_pm/resolver.rs | New async resolver to materialize the PIIX4 PM device from its resource handle. |
| vm/devices/chipset_legacy/src/piix4_pm/mod.rs | Exposes the new PIIX4 PM resolver module. |
| vm/devices/chipset_legacy/Cargo.toml | Adds dependencies needed by the new PIIX4 PM resolver. |
| vm/devices/chipset/src/pm/resolver.rs | New async resolver to materialize the Hyper-V PM device from its resource handle. |
| vm/devices/chipset/src/pm/mod.rs | Re-exports PmTimerAssist from chipset_resources and exposes the new resolver module. |
| openvmm/openvmm_resources/src/lib.rs | Registers the new PM resolvers for x86_64 guests. |
| openvmm/openvmm_core/src/worker/dispatch.rs | Removes old PM deps wiring into BaseChipsetDevices. |
| openhcl/underhill_core/src/worker.rs | Enables with_platform_pm_timer_assist() and adds UnderhillPmTimerAssistResolver for the platform PM timer assist resource. |
| openhcl/underhill_core/Cargo.toml | Adds chipset_resources dependency for Underhill’s PM timer assist resolver output types. |
| openhcl/openvmm_hcl_resources/src/lib.rs | Registers the new PM resolvers for x86_64 guests in the HCL resolver registry. |
| Cargo.lock | Updates lockfile for new/updated dependencies. |
- Add HyperVPowerManagementDeviceHandle and Piix4PowerManagementDeviceHandle with PmTimerAssistHandleKind for platform-resolved PM timer assist - Add HyperVPowerManagementResolver and Piix4PowerManagementResolver - PIIX4 PM uses LegacyPciChipsetDeviceHandle with explicit bus name and BDF - Underhill registers UnderhillPmTimerAssistResolver for PlatformResource, activated via VmManifestBuilder::with_platform_pm_timer_assist()
6348f60 to
dbf956a
Compare
5310bbf to
2b63b09
Compare
- Add missing LineInterruptTarget import in both PM resolvers (chipset and chipset_legacy) for valid_lines() calls. - Gate PM_BASE and SYSTEM_IRQ_ACPI constants on x86_64 guest arch.
2b63b09 to
019b4bc
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 14 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
vm/devices/chipset/src/pm/mod.rs:371
pmmodule has#![warn(missing_docs)], but the newpub use chipset_resources::pm::PmTimerAssist;re-export is missing a rustdoc comment (currently a regular//comment). This will triggermissing_docs(and likely fail CI with-Dwarnings). Convert the comment to a///doc comment (or add#[expect(missing_docs)]on the re-export if intentionally undocumented).
f61bf8f to
019b4bc
Compare
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.