Repository navigation
openvmm: pin the PCI slots that failed chipset device adds leave free - #2061
Merged
Pedro Henrique Penna (ppenna) merged 2 commits intoNov 23, 2026
Merged
Conversation
OpenVMM's chipset device builder registered a PCI chipset device's place, its bus, device, and function, its PCIe downstream port, or its devfn as an RCiEP, with its bus resolver before it finalized the add, which can still fail, as with NameInUse when another state unit has the device's name (#1904). A failed add thus left the dropped device in that place when the chipset was built, where it answered no configuration access, and a device added there instead failed the build with a PciConflict or PcieConflict that named the dropped device. Pin microsoft/openvmm e8324ea31864e90e3486ec89d11f28d15e2c7b67, one commit on b73db6676, the head of microsoft/openvmm#5248, which NVX pinned before this commit: - vmotherboard: claim a device's PCI slot only once its unit spawns. The builder's services only record the places that an add asks for, and finalize registers them with the resolver after the spawn of the device's unit, its last step that can fail, under the builder's lock, so a failed add leaves no place behind and touches no other device's. Its tests pass with the fix; without it, the chipset build fails with a conflict that names the failed device, on Windows. Every caller of the add, the microVM loader among them, returns its error, and NVX's microVMs have no PCI bus or device, so they build and run as before. No saved-state, protocol, or ABI format, and no version of any of them, changes. The protocol vectors and CPU profiles that nvx copies are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…the OpenVMM roadmap Map position 357, the commit of microsoft/openvmm#5249, which NVX now pins at e8324ea31, 231 commits past the mapped tip: - 357, vmotherboard: claim a device's PCI slot only once its unit spawns. ArcMutexChipsetServices::finalize registers a chipset device's places, on its PCI bus, on its PCIe downstream port, or at its devfn as an RCiEP, with the builder's bus resolver only once the device's state unit has spawned, the last step of the add that can fail. The add registered them before finalize, so an add that failed there, as with NameInUse when another unit had the device's name, left the dropped device's weak reference in its places, where the built chipset attached it, and a device added in its place failed the build with a PciConflict or a PcieConflict that named the dropped device. Position 357 is not yet assigned to a PR. In services.rs, it extends the order of finalize, and the tests module, that position 316 adds, and PR10's position 015 and position 315 also change the file; in builder/mod.rs, it moves the resolver's three registration methods from ChipsetBuilder to BusResolver, and position 015 also changes the file. It changes none of the code that a mapped PR adds, so it is no fixup, and it follows position 316. Upstream main, 5d6ab1cfa, registers the places before finalize the same way; replaying the commit there conflicts in services.rs, whose code of position 316 it changes, so it cannot go upstream on its own. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the roadmap update documenting the OpenVMM PCI slot registration fix.
No open issues 🎉
What changed in this PR
This PR pins the OpenVMM fix for #1904, which delays PCI slot registration until device construction succeeds so failed adds leave slots available. The reviewed roadmap update records that pin and its place in NVX’s OpenVMM chain.
Changes:
- Updates the documented pin to
e8324ea31, position 357, and adjusts chain counts and ranges. - Documents the fix’s behavior, dependency on position 316, and upstream applicability.
| File | Description |
|---|---|
doc/openvmm-upstream-roadmap.md |
Updates the pin, chain diagram, commit mapping, and analysis for position 357. |
Review effort: Balanced
This was referenced Nov 23, 2026
Pedro Henrique Penna (ppenna)
deleted the
agents/issue-1904-pci-slot-rollback
branch
November 23, 2026 22:46
This was referenced Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1904
What does this pull request change?
It pins microsoft/openvmm#5249, which makes OpenVMM's chipset device builder in
vmotherboardplace a PCI chipset device on its bus only once the device's add can no longer fail.ArcMutexChipsetDeviceBuilder::inner_addregistered the device's place with the builder's bus resolver beforeArcMutexChipsetServices::finalize, which can still fail, as withNameInUsewhen another state unit has the device's name. The place is its bus, device, and function on a PCI bus, its PCIe downstream port, or its devfn as an RCiEP of a root complex. Nowregister_static_pci,register_static_pcie, andregister_static_pcie_rcieponly record the places that the add asks for, andfinalizeregisters them with the resolver after the spawn of the device's state unit, its last step that can fail, under the builder's lock, where it already makes the device the chipset's EOI handler, PIC, and line target. A failed add leaves no place behind and touches no other device's; a successful add registers the same places as before, which the resolver attaches to the buses as the chipset is built. The resolver's three registration methods move fromChipsetBuilder, whose methods take the builder's lock, toBusResolver, whichfinalizereaches under the lock that it holds.No version is created or bumped: no ABI, machine-contract, time-ABI, snapshot, manifest, saved-state, or protocol version changes, in NVX or in OpenVMM, and no saved-state, snapshot, or on-disk format changes.
Commits:
openvmm: pin the PCI slots that failed chipset device adds leave freemoves the gitlink fromb73db6676, the head of [DO NOT REVIEW] fuse: adopt a FUSE_INIT negotiation only once its reply is sent openvmm#5248, which openvmm: pin the discard of FUSE_INIT negotiations whose reply fails #2060 pins, toe8324ea31864e90e3486ec89d11f28d15e2c7b67, the head of [DO NOT REVIEW] vmotherboard: claim a device's PCI slot only once its unit spawns openvmm#5249, and changes nothing else. The protocol vectors and CPU profiles thatnvxcopies are unchanged.doc: map the PCI slots that failed chipset device adds leave free in the OpenVMM roadmapmaps the new chain position, 357.Start with
finalizeand theregister_static_pci*methods in microsoft/openvmm#5249'svmm_core/vmotherboard/src/chipset/backing/arc_mutex/services.rs, then theBusResolvermethods invmm_core/vmotherboard/src/chipset/builder/mod.rs, then the two tests at the end ofservices.rs.Left out: an add's static MMIO and port I/O regions, which
register_static_mmioandregister_static_piomap as the add asks for them, beforefinalize. A failed add's regions unmap when they drop, but a conflict that one of their mappings met stays in the ranges' list of static registration conflicts, so the chipset's build still reports it, for a device that no longer exists. That is a separate latent defect, which this pull request leaves as it is. NVX's microVMs reject PCI and PCIe (doc/design/2.1-machine-model-and-configuration.md, section 2.1.1), so no NVX documentation describes this path, and none changes.Why is this change needed?
Nothing took a failed add's registration back. The resolver kept the dropped device's
Weakin its place, andChipsetBuilder::buildattached it to the bus, where configuration accesses found no device. A device added in the same place afterwards failed the chipset's build with aPciConflict, or aPcieConflictfor a downstream port or an RCiEP, that named the dropped device. No caller goes on after a failed add: each, such as the base chipset and the microVM's device loader, returns its error. So this is a latent lifecycle hazard of the builder, which #1904 found by reading the code, rather than a failure that NVX can reach.The registration before
finalizeis upstream OpenVMM's: upstream main,5d6ab1cfa, registers the place the same way. The chain'svmotherboard: wire a chipset device only once its unit spawns(microsoft/openvmm#5170, roadmap position 316) already moved the rest of the device's wiring after the spawn for the same reason, and this change extends that ordering offinalize.Rejected: taking the registration back when
finalizefails, which needs an undo for each of the resolver's three lists, kept in step with every step offinalizethat can fail; registering the places only once the add can no longer fail needs no undo, as for the rest of the device's wiring.How was this change validated?
Checks and results:
OpenVMM,
cargo nextest run --profile agent -p vmotherboard, with the fix reverted (the production code of899dcd63f, whosevmotherboardequals that ofb73db6676, [DO NOT REVIEW] fuse: adopt a FUSE_INIT negotiation only once its reply is sent openvmm#5248's head, which changes onlyfuse) and with it:failed_add_leaves_the_pci_slot_freewithPciConflict { bdf: (0, 5, 0), conflict_dev: "replacement", reason: ExistingDev("device") };failed_add_leaves_the_pcie_port_and_rciep_freewithPcieConflict { conflict_dev: "rciep replacement", reason: ExistingDev("rciep") }andPcieConflict { conflict_dev: "endpoint replacement", reason: ExistingDev("endpoint") }e8324ea31unit tests [x64-linux]e8324ea31failed_add_leaves_*tests ofvmotherboardunit tests [x64-windows]e8324ea31At the pin, on Windows,
cargo check,cargo clippy --all-targets, andcargo doc --no-depsforvmotherboardare clean, apart from theLNK4199linker message that every linked artifact gets on this machine, andcargo xtask fmt --fixchanges nothing.python scripts/local_gates.py --base origin/agents/issue-1898-init-reply-failureselects test-changes, markdown-links, test-layout, openvmm-vectors, openvmm-cpu-profiles, nvx-cli, and openvmm-ci. On Windows:python scripts/check_test_changes.py --base origin/agents/issue-1898-init-reply-failurelists no change;python scripts/check_markdown_links.pyandpython scripts/check_test_layout.pypass;cargo test --locked --manifest-path nvx/Cargo.toml --no-default-features --test openvmm_vectors -- --ignoredpasses, 4 tests, and--test openvmm_cpu_profiles -- --ignoredpasses, 1 test.python scripts/openvmm_pin.py check-branch --target origin/agents/issue-1898-init-reply-failure, standalone and with--topic, againstbe79b3fb52b, openvmm: pin the discard of FUSE_INIT negotiations whose reply fails #2060's head, andpython scripts/openvmm_pin.py check-roadmap, ofHEADand with--worktree, pass.python scripts/openvmm_pin.py source e8324ea31864e90e3486ec89d11f28d15e2c7b67 --pr 5249reports a good signature and the pull request's head.python scripts/nvx.py verifypasses.python scripts/nvx.py check-openvmm-ci --revision e8324ea31864e90e3486ec89d11f28d15e2c7b67passes: OpenVMM's run 45261953268 passed all six jobs that NVX requires. Itsrun vmm-tests [x64-linux-amd-kvm]job failed once. The failing test wasmultiarch::pcie::openvmm_uefi_x64_windows_datacenter_core_2025_x64_virtio_net_kdnet_windows, which timed out at the guest's power-off aftervirtio_netloggeddescriptor 0 is already outstanding. That is the intermittent upstream failure that virtio: defer reused outstanding descriptors instead of stopping the queue openvmm#5161 describes: the guest's KDNET transport reuses an outstanding transmit descriptor during shutdown, and the VM never halts. Before that, the test had found the virtio-net device at the PCI address that the chipset gave it, rebooted, and got its DHCP address through it. The job passed on its one rerun, with all 150 tests, the KDNET test among them in 47 s. The run's SNP job fails as well; NVX does not require it.python scripts/openvmm_pin.py land e8324ea31864e90e3486ec89d11f28d15e2c7b67 --remote origin, a dry run, finds a fast-forward offeature/microvm/dev.A review of this branch's whole diff,
git diff --submodule=diff origin/agents/issue-1898-init-reply-failure HEAD, which includes the OpenVMM commit, found nothing. Copilot's review of03b36867167reports no issues.NVX CI, run 45270261718, of
03b36867167, passed. Its first attempt passed every job butOpenVMM CI of the pinned revision, which failed at once on OpenVMM's failed KVM job, and theRequired status checkthat depends on it. The jobs that passed include the microVM tests, the guests and sandboxes, the packages, and the platform tests on KVM, MSHV, and WHP, the NVX CLI on Linux and Windows, and the performance gate. Both failed jobs passed on their rerun, once OpenVMM's KVM job had passed.Runtime: none locally. NVX's microVMs reject PCI and PCIe, so a microVM's chipset gets no PCI place through this path, and a successful add registers the same places as before. The Linux test hosts, nvx-kvm-test and nvx-mshv-test, accepted no SSH connection at 13:28 or at 13:57 PST, so NVX CI's matrix stands in for them.
Backend, host OS, host type, and guest: the unit tests ran on Windows 11, local, and in OpenVMM's CI on x64 Linux and Windows runners; OpenVMM's VMM tests ran on its KVM, MSHV, and Windows runners; NVX's microVM scenarios ran in NVX CI on KVM, MSHV, and WHP virtual machines, with the guests that CI builds.
Left to CI: the merge group's run.
Checklist
python3 scripts/check_test_layout.pychecks.python3 scripts/check_test_changes.py --base origin/devlists no changeto an existing test, or a Changes to existing tests section below
explains each one.
.github/copilot-instructions.mdand the skills when a convention orworkflow changes.
nvxupdatesnvx/public-api/withpython3 scripts/public_api.py --update.description says how the change versions or migrates them.
OpenVMM pin
OpenVMM pull request: [DO NOT REVIEW] vmotherboard: claim a device's PCI slot only once its unit spawns openvmm#5249, Ready, one commit on
b73db6676, the head of [DO NOT REVIEW] fuse: adopt a FUSE_INIT negotiation only once its reply is sent openvmm#5248 and now offeature/microvm/dev:e8324ea31vmotherboard: claim a device's PCI slot only once its unit spawns.Pinned revision:
e8324ea31864e90e3486ec89d11f28d15e2c7b67, the pull request's exact head, with a good signature.Prerequisites: [DO NOT REVIEW] fuse: adopt a FUSE_INIT negotiation only once its reply is sent openvmm#5248, at
b73db66767b9f57621c87a69b80f0a9e4e0fd9fa, which has landed:feature/microvm/devis at that commit, and openvmm: pin the discard of FUSE_INIT negotiations whose reply fails #2060, which pins it, has merged intodev. Also the chain's position 316,804097333([DO NOT REVIEW] vmotherboard: wire a chipset device only once its unit spawns openvmm#5170), whose ordering offinalizeand whosetestsmodule this commit extends.Equivalence: none to claim; the pin is the pull request's exact and only head, at which the checks above ran.
Roadmap: position 357, unassigned and not a fixup: it changes none of the code that a mapped PR adds, and follows position 316. It does not apply to upstream main,
5d6ab1cfa: replaying it there conflicts inservices.rs, whose code of position 316 it changes. The pin is 231 commits past the mapped tip.Stack: this pull request was stacked on openvmm: pin the discard of FUSE_INIT negotiations whose reply fails #2060 (openvmm: FUSE session retains negotiated values when the INIT reply cannot be sent #1898), which pins [DO NOT REVIEW] fuse: adopt a FUSE_INIT negotiation only once its reply is sent openvmm#5248, and [DO NOT REVIEW] vmotherboard: claim a device's PCI slot only once its unit spawns openvmm#5249 is stacked on [DO NOT REVIEW] fuse: adopt a FUSE_INIT negotiation only once its reply is sent openvmm#5248. openvmm: pin the discard of FUSE_INIT negotiations whose reply fails #2060 has merged, and GitHub retargeted this pull request to
dev, where only its two commits are new; [DO NOT REVIEW] vmotherboard: claim a device's PCI slot only once its unit spawns openvmm#5249's top commit is the only one thatfeature/microvm/devlacks.Landing order, 1898 then 1904:
feature/microvm/devtob73db66767b9f57621c87a69b80f0a9e4e0fd9fa, and openvmm: pin the discard of FUSE_INIT negotiations whose reply fails #2060 merged.feature/microvm/devtoe8324ea31864e90e3486ec89d11f28d15e2c7b67, then merge this pull request.OpenVMM's merge button squashes, which would leave the pins off the branch.