From 1ee33c697f8d24642ce2496d162916aaa50a0a2d Mon Sep 17 00:00:00 2001 From: Pedro Henrique Penna Date: Fri, 13 Nov 2026 13:40:55 -0800 Subject: [PATCH 1/2] openvmm: pin the IOAPIC's zero-extended wide reads A guest read of the emulated IOAPIC's index or data register wider than 4 bytes, such as a 64-bit mov from 0xfec00000, panicked OpenVMM's VP thread with "copy_from_slice: source slice length (4) does not match destination slice length (8)" in IoApicDevice::mmio_read, which ended the VM (#1140). Pin e2458a6cef958c3ac2d710e13a6ba490a9911b88, the head of microsoft/openvmm#5084, one commit on 09cd771c0, the head of feature/microvm/dev: - e2458a6ce chipset: zero-extend wide IOAPIC MMIO reads mmio_read copied the 32-bit register's min(len, 4) low bytes into the whole buffer, so only reads of at most 4 bytes matched the slice lengths. It now copies those bytes into the start of the buffer and zeroes the rest, so a wider read returns the register zero-extended, as the CMOS RTC does for a wide read of its ports, and a narrower one still returns the register's low bytes. Evidence: with OpenVMM built from 09cd771c0, the previous pin, an Alpine guest on 1 processor that maps /dev/mem at 0xfec00000 and reads the index and data registers with 32-bit and then 64-bit loads panicked OpenVMM at vm/devices/chipset/src/ioapic/mod.rs:724:14 on its first 64-bit load, on nvx-kvm-test, nvx-mshv-test, and nvx-whp-test. At the pin, its 64-bit loads read the values of its 32-bit loads, zero-extended, on all three hosts, on 1 and 2 processors. Tests: with OpenVMM built from the pin, the microVM scenarios smp, on 1 and 2 processors, and interrupt-map pass on nvx-kvm-test, nvx-mshv-test, and nvx-whp-test. The revision's new chipset test, mmio_reads_of_any_size_are_zero_extended, fails at 09cd771c0 with the panic above, and its 132 chipset tests pass on Windows and on Linux, on nvx-kvm-test. NVX needs no coordinated change: the control-session vectors, the source excerpts, the contract versions, the activation bound, 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 09cd771c0..e2458a6ce 160000 --- a/openvmm +++ b/openvmm @@ -1 +1 @@ -Subproject commit 09cd771c061aa1d1b406b41eaf2eda851db87c15 +Subproject commit e2458a6cef958c3ac2d710e13a6ba490a9911b88 From 799ad739ce335a2c87dc546302c20c348189590e Mon Sep 17 00:00:00 2001 From: Pedro Henrique Penna Date: Fri, 13 Nov 2026 13:41:11 -0800 Subject: [PATCH 2/2] doc: map the IOAPIC's zero-extended wide reads in the OpenVMM roadmap The NVX pin moves to e2458a6ce, position 274, 150 commits past the mapped tip. Position 274, the one commit of microsoft/openvmm#5084 on 09cd771c0, the head of feature/microvm/dev, is not yet assigned to a PR. Position 274 makes the IOAPIC's mmio_read zero-extend a read of its index or data register wider than 4 bytes, which panicked the vCPU thread, and so OpenVMM, because it copied the register's low bytes into the whole buffer. The code is upstream main's, and the commit adds a test to the device's tests, in a file whose saved-state tests position 183 also changes; it changes none of position 183's code and nothing that a mapped PR adds. Replaying it on upstream main, 7d90c4104, 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 | 35 ++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/doc/openvmm-upstream-roadmap.md b/doc/openvmm-upstream-roadmap.md index d70c1c22b..bb5a22d22 100644 --- a/doc/openvmm-upstream-roadmap.md +++ b/doc/openvmm-upstream-roadmap.md @@ -11,20 +11,21 @@ summary, and commit mapping below cover positions 001-124, the PR09 fixups at positions 234-236, the PR13 fixup at position 240, the PR18 fixup at position 241, the PR20 fixup at position 242, the PR19 fixup at position 243, and the PR10 fixups at positions 271 and 273. -- NVX's pinned OpenVMM revision: `09cd771c061aa1d1b406b41eaf2eda851db87c15`, position 273, the - head of microsoft/openvmm#5083, whose one commit follows position 272, `fb2c8b75c`, the head of - `feature/microvm/dev`, to which microsoft/openvmm#5077 added positions 270-272 after position - 269, `73cf40357`, the head of `feature/microvm/release/v6.1`. The v6.1 rebase replayed the 268 +- NVX's pinned OpenVMM revision: `e2458a6cef958c3ac2d710e13a6ba490a9911b88`, position 274, the + head of microsoft/openvmm#5084, whose one commit follows position 273, `09cd771c0`, the head of + `feature/microvm/dev`, to which microsoft/openvmm#5083 added position 273 after position 272, + `fb2c8b75c`, and microsoft/openvmm#5077 added positions 270-272 after position 269, + `73cf40357`, the head of `feature/microvm/release/v6.1`. The v6.1 rebase replayed the 268 commits of `feature/microvm/dev` at NVX's pin before it, `5ca20ee08`, whose first 220 commits are those of `feature/microvm/release/v6.0`, onto the new fork base without the seven whose changes upstream had landed, and added eight fixups at its tip, positions 262-269. A commit's position is its v6.0 position less the number of dropped commits before it: v6.0 positions 003-007 are positions 002-006, 010-013 are 007-010, 015-050 are 011-046, and 054-268 are - 047-261; see [Conflicts of the v6.1 rebase](#conflicts-of-the-v61-rebase). The pin is 149 + 047-261; see [Conflicts of the v6.1 rebase](#conflicts-of-the-v61-rebase). The pin is 150 commits past the mapped tip on the same first-parent chain. Positions 125-233, 237-239, - 244-270, and 272 are not yet assigned to PRs, positions 234-236 are PR09 fixups, position 240 - is a PR13 fixup, position 241 is a PR18 fixup, position 242 is a PR20 fixup, position 243 is a - PR19 fixup, and positions 271 and 273 are PR10 fixups; see + 244-270, 272, and 274 are not yet assigned to PRs, positions 234-236 are PR09 fixups, position + 240 is a PR13 fixup, position 241 is a PR18 fixup, position 242 is a PR20 fixup, position 243 + is a PR19 fixup, and positions 271 and 273 are PR10 fixups; see [Commits after the mapped tip](#commits-after-the-mapped-tip). - Upstream main: `7d90c41044077e31ca060df9206532f579f24716` (2026-11-13), the fork base itself; see [Upstream main past the fork base](#upstream-main-past-the-fork-base). @@ -1157,7 +1158,8 @@ The physical branch is one first-parent chain: -> PR10 fixup [271] -> microVM RPC options parsed on a big stack [272] -> PR10 fixup [273] - -> 09cd771c0 (NVX pin) + -> IOAPIC MMIO reads wider than 4 bytes zero-extended [274] + -> e2458a6ce (NVX pin) ``` For upstream review, PR01-PR03, PR05, PR06, and PR14 can be rebased independently onto current @@ -1208,7 +1210,7 @@ restore and time advance set in the RTC's clock source, which overflowed near ei ## Commits after the mapped tip -The NVX pin extends the chain past position 124 without merges. Of the 149 later commits, +The NVX pin extends the chain past position 124 without merges. Of the 150 later commits, positions 234-236 are PR09 fixups, position 240 is a PR13 fixup, position 241 is a PR18 fixup, position 242 is a PR20 fixup, position 243 is a PR19 fixup, positions 262-269 are the fixups of the v6.1 rebase, positions 271 and 273 are PR10 fixups, and the others are not yet classified or @@ -1218,7 +1220,7 @@ and 162-200 did, which developed one concept; "(part)" marks a v2.4 fixup that s commits. Positions 180-184 followed the v3.0 reorganization, positions 185-198 are the ABI restart of the v4.0 reorganization, positions 199-204 followed it, positions 205-211 followed the v5.0 reorganization, positions 212 and 213 followed the v5.1 rebase, positions 214-261 followed the -v6.0 reorganization, positions 262-269 are the v6.1 rebase's fixups, and positions 270-273 +v6.0 reorganization, positions 262-269 are the v6.1 rebase's fixups, and positions 270-274 followed the v6.1 rebase, so they combine none, apart from position 213, which combines v5.1 positions 222 and 223. Each commit's position is its v6.0 position less seven, the number of commits that the v6.1 rebase dropped before it, and its v6.0 position is its v5.1 position @@ -1380,10 +1382,11 @@ through 147 and one less from v5.1 position 149 on; see | 271 | `67ac3e283` | - | - | - | - | - | chipset: keep the RTC's time and timer phases across a snapshot (microsoft/openvmm#5077); fold into 016, its fields' numbering into 193, its comment and guide sentence into 248 | | 272 | `fb2c8b75c` | - | - | - | - | - | openvmm_entry: parse the microVM options on a big stack on every host (microsoft/openvmm#5077) | | 273 | `09cd771c0` | - | - | - | - | - | chipset: bound the RTC's restored and advanced time (microsoft/openvmm#5083); fold into 016, after 271 | +| 274 | `e2458a6ce` | - | - | - | - | - | chipset: zero-extend wide IOAPIC MMIO reads (microsoft/openvmm#5084) | The remarks that say whether commits apply to upstream main record what was found on upstream main when each commit was mapped: the v3.0 reorganization's base, `b2676222b`, for the commits -that it regrouped, and later fork bases, up to `7d90c4104` for positions 270-273, for later +that it regrouped, and later fork bases, up to `7d90c4104` for positions 270-274, for later commits. They name the positions that the commits have now, but the v6.1 rebase did not check the earlier ones again on `7d90c4104`. @@ -2152,6 +2155,14 @@ snapshot fields, and their tests, which position 016 adds, and position 271's va fields and paragraph of the timekeeping reference, so it follows PR10 upstream, folded into position 016 after position 271. +Position 274 makes the IOAPIC's `mmio_read` zero-extend a read of its index or data register +that is wider than 4 bytes, which panicked the vCPU thread, and so OpenVMM, because it copied the +register's low bytes into the whole buffer, in code that upstream main has, and adds a test to +the device's tests, in a file whose saved-state tests position 183 also changes, none of 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.1 commits, which include the fixups that the v3.0, v4.0, v5.0, and v6.0