Repository navigation
openvmm: answer guest UDP to host loopback from the gateway - #583
Merged
Pedro Henrique Penna (ppenna) merged 1 commit intoOct 16, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
A publication-port collision remains unresolved, and exact-head validation of the networking dependency is not established.
1 open finding
What changed in this PR
Updates the OpenVMM integration to preserve gateway source addresses for host-loopback UDP replies, addressing connected-socket timeouts in #560.
Changes:
- Pins the OpenVMM fix.
- Adds IPv4 and IPv6 connected-UDP regression coverage.
- Documents reply addressing and records the dependency revision.
| File | Description |
|---|---|
| scripts/test_microvm_tests.py | Tests echo services and missing-reply failures. |
| scripts/nvx_tools/microvm_tests.py | Adds host UDP echo services and egress rules. |
| scripts/nvx_tools/microvm_test_scripts/host-loopback-policy.sh.in | Checks connected UDP replies through both gateways. |
| doc/run.md | Explains gateway-sourced replies. |
| doc/openvmm-upstream-roadmap.md | Records the updated OpenVMM revision. |
| doc/design/3.5-network.md | Clarifies reply and host-peer addressing. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Pedro Henrique Penna (ppenna)
force-pushed
the
agents/debug-issue-560-baremetal-servers
branch
from
October 16, 2026 17:48
dbcf04f to
3f74354
Compare
Pedro Henrique Penna (ppenna)
requested a review
from Enrique Saurez (esaurez)
October 16, 2026 18:02
Pedro Henrique Penna (ppenna)
marked this pull request as ready for review
October 16, 2026 18:11
Fixes #560. Part of #393. Pin nanvix/openvmm#137 at 5ab8a84621524f1777b2cb5e65a70dab42c8b453, two commits on c6d97c52. OpenVMM answered the guest's UDP to host-loopback services, which the guest reaches at its gateway, from the addresses at which it presents other host peers: 10.0.0.254 instead of 10.0.0.1, and fd00::a00:ff instead of fd00::a00:1, for 10.0.0.2/24. Unconnected guest sockets accepted those replies, but connected ones, which accept datagrams only from the peer to which they are connected, dropped them, so connected UDP to host loopback timed out over IPv4 and IPv6 on every backend. Replies on the guest's UDP flows now come from the address and port that the guest addressed, while host peers that the guest did not address keep their virtual addresses. OpenVMM also tore down the partition and guest memory without stopping the VM's devices, so a netvsp queue worker that ran during teardown could read its vmbus ring from guest memory that was already unmapped, and OpenVMM aborted. ttrpc::test_ttrpc_interface failed this way on Linux/MSHV, including in this change's first CI run. The second commit stops the devices first. Extend the allow phase of the host-loopback-policy microVM scenario: under its egress default of deny, with rules that admit only these datagrams, the guest's connected nc exchanges a datagram with host UDP services on IPv4 and IPv6 loopback through its gateway. The phase fails with the previous pin. Describe the source of these replies in the run guide and the network design, and index both OpenVMM commits in the roadmap. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pedro Henrique Penna (ppenna)
force-pushed
the
agents/debug-issue-560-baremetal-servers
branch
from
October 16, 2026 19:53
3f74354 to
6bb5fe2
Compare
Pedro Henrique Penna (ppenna)
deleted the
agents/debug-issue-560-baremetal-servers
branch
October 16, 2026 21:11
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.

