From ce76a5fadf9d6520b2e2127c85200bf08d8e9a37 Mon Sep 17 00:00:00 2001 From: Pedro Henrique Penna Date: Thu, 12 Nov 2026 09:22:07 -0800 Subject: [PATCH 1/2] openvmm: pin the PIT low/high count fix In its low-then-high access mode (RW = 3), OpenVMM's emulated 8254 PIT kept the low byte that it had buffered once the high byte completed a count, so after the first count it took every byte as a high byte with that stale low byte. A guest that wrote a count without a new control word so programmed a wrong one: control word 0x30, then the counts 0 and 16, left counter 0 counting 65536 (#1063), and control word 0x34, then the counts 0x1234 and 0x5678, left the count register at 0x5634 (#1146). Pin 5d656d854a8daca0f23833666b0b71229fe2ab73, the head of microsoft/openvmm#5061, one commit on c2c21ddb2, the head of feature/microvm/dev: - 5d656d854 chipset: start each PIT low/high count with its low byte Timer::write now takes the buffered low byte with the high byte, which returns the write flip-flop to the low byte of the next count. The saved state, which already holds that byte, keeps its format. Evidence: on Windows, the revision's three new chipset tests, two of which program counter 0 through the I/O ports as the issues do, fail without the fix, with a count register of 0x5634, with IRQ0 still low after 17 ticks of a count of 65536, and with a latched count of 0x5634, and pass at the pin, with the 101 other tests of chipset. The test attached to #1063 fails at c2c21ddb2 with the latched count 0xff9d of a count of 65536, and passes at the pin. NVX's guests disable the PIT at boot and never program it again, so they never wrote the second count that the defect corrupted. NVX needs no coordinated change: the control-session vectors, the source excerpts, the contract versions, and the CPU profiles that nvx-rs copies from OpenVMM match the revision's. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- openvmm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvmm b/openvmm index c2c21ddb2..5d656d854 160000 --- a/openvmm +++ b/openvmm @@ -1 +1 @@ -Subproject commit c2c21ddb25822e13bd1cf1b33ed693545cc7bbb5 +Subproject commit 5d656d854a8daca0f23833666b0b71229fe2ab73 From 86c885dd8a214bd4188d49cb1a428286bcc2ddd7 Mon Sep 17 00:00:00 2001 From: Pedro Henrique Penna Date: Thu, 12 Nov 2026 09:23:04 -0800 Subject: [PATCH 2/2] doc: map the PIT low/high count fix in the OpenVMM roadmap The NVX pin moves to 5d656d854, position 263, 132 commits past the mapped tip. Position 263, which microsoft/openvmm#5061 proposes for feature/microvm/dev on its head, c2c21ddb2, is unassigned. The Scope also says that microsoft/openvmm#5056 merged position 262. It makes the PIT's count writes in the low-then-high access mode take each count's low byte first, in Timer::write, code that upstream main has, and adds three tests, in a file that PR10's position 022 and position 139 also change, neither of them in the code that it changes. It changes nothing that a mapped PR adds. Replaying it on upstream main applies without conflicts, and chipset type-checks there with its tests, which pass, so it can go upstream on its own. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- doc/openvmm-upstream-roadmap.md | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/doc/openvmm-upstream-roadmap.md b/doc/openvmm-upstream-roadmap.md index f2d217598..a08583de5 100644 --- a/doc/openvmm-upstream-roadmap.md +++ b/doc/openvmm-upstream-roadmap.md @@ -10,9 +10,10 @@ summary, and commit mapping below cover positions 001-131, the PR09 fixups at positions 241-243, the PR13 fixup at position 247, the PR18 fixup at position 248, the PR20 fixup at position 249, and the PR19 fixup at position 250. -- NVX's pinned OpenVMM revision: `c2c21ddb25822e13bd1cf1b33ed693545cc7bbb5`, position 262, the - head of microsoft/openvmm#5056, whose commit follows position 261, `c72fc56a3`, the head of - `feature/microvm/dev`, which microsoft/openvmm#5055 merged with positions 259 and 260 after +- NVX's pinned OpenVMM revision: `5d656d854a8daca0f23833666b0b71229fe2ab73`, position 263, the + head of microsoft/openvmm#5061, whose commit follows position 262, `c2c21ddb2`, the head of + `feature/microvm/dev`, which microsoft/openvmm#5056 merged after position 261, `c72fc56a3`, + which microsoft/openvmm#5055 merged with positions 259 and 260 after position 258, `024ecee62`, which microsoft/openvmm#5053 merged with positions 256 and 257 after position 255, `90f87319d`, which microsoft/openvmm#5052 merged with position 254 after position 253, `3cd9f149b`, which microsoft/openvmm#5046 merged after position 252, `9f10ce7a8`, @@ -47,8 +48,8 @@ position 221 into positions 035 and 036, and combined v5.1 positions 222 and 223, the two commits of microsoft/openvmm#4984, into position 220. Positions 001-147 keep their positions, v5.1 positions 149-220 are positions 148-219, and the tree of position 220 is the tree of - `3f2ab4c2f`; see [The v6.0 reorganization](#the-v60-reorganization). The pin is 131 commits past - the mapped tip on the same first-parent chain. Positions 132-240, 244-246, and 251-262 are not + `3f2ab4c2f`; see [The v6.0 reorganization](#the-v60-reorganization). The pin is 132 commits past + the mapped tip on the same first-parent chain. Positions 132-240, 244-246, and 251-263 are not yet assigned to PRs, positions 241-243 are PR09 fixups, position 247 is a PR13 fixup, position 248 is a PR18 fixup, position 249 is a PR20 fixup, and position 250 is a PR19 fixup; see [Commits after the mapped tip](#commits-after-the-mapped-tip). @@ -1033,7 +1034,8 @@ ba105dd7f -> LAPIC timer restores without drift or a downtime refire [256-258] -> LAPIC timer captures that keep a taken timer from refiring [259-261] -> restore phase logs through a host clock step back [262] - -> c2c21ddb2 (NVX pin) + -> PIT low/high counts without a control word [263] + -> 5d656d854 (NVX pin) ``` For upstream review, PR01-PR06 and PR14 can be rebased independently onto current upstream main, @@ -1070,7 +1072,7 @@ helper that the case uses. ## Commits after the mapped tip -The NVX pin extends the chain past position 131 without merges. Of the 131 later commits, +The NVX pin extends the chain past position 131 without merges. Of the 132 later commits, positions 241-243 are PR09 fixups, position 247 is a PR13 fixup, position 248 is a PR18 fixup, position 249 is a PR20 fixup, position 250 is a PR19 fixup, and the others are not yet classified or assigned to PRs. @@ -1078,7 +1080,7 @@ Each of positions 132-186 combines the v2.4 commits that the table lists, as v3. and 162-200 did, which developed one concept; "(part)" marks a v2.4 fixup that split across commits. Positions 187-191 followed the v3.0 reorganization, positions 192-205 are the ABI restart of the v4.0 reorganization, positions 206-211 followed it, positions 212-218 followed the v5.0 -reorganization, positions 219 and 220 followed the v5.1 rebase, and positions 221-262 followed the +reorganization, positions 219 and 220 followed the v5.1 rebase, and positions 221-263 followed the v6.0 reorganization, so they combine none, apart from position 220, which combines v5.1 positions 222 and 223. Each commit has the position that it had in v5.1 through position 147, and one less from v5.1 position 149 on; see @@ -1218,6 +1220,7 @@ at `e1ca353eb`, whose first 210 commits are those of `feature/microvm/release/v4 | 260 | `9f14b54fd` | - | - | - | - | virt_kvm: keep a restore from firing a taken one-shot LAPIC timer again (microsoft/openvmm#5055) | | 261 | `c72fc56a3` | - | - | - | - | virt_kvm: build the LAPIC timer KVM tests for musl (microsoft/openvmm#5055); fold into 260 | | 262 | `c2c21ddb2` | - | - | - | - | microVM: saturate the time ABI restore's logged phase durations (microsoft/openvmm#5056) | +| 263 | `5d656d854` | - | - | - | - | chipset: start each PIT low/high count with its low byte (microsoft/openvmm#5061) | The remarks that say whether commits apply to upstream main record what the v3.0 reorganization found on its base, `b2676222b`, at the positions that the commits have now. @@ -1884,6 +1887,12 @@ that positions 135, 138, 139, 142, 145, 147-150, 152, 153, 156, 158-160, 193, 20 main conflicts in all four of its files: upstream main lacks the time ABI, so it follows the time ABI series upstream. +Position 263 makes the PIT's count writes in the low-then-high access mode take each count's low +byte first, in `Timer::write`, code that upstream main has, and adds three tests, in a file that +PR10's position 022 and position 139 also change, neither of them in the code that it changes. It +changes nothing that a mapped PR adds. Replaying it on upstream main applies without conflicts, +and `chipset` type-checks there with its tests, which pass, so it can go upstream on its own. + ## PR summary Each count is of v6.0 commits, which include the fixups that the v3.0, v4.0, v5.0, and v6.0