Add CMOS RTC time source support to chipset resources#3349
Add CMOS RTC time source support to chipset resources#3349moor-coding wants to merge 1 commit intomicrosoft:mainfrom
Conversation
moor-coding
commented
Apr 21, 2026
- Add CmosRtcTimeSourceHandleKind resource kind with SystemTimeClockHandle as a shared static resolver for system-time-backed clocks.
- Change CMOS RTC deps time_source from Box to Resource, resolved during chipset build.
- Add UnderhillCmosRtcTimeSourceResolver for Underhill's GET-backed clock.
- Add CmosRtcTimeSourceHandleKind resource kind with SystemTimeClockHandle as a shared static resolver for system-time-backed clocks. - Change CMOS RTC deps time_source from Box<dyn InspectableLocalClock> to Resource<CmosRtcTimeSourceHandleKind>, resolved during chipset build. - Add UnderhillCmosRtcTimeSourceResolver for Underhill's GET-backed clock.
There was a problem hiding this comment.
Pull request overview
Adds a resource-kind based mechanism for supplying CMOS RTC “real time” sources, so RTC devices can resolve their clock implementation during chipset build (supporting both host system-time clocks and Underhill’s GET-backed clock).
Changes:
- Introduces
CmosRtcTimeSourceHandleKindplus aSystemTimeClockHandle+ static resolver inchipset_resources. - Switches CMOS RTC deps in
vmotherboardfromBox<dyn InspectableLocalClock>toResource<CmosRtcTimeSourceHandleKind>and resolves them during chipset build. - Wires OpenVMM to use
SystemTimeClockHandleand Underhill to provide a platform clock viaUnderhillCmosRtcTimeSourceResolver.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vmm_core/vmotherboard/src/base_chipset.rs | Resolve RTC time-source resources during chipset build; update deps types; add resolve error variant |
| vm/devices/chipset_resources/src/lib.rs | Add CMOS RTC time-source resource kind and system-time-backed resolver |
| vm/devices/chipset_resources/Cargo.toml | Add local_clock dependency for new resolver |
| openvmm/openvmm_resources/src/lib.rs | Register SystemTimeClockResolver as a static resolver |
| openvmm/openvmm_resources/Cargo.toml | Add chipset_resources dependency |
| openvmm/openvmm_core/src/worker/dispatch.rs | Construct RTC time-source resources via SystemTimeClockHandle |
| openhcl/underhill_core/src/worker.rs | Add dynamic PlatformResource resolver for Underhill RTC time source; pass platform resource into RTC deps |
| openhcl/underhill_core/Cargo.toml | Add chipset_resources dependency |
| openhcl/openvmm_hcl_resources/src/lib.rs | Register SystemTimeClockResolver as a static resolver |
| openhcl/openvmm_hcl_resources/Cargo.toml | Add chipset_resources dependency |
| Cargo.lock | Lockfile updates for new deps |
| FeatureGatedDevice(&'static str), | ||
| #[error("no valid ISA DMA controller for floppy")] | ||
| NoDmaForFloppy, | ||
| #[error("failed to resolve resource")] |
There was a problem hiding this comment.
ResolveResource uses the generic message "failed to resolve resource" for CMOS RTC time-source resolution. Since this error can occur in multiple call sites (generic RTC vs PIIX4 RTC) and ResolveError typically only identifies kind/id, it’s hard to tell which device path failed from the top-level error. Consider making the variant/message RTC-specific (or splitting into separate variants per device) so the error context includes which RTC device was being built/resolved.
| #[error("failed to resolve resource")] | |
| #[error("failed to resolve CMOS RTC time-source resource")] |