Summary
Guest-initiated connected UDP to a host-loopback service timed out over IPv4 and IPv6 (#560). OpenVMM translated the guest's datagrams to the gateway onto host loopback, but answered them from the virtual addresses at which it presents other host peers,
10.0.0.254andfd00::a00:fffor10.0.0.2/24, instead of the gateway that the guest addressed,10.0.0.1andfd00::a00:1. Unconnected sockets accepted those replies; connected sockets drop datagrams from any other peer, so they timed out. The issue was reported on Windows/WHP, and it reproduces identically on Linux/KVM and Linux/MSHV.ttrpc::test_ttrpc_interfaceabort on Linux/MSHV (OpenVMM: intermittent abort while stopping the VM in MSHV test_ttrpc_interface vmm-test #393) that failed this pull request's first CI runhost-loopback-policymicroVM scenario with connected UDP exchanges through the gateway to host services on IPv4 and IPv6 loopbackdoc/run.mdanddoc/design/3.5-network.md, and index the pin in the roadmapFixes #560. Part of #393.
OpenVMM dependency
mainatc6d97c529986c0b3b1bf1fd7f00406654cdeee67, the revision thatdevpins:eae7da6f3(consomme UDP replies) and5ab8a8462(device stop before VM teardown)5ab8a84621524f1777b2cb5e65a70dab42c8b453, the PR head. Merging the PR by fast-forwarding OpenVMMmain, as consomme: present IPv6 host peers inside the static subnet nanvix/openvmm#135 was, keeps this pin onmainChanges
openvmm:c6d97c52→5ab8a846host-loopback-policy: the allow phase starts UDP echo services on host127.0.0.1and::1, admits only the guest's datagrams to them with an IPv4 and an IPv6 egress rule under its egress default ofdeny, and requires the guest'snc -u, whose socket is connected, to receive each reply through the gateway (failure codes 84 and 85)scripts/test_microvm_tests.py: the allow script fails with 84 or 85 when either reply is missing, the echo service answers every request and rejects unexpected ones, and the rendered script leaves no placeholderdoc/run.md,doc/design/3.5-network.md, and the roadmap indexThe #393 abort in the first CI run
The first CI run on this pull request, 38945387812, failed only
OpenVMM vmm-tests / Linux / MSHV:ttrpc::test_ttrpc_interfacegotchannel closedfromTeardownVmbecause OpenVMM aborted while it stopped the VM worker after a guest power-off, the signature of #393. The runner kept the core dump (SIGABRT). Symbolized against a build of the same source and toolchain, it shows a SIGSEGV on a netvsp queue thread inIncomingRing::verify_interrupts_unmasked, which read its vmbus ring's control page, through locked pages, from guest memory that teardown had already unmapped;trycopy's signal handler turned it into an abort without a message.LoadedVm::runtore down the partition and guest memory without stopping the device state units, and nanvix/openvmm#137's second commit stops them first, as the restart path already does.On bare-metal Linux/MSHV, the abort did not reproduce in 200 runs without the fix, as #393 predicted, but a temporary delay on the netvsp queue thread at the point where the CI runner's thread stalled reproduces it, with the same faulting frame. With the fix, that reproduction passes 3/3,
ttrpc::test_ttrpc_interfacepasses 200/200 in 8 concurrent loops, and 32/32 of the ttrpc, Linux direct-boot, andx86_64_exclusiveVMM tests pass. The fix's OpenVMM gates are listed in nanvix/openvmm#137.Validation
On bare-metal hosts, with an Alpine guest on
10.0.0.2/24and--host-loopback allow, and NVX36fc8aedwith this change, before it moved onto the currentdev, whose new commits change only CI kernel-cache keys,doc/usage.md, and performance baselines. Baseline: the releasedv0.1.0-dev.36fc8aedcb39OpenVMM (c6d97c52). Fixed: OpenVMM built from nanvix/openvmm#137 before its test-only hop-limit refactor, so with the same production code.host-loopback-policy, baseline → fixedThe probe mirrors the issue's: an unconnected and then a connected UDP socket per family. With the baseline, the unconnected replies came from
10.0.0.254andfd00::a00:ff, and the connected sockets timed out. The other network scenarios arevirtio-net,directional-network-policy,private-network-ingress,ipv6-egress-policy,l3-l4-egress-policy,l3-l4-egress-protocols,l3-l4-egress-port-ranges,network-snapshot, andendpoint-policy-snapshot.On
6bb5fe23, rebased onto the currentdev(11c7a0f4, whose new commits change guest-build cache inputs and performance baselines), on Windows:python scripts\nvx.py verifyruff checkandruff format --checkforscriptsand.github/specula;pyrightfor Linux and Windows: 0 errorsvalidate-nvxunit tests: 1181 tests OK (117 skipped on Windows)python scripts/check_markdown_links.pyThe OpenVMM revision's own gates are listed in nanvix/openvmm#137.
Not run: the ACI Edge Sandboxes end-to-end suite, through whose library backend the issue was reported; this PR changes neither
aci_edge_sandboxesnornvx-rs.Exact NVX head:
6bb5fe2362058fae38f6bb43d2d29733ad2cdc3aExact OpenVMM head:
5ab8a84621524f1777b2cb5e65a70dab42c8b453