Skip to content

Commit b269fea

Browse files
authored
Merge pull request #2284 from microsoft/agents/issue-1388-kvm-feature-control-vmx-host
openvmm: pin KVM binds that set IA32_FEATURE_CONTROL only on VMX
2 parents 6c87160 + b3dfd55 commit b269fea

2 files changed

Lines changed: 55 additions & 12 deletions

File tree

‎doc/openvmm-upstream-roadmap.md‎

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
The v8.1 rebase moved the chain from `bf353460ff70e4a65627bb7003bed2cad1ce121f`, the fork base of v8.0.
77
- Mapped fork tip: `06bfe58a65a9ed04690abeee8b8a8aa937cd7f3a`, position 126. The graph, PR summary, and exact mapping
88
cover positions 001-126 and the later PR20, PR25, and PR18 fixups.
9-
- NVX's pinned OpenVMM revision: `10fc4d8ff17bce15af5eb69a3aa913707a61b896`, position 401, the v8.1 release candidate.
10-
Positions 001-399 replay the v8.0 line through NVX's previous pin, `ee66d23117a9ebdd358686d8d9bacd1218d7dac0`;
11-
positions 400 and 401 adapt upstream tests. The pin is 275 commits past the mapped tip.
9+
- NVX's pinned OpenVMM revision: `8a41259cf5222fa61a0b3cf36b925e702b683bf3`, position 403, the head
10+
of microsoft/openvmm#5307, whose commits, positions 402 and 403, follow position 401, `10fc4d8ff`,
11+
the v8.1 release candidate and the head of `feature/microvm/dev`.
12+
Positions 001-399 replay the v8.0 line through its last NVX pin, `ee66d23117a9ebdd358686d8d9bacd1218d7dac0`;
13+
positions 400 and 401 adapt upstream tests. The pin is 277 commits past the mapped tip.
1214
Positions 375 and 376 are PR20 fixups, 377 is a PR25 fixup, and 389, 393, and 396 are PR18
13-
fixups. Positions 127-374, 378-388, 390-392, 394, 395, and 397-399 remain unassigned.
14-
Positions 400 and 401 are rebase fixups with the fold targets listed below.
15+
fixups. Positions 127-374, 378-388, 390-392, 394, 395, 397-399, and 402 remain unassigned.
16+
Positions 400 and 401 are rebase fixups with the fold targets listed below, and position 403 is
17+
a fixup of position 402.
1518
- Upstream main: `de11aa1b6efb34256630c8417fb03f81440099e7` (2026-11-26), one commit past the fork base;
1619
see [Upstream main past the fork base](#upstream-main-past-the-fork-base).
1720

@@ -1817,7 +1820,9 @@ The physical branch is one first-parent chain:
18171820
-> directory listings that close a descriptor that fdopendir refuses [399]
18181821
-> v8.1 upstream state-test fixup [400]
18191822
-> v8.1 upstream chipset-test fixup [401]
1820-
-> 10fc4d8ff (NVX pin)
1823+
-> IA32_FEATURE_CONTROL written only where KVM runs on VMX [402]
1824+
-> position 402 comment fixup [403]
1825+
-> 8a41259cf (NVX pin)
18211826
```
18221827

18231828
For upstream review, PR01-PR03, PR05, PR06, and PR14 can be rebased independently onto current
@@ -1859,17 +1864,19 @@ position 393's fold shares `create_with_flags`, after position 083's test of `re
18591864

18601865
## Commits after the mapped tip
18611866

1862-
The NVX pin extends the chain past position 126 without merges. Of its 275 later commits, positions
1867+
The NVX pin extends the chain past position 126 without merges. Of its 277 later commits, positions
18631868
375 and 376 are PR20 fixups, position 377 is a PR25 fixup, positions 389, 393, and 396 are PR18
1864-
fixups, and positions 400 and 401 are v8.1 rebase fixups. The others are not yet assigned to PRs.
1869+
fixups, positions 400 and 401 are v8.1 rebase fixups, and position 403 is a fixup of position 402.
1870+
The others are not yet assigned to PRs.
18651871
Each of positions 127-181 combines the v2.4 commits that the table lists, as v3.0 positions 145-160
18661872
and 162-200 did, which developed one concept; "(part)" marks a v2.4 fixup that split across
18671873
commits. Positions 182-186 followed the v3.0 reorganization, positions 187-200 are the ABI restart
18681874
of the v4.0 reorganization, positions 201-206 followed it, positions 207-213 followed the v5.0
18691875
reorganization, positions 214 and 215 followed the v5.1 rebase, positions 216-253 followed the
18701876
v6.0 reorganization, positions 254-296 followed the v6.1 rebase, positions 297-314 followed the
18711877
v7.0 reorganization, positions 315-331 followed the v7.1 rebase, positions 332-355 followed the
1872-
v7.2 rebase, and positions 356-399 followed the v8.0 reorganization, so they combine none, apart
1878+
v7.2 rebase, positions 356-399 followed the v8.0 reorganization, and positions 402 and 403
1879+
followed the v8.1 rebase, so they combine none, apart
18731880
from position 215, which combines v5.1 positions 222 and 223, and the commits that the v7.0 and
18741881
v8.0 reorganizations folded into them. The v8.0 column counts the old chain through `ee66d2311`. The table also gives each commit's v7.2 position, which through
18751882
position 301 is its own, since the v8.0 reorganization folded v7.2 positions 302, 316, 333,
@@ -2169,6 +2176,8 @@ whose first 269 commits are those of `feature/microvm/release/v6.1`, a v6.0 posi
21692176
| 399 | `30f1851f0` | 399 | - | - | - | - | - | - | - | lxutil: close the descriptor when fdopendir fails in DirectoryEnumerator::new (microsoft/openvmm#5293) |
21702177
| 400 | `bc669808f` | - | - | - | - | - | - | - | - | virt: adapt upstream saved-state tests (microsoft/openvmm#5274); fold into 258, 261, 272, 277, 278, 283, 287, 290, 291, 295, 303, and 304 |
21712178
| 401 | `10fc4d8ff` | - | - | - | - | - | - | - | - | vmotherboard: adapt the standard RTC and lifecycle tests (microsoft/openvmm#5243); fold into 011, 052, and 236 |
2179+
| 402 | `e2ab2259b` | - | - | - | - | - | - | - | - | virt_kvm: set IA32_FEATURE_CONTROL only where KVM runs on VMX (microsoft/openvmm#5307) |
2180+
| 403 | `8a41259cf` | - | - | - | - | - | - | - | - | virt_kvm: qualify the IA32_FEATURE_CONTROL comments with kvm.ignore_msrs (microsoft/openvmm#5307); fold into 402 |
21722181

21732182
The remarks below retain the historical SHAs and review evidence of their original mappings.
21742183
The remarks that say whether commits apply to upstream main record what was found on upstream main
@@ -2182,8 +2191,9 @@ and `c0694c4da`, upstream main on 2026-11-16, for positions 297-305, `c4419be15`
21822191
for positions 325 and 326, `bf353460f`, upstream main on 2026-11-21 and the fork base of v7.2 and
21832192
v8.0, for positions 327-355, `b50d0c979`, upstream main later on 2026-11-23, for position 356,
21842193
`5d6ab1cfa`, upstream main later that day, for positions 357-368, `efe0b08df`, upstream main later
2185-
still, for positions 369-375, and `8d4e03132`, upstream main on 2026-11-24, for positions
2186-
376-399. They name the positions that the commits have now, but neither
2194+
still, for positions 369-375, `8d4e03132`, upstream main on 2026-11-24, for positions
2195+
376-399, and `de11aa1b6`, upstream main on 2026-11-26, for positions 402 and 403. They name the
2196+
positions that the commits have now, but neither
21872197
the v8.0 reorganization and the v7.2 rebase, both on `bf353460f`, the v7.1 rebase on `9a875b563`,
21882198
nor the v7.0 reorganization on `e6b458cc0` checked them again, nor did the v6.1 rebase check the
21892199
earlier ones on `7d90c4104`.
@@ -6197,6 +6207,39 @@ Position 399 is a cherry-pick of microsoft/openvmm#5291's `7417a033b`, which pro
61976207
main, `8d4e03132`, where `lxutil` type-checks and its 38 tests pass, so it can go upstream on its own,
61986208
and a rebase onto an upstream main that has it drops it.
61996209

6210+
Position 402 has the KVM backend's `bind` write `IA32_FEATURE_CONTROL` only where KVM runs on VMX
6211+
(microsoft/nvx#1388). Upstream's `bind`, since microsoft/openvmm#3623, writes a locked
6212+
`IA32_FEATURE_CONTROL` for every VP whose CPUID names Intel, but only KVM's VMX code has that MSR:
6213+
on an AMD host, KVM runs on SVM and refuses the write unless `kvm.ignore_msrs` is set, so a VP of a
6214+
partition whose CPUID names GenuineIntel, which a caller of the backend can set through
6215+
`PartitionConfig::cpuid`, failed to bind with `IncompleteMsrs { failed_msr: 58 }`. OpenVMM's own VMs
6216+
never reached it: without a time ABI a VM's CPUID names the host's vendor, and with one, which the
6217+
microVM always has, an Intel CPU profile is refused on an AMD host with `E_CPU_GENERATION` before
6218+
the partition is built. `KvmPartitionInner` gains `host_vmx`, which `build` sets from position 304's
6219+
`KvmSupport::svm`, which the vendor of KVM's supported CPUID decides, and `bind` writes the MSR only
6220+
where it is set and the CPUID names Intel, so nothing changes on an Intel host. In `x86_64/mod.rs`,
6221+
which PR10's positions 021 and 024, PR17's position 072, and 23 positions that no PR has yet also
6222+
change, it sets the field in `build` between upstream's `mce_cmci_supported` and position 248's
6223+
`lapic_preemption_timer`, changes upstream's condition of the write and its comment in `bind`, and
6224+
adds its `/dev/kvm` test, which builds a partition whose CPUID names Intel and binds its VP, as
6225+
position 381's test builds one and binds its second VP, in a module of its own after position 284's
6226+
`kvm_tests`; in `lib.rs`, which PR10's position 024 and positions 128, 142, 248, 259, 265, 283, 285,
6227+
301, 373, 380, and 381 also change, it adds the field between the same two fields. It follows
6228+
position 401; of positions 382-401, none changes its files. It is not a fixup: the write and its
6229+
condition are upstream's, and it changes no line that a mapped PR adds. Upstream main, `de11aa1b6`,
6230+
writes the MSR the same way, but replaying the commit there conflicts in `x86_64/mod.rs` and
6231+
`lib.rs`, which lack position 248's `lapic_preemption_timer`, beside which it adds the field, and
6232+
position 284's `kvm_tests`, after which it adds its test, it sets the field from position 304's
6233+
`KvmSupport`, which upstream main lacks, and its test sets the fields of `ProtoPartitionConfig` that
6234+
positions 036 and 127 add, so it cannot go upstream on its own.
6235+
6236+
Position 403 is a fixup of position 402, to fold into it. It qualifies the comments of position
6237+
402's write and of its test: KVM on SVM refuses the write only while `kvm.ignore_msrs` is off, as
6238+
it is by default, and with it set ignores the write and reads the MSR as 0, so the bind succeeded on
6239+
such a host before position 402 as well, and the test cannot tell the two apart there. It changes
6240+
no code, and only lines of `x86_64/mod.rs` that position 402 adds or rewrites, so it goes upstream
6241+
only with position 402.
6242+
62006243
## PR summary
62016244

62026245
Each count is of v8.1 commits, which include the fixups that the v3.0, v4.0, v5.0, v6.0, v7.0, and

0 commit comments

Comments
 (0)