You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9e138af
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: Guide/src/reference/architecture/timekeeping.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,7 +126,7 @@ API is easiest to call.
126
126
| --- | --- |
127
127
| PIT |`chipset::pit` advances counting elements from elapsed `VmTime` and schedules wakeups for interrupt generation. |
128
128
| ACPI PM timer | Software reads scale `VmTime` to 3.579545 MHz. With PM timer assist, the hypervisor handles reads using its own time source instead. |
129
-
| CMOS RTC | Calendar registers use `LocalClock`; alarm, periodic, and update interrupt scheduling uses `VmTime`. |
129
+
| CMOS RTC | Calendar registers use `LocalClock`; alarm, periodic, and update interrupt scheduling uses `VmTime`. Saved state keeps the interrupt deadlines. |
130
130
| UEFI watchdog |`watchdog_core` receives a `VmTimeAccess`, so its deadline belongs to the software VM timeline. |
131
131
| Software local APIC |`virt_support_apic` counts down using `VmTime`; backend-native APIC emulation instead has backend-owned timer state. |
132
132
| Hyper-V synthetic timers | Deadlines use partition reference time. Native implementations belong to the hypervisor; `hv1_emulator::synic` evaluates them in software. |
@@ -164,6 +164,20 @@ created clock instances do not share guest-written offsets.
164
164
RTC dates can advance during a pause while `VmTime`-based interrupt
165
165
machinery is stopped. Periodic interrupt rates do not define wall time.
166
166
167
+
A snapshot instead keeps the RTC's time at its VM-time cut. While stopped,
168
+
the RTC holds the time that it read as it stopped and runs it with
169
+
`VmTime`, so a save records the time at the cut; a restore, and the
170
+
downtime that it advances, set the clock as the RTC starts, and a plain
171
+
pause sets nothing. The saved state also keeps the alarm, periodic, and
172
+
update deadlines in `VmTime` and the time of the last update cycle, so a
173
+
restore keeps each interrupt's phase and the update-in-progress window.
174
+
A restore rejects a deadline more than its timer's period after the
175
+
restored VM time; a saved state without deadlines arms the enabled
176
+
timers a period after the restore. A restore, or the downtime that it
177
+
advances, also rejects a time beyond the calendar's years 0 to 9999 by
178
+
more than the Linux host clock's range of about 292 years, so that the
179
+
`SystemTimeClock` offset cannot overflow.
180
+
167
181
On Arm, the UEFI time service exposes the supplied local clock through
168
182
`GetTime`/`SetTime`. It retains timezone and daylight fields for readback
169
183
but does not apply them as timezone conversions. Its saved state stores
0 commit comments