Skip to content

[1.7] openhcl_boot: handle multi numa private pool fallback (#3312)#3784

Open
mebersol wants to merge 1 commit into
microsoft:release/1.7.2511from
mebersol:user/mebersol/backport-3312-numa-pool-1.7
Open

[1.7] openhcl_boot: handle multi numa private pool fallback (#3312)#3784
mebersol wants to merge 1 commit into
microsoft:release/1.7.2511from
mebersol:user/mebersol/backport-3312-numa-pool-1.7

Conversation

@mebersol

Copy link
Copy Markdown
Collaborator

Pull request overview

This PR updates OpenHCL boot-time private pool allocation to support multi-NUMA systems by falling back to allocating the VTL2 GPA pool across NUMA nodes when a single-node allocation (node 0) can’t satisfy the request. It also introduces a command-line option to force NUMA-split behavior and adds VMM tests to exercise the multi-range pool behavior across boot and servicing.

Changes:

  • Add multi-NUMA private pool allocation logic with a “try node 0 first, else split” strategy.
  • Extend persisted-state handling to accept multiple VTL2 GPA pool ranges (instead of a single range).
  • Add new tests covering multi-NUMA pool split boot + servicing scenarios and add a new cmdline knob to force split mode.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
openhcl/openhcl_boot/src/host_params/dt/mod.rs Implements the multi-NUMA fallback allocation behavior for the VTL2 private pool and updates persisted-state pool-range handling.
openhcl/openhcl_boot/src/memory.rs Updates the address space builder to accept multiple existing pool ranges and adds unit tests around multi-range pool reservation/allocation behavior.
openhcl/openhcl_boot/src/cmdline.rs Adds parsing for OPENHCL_VTL2_GPA_POOL_NUMA=split to force NUMA-split pool allocation.
vmm_tests/vmm_tests/tests/tests/x86_64/openhcl_uefi.rs Adds a boot test that forces NUMA split and validates the VM reaches VTL2-ready and supports inspect.
vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs Adds a servicing test that forces NUMA split and validates servicing works with split pool configuration.

On some systems, there is not enough ram in numa node 0 to fufill the
private pool allocation request. Change the code to support falling back
to allocating the private pool across numa nodes if we cannot match the
old behavior. This also opens up the possibility of adding numa
awareness to dma_manager and drivers in the future.

Note that previous versions of openhcl_boot only support a single range
for the private pool, but those systems shouldn't have been able to boot
at all, so this change should be safe.

Add tests and openvmm test-only capabilities to report multiple numa ranges to the guest.
Copilot AI review requested due to automatic review settings June 19, 2026 18:45
@mebersol mebersol requested a review from a team as a code owner June 19, 2026 18:45
@github-actions github-actions Bot added the release_1.7.2511 Targets the release/1.7.2511 branch. label Jun 19, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Unsafe Code Detected

This PR modifies files containing unsafe Rust code. Extra scrutiny is required during review.

For more on why we check whole files, instead of just diffs, check out the Rustonomicon

@github-actions github-actions Bot added the unsafe Related to unsafe code label Jun 19, 2026

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.

Pull request overview

This PR extends OpenHCL’s boot-time VTL2 GPA private-pool allocation to work on multi-NUMA configurations by supporting split allocations across NUMA nodes, and threads that capability through OpenVMM/Petri configuration plus new VMM tests.

Changes:

  • Add “try NUMA node 0 first, else split across nodes (or force split)” logic for VTL2 GPA pool allocation during OpenHCL boot.
  • Add vNUMA-aware guest memory layout construction (per-node sizes) and plumb it through OpenVMM CLI + Petri.
  • Add/adjust VMM tests to exercise NUMA-split private pool behavior across boot and servicing boundaries.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
openhcl/openhcl_boot/src/host_params/dt/mod.rs Implements the NUMA-split fallback logic for VTL2 GPA pool allocation and persists/restores multiple pool ranges.
openhcl/openhcl_boot/src/memory.rs Updates address-space builder to accept multiple persisted pool ranges and adds unit tests for multi-range pool reservation/allocation.
openhcl/openhcl_boot/src/cmdline.rs Adds OPENHCL_VTL2_GPA_POOL_NUMA=split parsing to force split allocation mode.
vm/vmcore/vm_topology/src/memory.rs Adds a NUMA-distributed RAM layout builder plus unit tests for multi-node placement across MMIO gaps.
openvmm/openvmm_core/src/worker/dispatch.rs Switches to NUMA-aware memory layout when numa_mem_sizes is provided, validating totals.
openvmm/openvmm_defs/src/config.rs Extends VM memory config payload with optional per-NUMA-node memory sizes.
openvmm/openvmm_entry/src/cli_args.rs Adds --numa-memory (test-only) CLI to specify per-node RAM sizes.
openvmm/openvmm_entry/src/lib.rs Computes total memory from --numa-memory and populates numa_mem_sizes in config.
openvmm/openvmm_entry/src/ttrpc/mod.rs Initializes the new numa_mem_sizes field in the ttrpc config path.
petri/src/vm/mod.rs Adds numa_mem_sizes to Petri’s memory config (defaulting to None).
petri/src/vm/openvmm/construct.rs Plumbs numa_mem_sizes into OpenVMM config and derives mem_size from the sum when set.
vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs Adds a servicing test that forces split pool allocation on a multi-vNUMA memory config.
vmm_tests/vmm_tests/tests/tests/multiarch/memstat.rs Updates a struct literal to include the new numa_mem_sizes field.

Comment on lines +137 to +149
// If per-node-size is zero, we're in some strange configuration. We should
// have been able to allocate this from a single node, as this would mean
// the number of nodes is larger than the number of pages requested for the
// pool, so fail explicitly.
if per_node_size == 0 {
panic!(
"cannot split VTL2 pool of size {pool_size_bytes:#x} bytes across \
{num_nodes} nodes, per node size {per_node_size:#x} bytes; \
enable_vtl2_gpa_pool={enable_vtl2_gpa_pool:?}, \
device_dma_page_count={device_dma_page_count:#x?}, \
vp_count={vp_count}, mem_size={mem_size:#x}"
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_1.7.2511 Targets the release/1.7.2511 branch. unsafe Related to unsafe code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants