Skip to content

Replace PVH with ACPI-free Linux direct boot - #106

Open
Pedro Henrique Penna (ppenna) wants to merge 3 commits into
devfrom
direct-boot-linux-mptable
Open

Pedro Henrique Penna (ppenna) wants to merge 3 commits into
devfrom
direct-boot-linux-mptable

Conversation

@ppenna

Copy link
Copy Markdown
Contributor

Dependency

Depends on nanvix/openvmm#80.

Summary

  • replace the NVX PVH boot contract with ACPI-free Linux direct boot through Intel MP 1.4 tables
  • disable CONFIG_PVH and validate MP parsing, APIC/IOAPIC, and virtio-mmio kernel prerequisites
  • use the same MP-capable NVX kernel/initramfs in focused OpenVMM hardware tests
  • build the runtime with the optimized fat-LTO, single-codegen-unit microvm-release profile
  • stage stripped Linux binaries with separate debug information
  • add topology-owned nr_cpus=<capacity> for fresh boots while retaining version-3 snapshot compatibility
  • emit the readiness marker before diagnostic banner bytes to reduce timed port-I/O exits
  • update runtime, benchmark, release, CI, and design documentation

Hardware validation

Bare-metal hosts:

  • KVM: prometheus32
  • MSHV: prometheus30
  • WHP: prometheus28

Passed on all three backends:

  • focused OpenVMM TTRPC lifecycle/SMP/snapshot integration test
  • complete nvx.py test-microvm scenario set
  • 1, 2, 4, and 8-vCPU SMP/APIC/LAPIC checks
  • scratch, filesystem, console, network, processor, memory, and core snapshot/restore checks
  • boot-layout version 3 validation

Performance acceptance

Each path used one warmup. KVM/WHP retained 30 interleaved samples per vCPU count; MSHV retained 60.

Backend vCPU Cold-start delta vs PVH Peak RSS delta vs PVH
KVM 1 -3.667 ms -2564 KiB
KVM 2 -0.974 ms -2504 KiB
KVM 4 -5.602 ms -2996 KiB
KVM 8 -7.019 ms -2696 KiB
MSHV 1 -2.878 ms -3374 KiB
MSHV 2 -4.436 ms -2632 KiB
MSHV 4 -4.474 ms -4590 KiB
MSHV 8 -0.634 ms -2788 KiB
WHP 1 -9.475 ms -1124 KiB
WHP 2 -7.900 ms -1114 KiB
WHP 4 -16.694 ms -3162 KiB
WHP 8 -9.510 ms -3046 KiB

All cold-start and peak-RSS gates pass without widening thresholds.

Local validation

  • NVX unit tests, Ruff, Linux/Windows Pyright, and formatting pass
  • affected OpenVMM unit suites and loader tests pass
  • package-scoped Clippy completes on Linux with only unrelated existing warnings
  • package rustdoc and cargo xtask fmt --fix pass
  • generated Flowey/GitHub workflows verify cleanly
  • final source audit finds no PVH loader/API/artifact or loader-specific RBX references

Complete the NVX side of the PVH replacement and pin the matching OpenVMM
implementation.

- disable CONFIG_PVH while retaining MP parsing, local APIC, IOAPIC, and
  virtio-mmio prerequisites
- replace Xen entry-note checks with the Linux MP-table boot contract
- pass the NVX ACPI-free kernel and initramfs into focused OpenVMM hardware
  tests so 1, 2, 4, and 8-vCPU coverage uses an MP-capable guest
- build OpenVMM with the fat-LTO single-codegen-unit microvm-release profile
  and stage stripped Linux binaries with separate debug information
- emit the readiness marker before diagnostic banner bytes to reduce timed
  port-I/O exits after all guest initialization work is complete
- update runtime, benchmark, release, CI, and validation terminology
- document the Linux direct boot layout, snapshot contract, build flow, and
  measured acceptance criteria

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 18, 2026 05:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

OpenVMM CI jobs do not fetch the newly required NVX guest artifacts and will fail before tests run.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity · 2 Medium severity · 5 Low severity

Open (8)
What changed in this PR

Replaces PVH boot with ACPI-free Linux direct boot using Intel MP tables and aligns NVX tooling, tests, kernel configuration, and documentation.

Changes:

  • Pins the OpenVMM direct-boot implementation and disables kernel PVH support.
  • Adds optimized runtime staging and uses NVX guest artifacts in OpenVMM tests.
  • Updates readiness output, snapshot terminology, and design documentation.
