Skip to content

Add power management device support to chipset resources#3317

Open
moor-coding wants to merge 2 commits intomicrosoft:mainfrom
moor-coding:power-management-resourcify
Open

Add power management device support to chipset resources#3317
moor-coding wants to merge 2 commits intomicrosoft:mainfrom
moor-coding:power-management-resourcify

Conversation

@moor-coding
Copy link
Copy Markdown
Contributor

  • 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()

Copilot AI review requested due to automatic review settings April 17, 2026 17:47
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 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::pm handles/kinds for Hyper-V / PIIX4 PM devices plus a PmTimerAssistHandleKind that can resolve from PlatformResource.
  • 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 VmManifestBuilder with with_platform_pm_timer_assist() and plumb it through Underhill via a new UnderhillPmTimerAssistResolver.

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.

Comment thread vm/devices/chipset/src/pm/resolver.rs
Comment thread vm/devices/chipset_legacy/src/piix4_pm/resolver.rs
@moor-coding moor-coding marked this pull request as ready for review April 17, 2026 18:43
@moor-coding moor-coding requested a review from a team as a code owner April 17, 2026 18:43
@github-actions
Copy link
Copy Markdown

- 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()
@moor-coding moor-coding force-pushed the power-management-resourcify branch from 6348f60 to dbf956a Compare April 22, 2026 15:55
Copilot AI review requested due to automatic review settings April 22, 2026 15:55
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 13 out of 14 changed files in this pull request and generated 1 comment.

Comment thread vmm_core/vmotherboard/src/base_chipset.rs Outdated
Copilot AI review requested due to automatic review settings April 22, 2026 19:21
@moor-coding moor-coding force-pushed the power-management-resourcify branch from 5310bbf to 2b63b09 Compare April 22, 2026 19:21
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 13 out of 14 changed files in this pull request and generated 4 comments.

Comment thread vmm_core/vmotherboard/src/base_chipset.rs Outdated
Comment thread vmm_core/vmotherboard/src/base_chipset.rs
Comment thread vm/devices/chipset/src/pm/resolver.rs
Comment thread vm/devices/chipset_legacy/src/piix4_pm/resolver.rs
- 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.
@moor-coding moor-coding force-pushed the power-management-resourcify branch from 2b63b09 to 019b4bc Compare April 22, 2026 20:41
Copilot AI review requested due to automatic review settings April 23, 2026 15:11
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 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

  • pm module has #![warn(missing_docs)], but the new pub use chipset_resources::pm::PmTimerAssist; re-export is missing a rustdoc comment (currently a regular // comment). This will trigger missing_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).

@moor-coding moor-coding force-pushed the power-management-resourcify branch from f61bf8f to 019b4bc Compare April 23, 2026 15:54
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.

2 participants