Thanks to visit codestin.com
Credit goes to github.com

Skip to content

vmm: Add ACPI Generic Initiator support - #7626

Merged
rbradford merged 8 commits into
cloud-hypervisor:mainfrom
saravan2:generic-initiator
Feb 13, 2026
Merged

rbradford merged 8 commits into
cloud-hypervisor:mainfrom
saravan2:generic-initiator

Conversation

@saravan2

@saravan2 saravan2 commented Jan 22, 2026

Copy link
Copy Markdown
Member

Summary

Implements ACPI Generic Initiator Affinity (SRAT Type 5) support to associate VFIO-PCI devices with dedicated {memory,CPU}-less NUMA nodes. This feature enables the guest OS to make NUMA-aware memory allocation decisions for device workloads.

Changes

Configuration: device_id parameter to --numa for specifying VFIO devices

Parsing and Validation: Generic Initiator nodes have no CPUs or memory zones

ACPI : Generate SRAT Type 5 entries with PCI device handles

FDT (aarch64): Add Generic Initiator awareness

Distance handling: Implement automatic distance symmetry and defaults (self=10, remote=20)

Documentation: Update docs/memory.md

CI: Update link checker exclusion patterns

Tests

Unit tests

cargo test --features kvm -p vmm test_numa_config
cargo test --features kvm -p vmm test_generic_initiator
cargo test --features kvm -p arch test_fdt

Integration test

./scripts/dev_cli.sh tests --integration -- --hypervisor kvm --test-filter test_guest_numa_generic_initiator

@saravan2
saravan2 requested a review from a team as a code owner January 22, 2026 01:40
Comment thread arch/src/lib.rs
Comment thread docs/memory.md
@saravan2
saravan2 force-pushed the generic-initiator branch 6 times, most recently from 84d0b83 to 42bc2f3 Compare January 31, 2026 12:10
@saravan2

Copy link
Copy Markdown
Member Author

Added a new commit to update link checker exclusion patterns

@rbradford rbradford left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good thanks - just some minor changes.

@sboeuf You might want to take a look as you were involved in the original VFIO and NUMA bits.

Comment thread arch/src/aarch64/fdt.rs
Comment thread docs/memory.md
Comment thread docs/memory.md
Comment thread docs/memory.md
Comment thread vmm/src/vm_config.rs
Comment thread vmm/src/config.rs
Comment thread vmm/src/config.rs
@saravan2
saravan2 force-pushed the generic-initiator branch 2 times, most recently from 7c680e8 to 0a2536f Compare February 11, 2026 08:20
@saravan2

Copy link
Copy Markdown
Member Author

@sboeuf I addressed all of your suggestions. Can you review and confirm the resolution of the open threads ?

The documentation says guest_numa_id is required to be unique and
therefore the parser() giving default value for non-existing
guest_numa_id with .unwrap_or(0) is dangerous.

Return a validation error if guest_numa_id is not provided instead
of silently defaulting to 0.

Signed-off-by: Saravanan D <[email protected]>
Add an optional device_id string field to NumaConfig for identifying
PCI devices associated with a NUMA node. This is used by the Generic
Initiator support to map devices to their proximity domain.

Update OpenAPI spec (cloud-hypervisor.yaml) to include the
new device_id field in the NumaConfig schema.

The device_id is optional and parsed from the --numa parameter:
  --numa "device_id=<device_id>,distances=[...],..."

The optional field is accepted but not used.

Signed-off-by: Saravanan D <[email protected]>
Validate device_id in numa config is mutually
exclusive with cpus and memory_zones

Add NumaConfig::validate() and modify NumaConfig::parse()

Add ValidationError::InvalidNumaConfig for detailed error
messages

Include unit tests covering valid and invalid configs

Signed-off-by: Saravanan D <[email protected]>
Support ACPI Generic Initiator Affinity to associate
PCI devices with NUMA proximity domains

Add GenericInitiatorAffinity struct

Add from_pci_bdf() to encode PCI Segment:Bus:Device.Function

Add from_acpi_device() for ACPI device handles (future use)

Generate SRAT Type 5 entries for nodes with device_id

Improve create_slit_table() to check distance symmetry when
forward distance is missing

Track device ID to BDF mappings in DeviceManager

Includes comprehensive unit tests

Signed-off-by: Saravanan D <[email protected]>
Update FDT generation to skip NUMA properties when Generic Initiator
nodes are present, preventing conflicts between FDT and ACPI NUMA
information. FDT cannot represent Generic Initiator nodes, so ACPI
(via SRAT Type 5) becomes the authoritative source for the entire
NUMA topology when Generic Initiators exist.

Skip FDT numa-node-id properties in CPU and memory nodes
when Generic Initiator is present

Distance map bug fix : iterate over actual NUMA node IDs instead
of 0..len()

Use distance symmetry to derive distance when forward config is
missing

Default to distance cost 20 when neither direction specified

Only create memory nodes if NUMA node has memory region

Added unit tests

ARM64 boot protocol:
https://docs.kernel.org/arch/arm64/booting.html

Signed-off-by: Saravanan D <[email protected]>
Add test_guest_numa_generic_initiator to validate ACPI Generic
Initiator Affinity (SRAT Type 5) support for VFIO device.

The test verifies the following :
- Guest VM boots with a VFIO device associated with a {cpu,
  memort}-less NUMA node
- Guest Kernel correctly detects Generic Initiator through
  ACPI tables SRAT, SLIT
- NUMA topology in the guest includes the device-only node
with correct distances

Invoked via :
./scripts/dev_cli.sh tests --integration -- --hypervisor kvm \
--test-filter test_guest_numa_generic_initiator

The test requires a real VFIO device bound to vfio-pci driver and
skips gracefully if hardware is unavailable.

Signed-off-by: Saravanan D <[email protected]>
Document device_id parameter in NumaConfig, automatic
guest_numa_id assignment, default NUMA distances and
restrictions on Generoc Initiator NUMA nodes

Add numa configuration examples with GPU device and distance
relationships.

Signed-off-by: Saravanan D <[email protected]>
Update .lychee.toml to exclude the following patterns:
- ARM domains (developer.arm.com, infocenter.arm.com) which return 403
  Forbidden due to anti-bot protections in CI.
- Local TCP addresses (192.168.1.10) which are unsupported by the
  link-checker tool.
- The .lychee.toml file itself, to prevent the tool from recursively
  checking its own regex exclusion patterns as valid URLs.

Signed-off-by: Saravanan D <[email protected]>
@saravan2

Copy link
Copy Markdown
Member Author

Amended one of my existing commits 842b8dd to update OpenAPI spec (cloud-hypervisor.yaml) to include the new device_id field in the NumaConfig schema.

@rbradford
rbradford added this pull request to the merge queue Feb 12, 2026
Merged via the queue into cloud-hypervisor:main with commit 9babad0 Feb 13, 2026
43 checks passed
@saravan2
saravan2 deleted the generic-initiator branch February 13, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

7 participants