Conversation
With WHP's user-mode APIC, which --hypervisor whp:user_mode_apic selects, as does no_enlightenments with --hv, OpenVMM's restore_activity wrote the four Hyper-V registers of the activity, the internal activity state among them, and WHP denies a write of that register when it does not emulate the APIC, even of the running state that it holds (#1472). So every restore of such a VP's activity failed, a snapshot's included, and an INIT to an AP, which every multiprocessor guest sends, aborted the VMM. NVX never selects the user-mode APIC, which the WHP time ABI refuses, so nothing that NVX runs changes. Pin fa239c823b14bcd88abed9db7d241c89a578025b, the head of microsoft/openvmm#5277, one commit on acfaa5199, the head of microsoft/openvmm#5276, which NVX pins below this commit: - virt_whp: write no internal activity state with the user-mode APIC. restore_activity writes only the pending interruption, the interrupt state, and the pending event of a VP whose APIC the VMM emulates, and the VMM keeps the VP's halt and its wait for a SIPI itself, as before. Four new WHP contract tests of virt_backend_tests restore an activity in each state that the VMM keeps, restore the save of a new VP into a new partition, with Hv1 and without it, and send an AP an INIT and then a SIPI. No saved state, protocol, ABI, or format, and no version of any of them, changes. NVX needs no coordinated change: the protocol vectors, the source excerpts, the contract versions, and the CPU profiles that nvx copies from OpenVMM match the revision's. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…enVMM roadmap Map position 383, the commit of microsoft/openvmm#5277, which NVX now pins at fa239c823, 257 commits past the mapped tip, on acfaa5199, position 382, the head of microsoft/openvmm#5276: - 383, virt_whp: write no internal activity state with the user-mode APIC. restore_activity writes only the pending interruption, the interrupt state, and the pending event of a VP whose APIC the VMM emulates, since WHP then denies a write of the internal activity state, which failed every restore of such a VP's activity and aborted the VMM at an INIT to an AP. It adds WHP contract tests of virt_backend_tests with a backend whose APIC the VMM emulates, and a fixture of two VPs for them. Positions 138, 143, 287, 288, 291, 293, 297, 299, 300, 305, and 379, which no PR has yet, also change apic.rs. PR05's position 008, PR12's position 036, PR17's position 072, and positions without a PR also change the fixture of virt_backend_tests, PR05's position 008 and positions without a PR its module list and its backends, and PR01's position 002, PR05's position 007, and positions without a PR the Guide's VMM-test page. The commit changes no line that a mapped PR adds: the write of the activity is upstream's, and in the fixture it changes only upstream's lines and position 301's. So it is no fixup, and stays unassigned. Of positions 369-382, positions 373, 379, and 380 change other lines of its files. Replaying it on upstream main, 8d4e03132, conflicts in apic.rs, whose Activity lacks the fields of positions 287 and 291, in the fixture and the module list of virt_backend_tests, which lack the chain's mapped RAM and modules, and in the Guide's VMM-test page, 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 OpenVMM pin update addressing user-mode APIC INIT failures and activity restoration.
No open issues 🎉
What changed in this PR
This PR pins OpenVMM’s fix for INIT failures and activity restoration with the user-mode APIC, addressing #1472. It also records the fix in NVX’s upstream roadmap; NVX’s normal backend selection and saved-state formats remain unchanged.
Changes:
- Advances the OpenVMM pin to
fa239c823, which avoids writing WHP’s internal activity state with the user-mode APIC. - Maps chain position 383 and updates the roadmap’s counts, dependency notes, and upstream applicability analysis.
| File | Description |
|---|---|
doc/openvmm-upstream-roadmap.md |
Records the new pin and documents position 383’s fix, tests, and upstream dependencies. |
Review effort: Balanced
This was referenced Nov 25, 2026
Merged
Pedro Henrique Penna (ppenna)
deleted the
agents/issue-1472-whp-user-apic-activity
branch
November 25, 2026 05:20
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 #1472
What does this pull request change?
It pins microsoft/openvmm#5277, which makes OpenVMM's WHP backend restore the activity of a VP whose APIC the VMM emulates without writing the hypervisor's internal activity state, which WHP denies in that mode. With
--hypervisor whp:user_mode_apic, orno_enlightenmentswith--hv,WhpProcessor::restore_activityinvmm_core/virt_whp/src/apic.rswrote all four Hyper-V registers ofvp::Activity,InternalActivityStateamong them, so every restore of such a VP's activity failed withAccess to the specified object was denied, a snapshot's restore included, and every INIT to an AP aborted OpenVMM, sinceinject_initunwraps the error ofx86_init. It now writes only the pending interruption, the interrupt state, and the pending event there; the VMM keeps the VP's halt and its wait for a SIPI itself, as before. The branch of the hypervisor's APIC is unchanged.virt_whp: write no internal activity state with the user-mode APIC(fa239c823) changes the user-mode APIC's branch ofrestore_activity, and adds four WHP contract tests in a new module ofvirt_backend_tests,vmm_tests/vmm_tests/tests/virt_backend_tests/user_mode_apic.rs, with a new backend whose APIC the VMM emulates,whp_user_mode_apic, innative.rs, a fixture of two VPs (Fixture::build_allandFixture::with_vps) infixture.rs, and a paragraph in the Guide's page on the backend contract tests,Guide/src/dev_guide/tests/vmm.md.Commits:
openvmm: pin the user-mode APIC's INIT and activity restore fixmoves the gitlink fromacfaa5199, the head of [DO NOT REVIEW] virt: saturate Intel's L3 sharing count above 4096 VPs per socket openvmm#5276, which the base branch pins, tofa239c823b14bcd88abed9db7d241c89a578025b, the head of [DO NOT REVIEW] virt_whp: write no internal activity state with the user-mode APIC openvmm#5277, and changes nothing else.doc: map the user-mode APIC's INIT and activity restore fix in the OpenVMM roadmapmaps the new chain position, 383, which no roadmap PR covers yet.This pull request is stacked on the pull request of #1379, #2116 (branch
agents/issue-1379-intel-l3-sharing), which pins microsoft/openvmm#5276; review only its last two commits. Start with the user-mode APIC's branch ofrestore_activityin microsoft/openvmm#5277's last commit, thenuser_mode_apic.rs.Left out: nothing that
nvxruns changes.nvxpasses only the backend's name to--hypervisorand never selects the user-mode APIC, which the WHP time ABI refuses (virt_whp::time_abi::validate_partition). Two other limitations of WHP's activity, which probes for the tests met and this change does not touch, remain: a restore of an activity whose pending interruption is an NMI fails on WHP with either APIC, and with the hypervisor's APIC, a pending interrupt restored with an interrupt shadow whileRFLAGS.IFis clear reads back without the interrupt. No version is created or bumped: no ABI, machine-contract, time-ABI, snapshot, manifest, saved-state, or protocol version, in NVX or in OpenVMM, and no saved-state, snapshot, protocol, or on-disk format changes.Why is this change needed?
With the user-mode APIC, every multiprocessor guest aborted OpenVMM when it sent its APs the INIT that starts them, and no snapshot could be restored, not even an unchanged save of a VP that never ran (#1472).
Root cause: with the APIC emulated in the VMM, WHP's partition has
LocalApicEmulationModeNone, and WHP then denies a write ofInternalActivityStatewithHV_STATUS_ACCESS_DENIED(0xC0350006), even of the running state that the register already holds. Upstream's branch ofrestore_activityfor the user-mode APIC sets the VMM's halt and wait-for-SIPI state, and then writes the wholevp::Activity, running, throughset_register_state, so the write failed every time.x86_init, which makes an AP wait for a SIPI throughset_activity(vmm_core/virt/src/x86/vp.rs), reached it for every INIT, andinject_initunwraps its error;hv1_emulator'sset_x86_vp_context, which starts a VP forHvCallStartVirtualProcessor, failed the same way. The code is upstream's since OpenVMM's first commit; upstream main,8d4e03132, still has it.Rejected alternatives:
debug_assert_eq!on the order of the activity's registers. OpenVMM's instructions preferassert!for internal invariants, so the change asserts it in every build.InternalActivityStateonly when its value does not change: WHP denies even the unchanged value, which is always running here, so the user-mode APIC's branch never needs the register.vmm_core/virt_whp/tests/vp_state.rs: it would run in OpenVMM's unit-test jobs, whose hosts lack WHP, so the tests went intovirt_backend_tests, which OpenVMM's CI runs on its WHP hosts, Intel and AMD, with a backend of their own, so that the existing WHP cases do not run twice.How was this change validated?
Checks and results:
virt_backend_tests(user_mode_apic::whp::restores_the_activity_in_each_state,restores_a_new_vp_into_a_new_partition,restores_a_new_vp_into_a_new_partition_hv1,an_init_makes_an_ap_wait_for_a_sipi), on WHP, atd44a113beand atacfaa5199without the fixfailed to set registers: Access to the specified object was denied. (os error -1070268410), two of them at phaserestore "activity", and the INIT case with the panic ininject_initthat the issue reports (apic.rs:764,apic.rs:775atacfaa5199)d44a113beand rebased onacfaa5199virt_backend_tests, one process each, onfa239c823suspend::whp::user_mode_apic_refuses_an_idle_vp_hv1among the others), 10 ignored for capabilities that the host lacks, 0 failedcargo nextest run --profile agent -p virt_whp --run-ignored allcargo clippy --all-targetsforvirt_whpandvmm_tests,cargo clippy --target x86_64-unknown-linux-gnu -p vmm_tests --test virt_backend_tests,cargo doc --no-deps -p virt_whp -p vmm_tests, andcargo xtask fmt --fixLNK4199linker messages that every linked artifact gets on this machine; after the rebase, the clippy ofvirt_whpand ofvirt_backend_tests, the docs, andfmtagainRFLAGS.IFis clear, as in a new VP, withHV_STATUS_INVALID_VP_STATE, so the tests restore exceptions, which it holds in every statecargo test --locked --manifest-path nvx/Cargo.toml --no-default-features --test openvmm_vectors -- --ignoredcargo test --locked --manifest-path nvx/Cargo.toml --no-default-features --test openvmm_cpu_profiles -- --ignoredpython scripts/openvmm_pin.py source fa239c823b14bcd88abed9db7d241c89a578025b --pr 5277python scripts/openvmm_pin.py check-branch --topic --target origin/agents/issue-1379-intel-l3-sharing,check-roadmap, andcheck-roadmap --worktreepython scripts/nvx.py verifyandpython scripts/check_markdown_links.pypython scripts/local_gates.py --base origin/agents/issue-1379-intel-l3-sharing --only test-changes markdown-links test-layout openvmm-vectors openvmm-cpu-profiles openvmm-ci --run --keep-goingnvx-cligate,python scripts/local_gates.py --base origin/dev --only nvx-cli --run, on scripts that this branch and its base do not changeNVX CLI / WindowsandNVX CLI / Linuxpython scripts/nvx.py check-openvmm-ci --revision fa239c823b14bcd88abed9db7d241c89a578025b, through theopenvmm-cigateunit tests [x64-linux],unit tests [x64-windows],run vmm-tests [x64-linux-amd-kvm],run vmm-tests [x64-linux-intel-mshv],run vmm-tests [x64-windows-intel], andrun vmm-tests [x64-windows-amd]; the last two ran the four new cases, which passed on both the Intel and the AMD hostBackend, host OS, host type, and guest: WHP on Windows 11 Enterprise build 26300, a local workstation with an Intel Core i9-12900H, without a guest: the contract tests set the VPs' state through the
virtinterfaces and run no guest code. No microVM ran, since nothing thatnvxruns changes.NVX's CI run 45538860462 of this head passed,
Required status check,OpenVMM CI of the pinned revision, and the microVM tests on KVM, MSHV, and WHP included.Left to CI: WHP on a virtual-machine host, which NVX's CI covered (above); KVM and MSHV, whose cases of
virt_backend_testsbuild on the changed fixture, which OpenVMM's CI ran on its KVM and MSHV hosts (above), and which this workstation checked only with a Linuxcargo clippy, since nvx-kvm-test is unreachable.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.
Changes to existing tests
None:
python scripts/check_test_changes.py --base origin/agents/issue-1379-intel-l3-sharinglists no change to an existing test of NVX. In OpenVMM, the commit changes no existing case: it splits the fixture'sbuildintobuild_all, which builds a partition of the fixture's VPs, andbuild, which keeps its check of one VP and returns the same as before, haswith_ramcall a function that also takes the number of VPs, with one as before, and adds a backend and a module, which the existing cases do not use.OpenVMM pin
fa239c823virt_whp: write no internal activity state with the user-mode APIC, on [DO NOT REVIEW] virt: saturate Intel's L3 sharing count above 4096 VPs per socket openvmm#5276's head,acfaa5199, which follows [DO NOT REVIEW] virt_kvm: refuse to save a vCPU in an SEV-ES AP reset hold openvmm#5275's head,5d3f172c3, one commit on32e824728, the head offeature/microvm/devsince [DO NOT REVIEW] vm_topology: refuse host VPs per socket outside the builder's range openvmm#5271, [DO NOT REVIEW] virt_whp: refuse to restore an idle VP with the user-mode APIC openvmm#5272, and [DO NOT REVIEW] virt_kvm: refuse more enlightened VPs than the GSI routing table holds openvmm#5273 landed.fa239c823b14bcd88abed9db7d241c89a578025b, the pull request's exact head, with a good signature.8d4e03132, which lacks the fields of the activity that itsapic.rschange replaces, the fixture's mapped RAM, the modules ofvirt_backend_testsbeside its own, and the Guide's paragraph that its own follows.feature/microvm/devto [DO NOT REVIEW] virt_whp: write no internal activity state with the user-mode APIC openvmm#5277's exact head,fa239c823b14bcd88abed9db7d241c89a578025b, not with the merge button, which squashes and would leave the pin off the branch, before this pull request merges.