Repository navigation
Let the native-host backend boot on a host CPU profile - #422
Closed
Enrique Saurez (esaurez) wants to merge 1 commit into
Closed
Enrique Saurez (esaurez) wants to merge 1 commit into
Enrique Saurez (esaurez) wants to merge 1 commit into
Conversation
OpenVMM boots every microVM on a CPU profile, by default the built-in profile of the host's CPU generation. A host that no built-in profile serves, or whose hypervisor does not support its profile, therefore cannot start native sandboxes, while `nvx.py run --cpu-profile host` opts such development hosts in to a profile that OpenVMM derives from the host. NvxHostConfig::with_host_cpu_profile does the same for the native backend. It sets the native library's additive host-CPU-profile launch flag, which adds --cpu-profile host to the RAM-overlay launch; a library that predates the flag rejects it rather than ignoring it. The example takes --cpu-profile auto|host, and NVXHOST_TEST_CPU_PROFILE=host runs the guest tests on a host profile. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
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.
Stacked on #421. Lets the opt-in native-host backend boot on a host CPU profile.
Summary
nvx.py run --cpu-profile hostopts such development hosts in to a profile that OpenVMM derives from the host.NvxHostConfig::with_host_cpu_profile(true)does the same for the native backend. It sets the native library's additive host-CPU-profile launch flag (16), which adds--cpu-profile hostto the RAM-overlay launch. A library that predates the flag rejects it rather than ignoring it.--cpu-profile auto|host, andNVXHOST_TEST_CPU_PROFILE=hostruns the guest tests on a host profile. The README says when to use it, and that OpenVMM derives a host profile from the hypervisor at every cold boot and does not pin it.Dependencies
Validation
Each PR head in this stack passes
cargo test --all-featuresand Clippy with-D warningson all targets with--all-features, on Windows with Rust 1.93 (135, 137, 139, 139, and 140 unit tests).At the top of the stack (
5b0a315), on Windows and on Linux with Rust 1.93: the crate's CI checks, which are fmt, Clippy with--all-featuresand with--no-default-features, tests with--all-featuresand with default features, docs with-D warnings,cargo +1.89 check, and, on Linux, the macOS build check. The pinned library test passes against freshly builtnvxhost.dllandlibnvxhost.so.Guest suite at the top of the stack, 20 tests,
--release --test-threads=1, each checking that no OpenVMM process outlives its sandbox, withdev's Linux 6.18.38 kernel:amd.milan.v1serves: all pass, in about 100 s, and again with a host profile;OpenVMM's
--cpu-fingerprintreportsE_PROFILE_HOST_UNKNOWNon the AMD EPYC 9V74 MSHV host, so every cold boot with the default profile fails there; withNVXHOST_TEST_CPU_PROFILE=host, all 20 guest tests pass. On the WHP host, all 20 pass both ways.New unit tests cover the launch flags and the example's
--cpu-profileparser, and the pinned library test checks that the flag adds--cpu-profile host.Notes
E_PROFILE_UNSUPPORTED): the profile derives from a KVM fingerprint, and that hypervisor presents a different surface, such as its CPUID leaf range, the0x80000021bits, and the AVX-512 and CET XSAVE components. A host profile remains the way to run there.