File Description
alpine/​init Emits readiness before diagnostics.
doc/​build.md Documents optimized builds and debug artifacts.
doc/​ci.md Updates CI test-layer documentation.
doc/​design/​code-ownership-map.md Revises loader and test ownership.
doc/​design/​cold-boot.md Documents direct MP-table boot.
doc/​design/​configuration-boundary.md Defines the new boot layout.
doc/​design/​current-limits.md Updates snapshot limitations.
doc/​design/​goals.md Revises platform goals and ABI terminology.
doc/​design/​integrated-implementation-status.md Records direct-boot implementation status.
doc/​design/​machine-and-device-abi.md Updates machine-contract diagrams.
doc/​design/​sandbox-filesystem-and-agent-architecture.md Replaces PVH terminology.
doc/​design/​snapshot-and-restore.md Updates memory-map and boot wording.
doc/​design/​validation.md Documents NVX-backed OpenVMM tests.
doc/​direct-boot-plan.md Adds the migration plan and acceptance criteria.
doc/​run.md Updates runtime and compatibility guidance.
kernel/​config-microvm Disables CONFIG_PVH.
openvmm Pins the direct-boot OpenVMM revision.
scripts/​nvx.py Builds and stages optimized OpenVMM binaries.
scripts/​nvx_tools/​benchmark.py Renames kernel artifact descriptions.
scripts/​nvx_tools/​build.py Validates direct-boot kernel prerequisites.
scripts/​nvx_tools/​ci.py Supplies NVX artifacts to OpenVMM tests.
scripts/​nvx_tools/​microvm_tests.py Updates kernel terminology.
scripts/​nvx_tools/​release.py Verifies direct-boot kernel settings.
scripts/​nvx_tools/​sandbox_lifecycle.py Updates kernel terminology.
scripts/​test_nvx_tools.py Updates build and CI unit tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/nvx_tools/ci.py
Comment on lines +61 to +65
kernel = require_file(
artifact_path("vmlinux"),
"microVM Linux direct kernel",
)
initrd = require_file(
Comment thread scripts/nvx.py
_native_initramfs()


def _install_openvmm_release(source: Path) -> None:
)


def _assert_direct_boot_kernel_config(path: Path) -> None:
Comment thread doc/build.md
build/initramfs.cpio.gz
build/initramfs.cpio.gz.packages.json
openvmm/target/release/openvmm[.exe]
openvmm/target/release/openvmm.dbg # Linux only
Comment thread doc/ci.md
Comment on lines +8 to 11
can execute concurrently. `openvmm-tests` uses OpenVMM's Linux-direct kernel
and initrd artifacts and exercises Linux MP-table lifecycle, TTRPC, and snapshot
contracts without restoring NVX guest artifacts. `nvx-microvm-tests` consumes
the NVX Linux kernel and Alpine initramfs and exercises Linux, SMP, virtio,
| Workload namespace and root construction | [`alpine/nvx-container-launch`](../../alpine/nvx-container-launch) and [`alpine/nvx-container-enter`](../../alpine/nvx-container-enter) |
| Guest workload, scratch quiesce, and post-restore CPU/RAM repair | [`alpine/nvx-snapshot`](../../alpine/nvx-snapshot) and [`alpine/nvx-init-agent`](../../alpine/nvx-init-agent) |
| Self-contained OpenVMM control-plane tests | [`guest_test_pvh`](../../openvmm/guest_test_pvh), [`vmm_tests/tests/tests/x86_64/microvm.rs`](../../openvmm/vmm_tests/vmm_tests/tests/tests/x86_64/microvm.rs), and [`vmm_tests/tests/tests/ttrpc.rs`](../../openvmm/vmm_tests/vmm_tests/tests/tests/ttrpc.rs) |
| Self-contained OpenVMM control-plane tests | [`vmm_tests/tests/tests/x86_64/microvm.rs`](../../openvmm/vmm_tests/vmm_tests/tests/tests/x86_64/microvm.rs) and [`vmm_tests/tests/tests/ttrpc.rs`](../../openvmm/vmm_tests/vmm_tests/tests/tests/ttrpc.rs) |
Comment thread doc/direct-boot-plan.md
- exposing no ACPI or SMBIOS data;
- using Intel MP 1.4 tables for processor and IOAPIC discovery;
- retaining fixed command-line virtio-mmio discovery and the allowlisted
microVM device model; and
Comment thread doc/direct-boot-plan.md
## 2. Extract shared MP-table construction

Move MP-table construction from
[`vm/loader/src/pvh.rs`](../openvmm/vm/loader/src/pvh.rs) into a protocol-neutral
@ppenna
Pedro Henrique Penna (ppenna) marked this pull request as ready for review September 18, 2026 13:10
Make OpenVMM hardware-test jobs depend on and download the shared NVX kernel and initramfs, add regression coverage for the workflow contract, and pin the clippy-clean OpenVMM head.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 18, 2026 14:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread scripts/nvx.py
Comment on lines +150 to +152
"build",
"--profile",
OPENVMM_MICROVM_RELEASE_PROFILE,
Comment thread doc/build.md
Comment on lines +19 to +22
`build-openvmm` uses the `microvm-release` profile: fat LTO with one codegen
unit. Linux builds retain separate debug information in `openvmm.dbg` and
stage a stripped runtime binary. Windows builds stage the linker-produced
executable and PDB.
Comment thread doc/direct-boot-plan.md
Comment on lines +228 to +232
all later command-line mutation and extraction sites that currently match only
- every microVM configuration requires `LoadMode::Linux` with `MpTable`;
- `LoadMode::Pvh` is removed from the configuration enum;
- the microVM command-line validator reads the `LoadMode::Linux` command line;
wire field is required when Linux-direct replaces PVH as the default. Update
Resolve the CI workflow conflict by retaining the shared guest-artifact handoff, align artifact downloads with v8, and make Windows curl retries effective through CURL_HOME configuration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 18, 2026 14:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread scripts/nvx_tools/ci.py
OPENVMM_MICROVM_TEST_FILTER = (
"test(openvmm_microvm_test_pvh_x64_phase_1_lifecycle) + "
"test(test_ttrpc_microvm_pvh_snapshot)"
"test(test_ttrpc_microvm_linux_direct_lifecycle_and_snapshot)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants