Commit graph

9351 commits

Author SHA1 Message Date
c5682801d6 virtio-devices: vsock: support half-closed host unix sockets
When the host-side unix socket peer does shutdown(SHUT_WR), read()
returns 0 on the stream. Previously this was treated as a full
connection closure, sending VSOCK_OP_SHUTDOWN with both SHUTDOWN_RCV
and SHUTDOWN_SEND flags and arming the kill timer. This prevented the
guest from sending any further data back through the still-writable
socket.

Change LocalClosed to carry a bool indicating whether receiving from
the guest is also shut down. On stream EOF, only set SHUTDOWN_SEND
(host won't send anymore) and transition to LocalClosed(false),
keeping the connection alive for guest-to-host data flow. The
connection fully closes when the guest also sends SHUTDOWN with
SHUTDOWN_SEND, or sends RST.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 23:34:11 +00:00
2f77d61b52 virtio-devices: allow getcwd, lseek, statx in net seccomp filter
When hotplugging a net device via ch-remote add-net with a tap FD,
the virtio-net queue pair threads trigger seccomp violations for
syscalls 332 (statx), 8 (lseek), and 79 (getcwd). These are issued
by glibc/Rust std during tap FD setup within the thread.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 22:12:10 +00:00
1e8f77fbda cli: allow --landlock without requiring a VM payload
The --landlock and --landlock-rules arguments were in the "vm-config"
argument group, which requires the "vm-payload" group (--kernel or
--firmware). This prevented using --landlock with API-socket-only mode,
where the VM is configured later via the REST API.

Remove these arguments from the "vm-config" group so that landlock
process hardening can be enabled independently of VM payload
configuration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 20:25:17 +00:00
7933f33fa9 virtio-devices: balloon: add Linux extended statistics tags
Add support for balloon stats tags 10-15, which are Linux kernel
extensions reporting VM memory pressure metrics: OOM kills, allocation
stalls, async/direct page scans, and async/direct page reclaims.

Also downgrade the balloon statistics API request log and the unknown
stats tag warning to debug level to reduce log noise.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 12:18:40 +00:00
6ce557ced8 virtio: add vhost-user sound device support
Add a vhost-user sound device to cloud-hypervisor, enabling audio
passthrough via an external vhost-user sound backend daemon.

The implementation mirrors the existing vhost-user GPU device. The
sound device uses 4 virtqueues (control, event, tx, rx) per the virtio
sound specification, and sets SCHED_FIFO priority 88 on its epoll
thread for low-latency audio processing.

Changes span the full stack:
- vm-virtio: Sound = 25 device type registration
- virtio-devices: Sound device implementation, seccomp filters,
  ActivateError variant
- vmm: SoundConfig, CLI --sound argument, OpenAPI spec, device manager
  wiring, seccomp filters updated for sched_setscheduler

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 10:05:30 +00:00
480bfb7095 virtio-devices: balloon: add statistics virtqueue support
Implement the virtio balloon statistics virtqueue per the VIRTIO spec,
exposing guest memory statistics through a new /vm.balloon-statistics
API endpoint.

Device layer: add stats virtqueue constants and types, wire up the
stats queue in the balloon handler, implement stats request/response
handlers, and expose a public request_balloon_statistics function.

VMM layer: plumb statistics through device manager, VM, and VMM,
add HTTP and D-Bus API endpoints, add ServiceUnavailable (503) to
api_client, add balloon-statistics subcommand to ch-remote, and add
the endpoint to the OpenAPI spec.

The response includes both guest-reported stats and host-known values
(balloon_actual_bytes, balloon_target_bytes, balloon_total_ram_bytes)
so consumers can understand balloon utilization without querying
/vm.info separately.

Also fixes pre-existing rustfmt issues and adds clippy+rustfmt to the
flake devShell.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 10:05:19 +00:00
04311414b6 virtio-devices: fix vhost-user GPU feature negotiation
The GPU frontend only offered transport-level features
(DEFAULT_VIRTIO_FEATURES) during vhost-user negotiation, causing all
GPU device feature bits (VIRGL, EDID, RESOURCE_BLOB, etc.) to be
zeroed out when intersected with the backend's features. The guest
driver never saw any GPU capabilities.

Add the virtio-gpu feature bit constants and include them in
avail_features, matching the pattern used by the blk and net frontends.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 18:26:18 +00:00
7e071e5c68 virtio-devices: Allow fcntl syscall in release builds
The fcntl syscall was only allowed for virtio device threads in debug
builds (behind #[cfg(debug_assertions)]), causing seccomp violations
in release builds across rng, balloon, net, gpu, fs, and vsock threads.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 11:15:32 +00:00
c22c15b963 virtio-devices: add vhost-user GPU device
Some checks failed
Cloud Hypervisor Tests (Metrics) / Tests (Metrics) (push) Has been cancelled
REUSE Compliance Check / REUSE Compliance Check (push) Has been cancelled
Shell scripts check / Check shell scripts (push) Has been cancelled
Add a vhost-user frontend for virtio-gpu using the current vhost-user
protocol (GET_SHMEM_CONFIG=44, SHMEM_MAP/UNMAP=9/10, SHMEM=0x0020_0000).

The GPU device queries the backend for shared memory regions via
get_shmem_config(), allocates a PCI BAR for the shmem region, and
implements a BackendReqHandler that handles SHMEM_MAP/UNMAP requests
by mmapping file descriptors from the backend into the shared memory
region.

To support non-contiguous shared memory region IDs (needed for
VIRTIO_GPU_SHM_ID_HOST_VISIBLE=1), VirtioSharedMemoryList.region_list
is changed from Vec<VirtioSharedMemory> to BTreeMap<u8, VirtioSharedMemory>,
and the PCI BAR code uses the map key as the PCI capability shmid.

Includes full VMM plumbing: GpuConfig, --gpu CLI, API, device_manager,
seccomp rules, and hotplug support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 17:46:55 +00:00
e3372a22f6 build: Switch vhost/vhost-user-backend to dsg fork
Some checks are pending
Cloud Hypervisor Tests (Metrics) / Tests (Metrics) (push) Waiting to run
REUSE Compliance Check / REUSE Compliance Check (push) Waiting to run
Shell scripts check / Check shell scripts (push) Waiting to run
Use vhost 0.15.0 and vhost-user-backend 0.21.0 from
https://git.dsg.is/dsg/vhost.git instead of crates.io.

This required bumping several rust-vmm dependencies to maintain
compatibility with the newer vm-memory 0.17.x and vmm-sys-util 0.15.x
APIs used by the fork:

- kvm-bindings: 0.12.1 → 0.14.0
- kvm-ioctls: 0.22.1 → 0.24.0 (nested_state renamed)
- linux-loader: 0.13.1 → 0.13.2
- vfio-bindings: 0.6.0 → 0.6.1
- vfio-ioctls: 0.5.1 → 0.5.2 (VfioDevice::new takes Arc<dyn VfioOps>)
- vfio_user: 0.1.1 → 0.1.2
- virtio-queue: 0.16.0 → 0.17.0
- vm-memory: 0.16.1 → 0.17.1 (Error split, Bytes trait, VolatileSlice)
- vmm-sys-util: 0.14.0 → 0.15.0 (EventConsumer/EventNotifier API)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 17:15:59 +00:00
Anatol Belski
e36096db3e vmm: openapi: Sync DiskConfig OpenAPI spec
Add backing_files and sparse fields to the REST API.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-19 19:09:03 +00:00
Anatol Belski
4d30ba12c8 block: qcow: Add test for BackingFilesDisabled error
Verify that opening a QCOW2 image with a backing file reference
through QcowDiskSync with backing_files=off produces the user-facing
BackingFilesDisabled error rather than MaxNestingDepthExceeded.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-19 13:48:40 +00:00
Anatol Belski
94368c622e block: Add BackingFilesDisabled error for actionable user guidance
When a QCOW2 image has a backing file but backing_files=on is not set,
the error was MaxNestingDepthExceeded which gives no indication that
this is a policy decision or how to resolve it.

Add a BackingFilesDisabled error variant whose message indicates that
backing file support is disabled and references the backing_files
option. The translation from MaxNestingDepthExceeded to
BackingFilesDisabled happens at the QcowDiskSync boundary where the
policy decision is made, preserving the original error for genuine
recursive depth exhaustion.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-19 13:48:40 +00:00
Anirudh Rayabharam
68f746fbea hypervisor: mshv: use the new default partition args function
The 0.6.7 version of the mshv crates introduced a new version of
make_default_partition_create_arg inside `struct Mshv`. This version
queries the available processor features on the host and gives the same
feature set to the guests.

Move Cloud Hypervisor to this new function.

Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
2026-02-18 13:58:08 +00:00
Rob Bradford
003ef780e0 build: Bump to latest igvm released version 0.4.0
Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-02-18 13:45:13 +00:00
Saravanan D
17b0749e1c tests: Fix Generic Initiator integration test
test_guest_numa_generic_initiator was missing the #[test] attribute and
did not match the VFIO CI filter pattern "vfio::test_nvidia"

Add #[test] and rename to test_nvidia_guest_numa_generic_initiator so
the existing CI infrastructure picks it up on the vfio-nvidia runner.

Fixes: #7718

Signed-off-by: Saravanan D <saravanand@crusoe.ai>
2026-02-18 11:13:07 +00:00
Saravanan D
924baa9c0f vmm: Forward device_id from NumaConfig to NumaNode
The device_id field was added to both NumaConfig and NumaNode as part
of the Generic Initiator support, but create_numa_nodes() change
was missed when the commits were reorganized.

As a result, node.device_id is never propogated from the config to
the runtime node and the ACPI SRAT Type 5 (Generic Initiator Affinity)
entries were never emitted.

Add the missing propogation so that create_srat_table() can resolve
the device and emit the correct affinity structure

Fixes: #7717

Signed-off-by: Saravanan D <saravanand@crusoe.ai>
2026-02-18 11:13:07 +00:00
Wei Liu
0a5e79afce vmm: api: Expose the nested option in API description
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2026-02-17 23:39:44 +00:00
dependabot[bot]
08f338bcf6 build: Bump the non-rust-vmm group across 2 directories with 27 updates
Bumps the non-rust-vmm group with 14 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [bitflags](https://github.com/bitflags/bitflags) | `2.10.0` | `2.11.0` |
| [clap](https://github.com/clap-rs/clap) | `4.5.57` | `4.5.59` |
| [env_logger](https://github.com/rust-cli/env_logger) | `0.11.8` | `0.11.9` |
| [libc](https://github.com/rust-lang/libc) | `0.2.181` | `0.2.182` |
| [uuid](https://github.com/uuid-rs/uuid) | `1.20.0` | `1.21.0` |
| [arc-swap](https://github.com/vorner/arc-swap) | `1.8.1` | `1.8.2` |
| [futures](https://github.com/rust-lang/futures-rs) | `0.3.31` | `0.3.32` |
| [async-executor](https://github.com/smol-rs/async-executor) | `1.13.3` | `1.14.0` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.55` | `1.2.56` |
| [jiff](https://github.com/BurntSushi/jiff) | `0.2.19` | `0.2.20` |
| [syn](https://github.com/dtolnay/syn) | `2.0.114` | `2.0.116` |
| [toml_parser](https://github.com/toml-rs/toml) | `1.0.6+spec-1.1.0` | `1.0.9+spec-1.1.0` |
| [unicode-ident](https://github.com/dtolnay/unicode-ident) | `1.0.23` | `1.0.24` |
| [zmij](https://github.com/dtolnay/zmij) | `1.0.20` | `1.0.21` |

Bumps the non-rust-vmm group with 13 updates in the /fuzz directory:

| Package | From | To |
| --- | --- | --- |
| [bitflags](https://github.com/bitflags/bitflags) | `2.10.0` | `2.11.0` |
| [clap](https://github.com/clap-rs/clap) | `4.5.57` | `4.5.59` |
| [libc](https://github.com/rust-lang/libc) | `0.2.181` | `0.2.182` |
| [uuid](https://github.com/uuid-rs/uuid) | `1.20.0` | `1.21.0` |
| [arc-swap](https://github.com/vorner/arc-swap) | `1.8.1` | `1.8.2` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.55` | `1.2.56` |
| [futures-core](https://github.com/rust-lang/futures-rs) | `0.3.31` | `0.3.32` |
| [futures-sink](https://github.com/rust-lang/futures-rs) | `0.3.31` | `0.3.32` |
| [syn](https://github.com/dtolnay/syn) | `2.0.114` | `2.0.116` |
| [toml_parser](https://github.com/toml-rs/toml) | `1.0.6+spec-1.1.0` | `1.0.9+spec-1.1.0` |
| [unicode-ident](https://github.com/dtolnay/unicode-ident) | `1.0.23` | `1.0.24` |
| [zmij](https://github.com/dtolnay/zmij) | `1.0.20` | `1.0.21` |
| [libfuzzer-sys](https://github.com/rust-fuzz/libfuzzer) | `0.4.10` | `0.4.12` |



Updates `bitflags` from 2.10.0 to 2.11.0
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.10.0...2.11.0)

Updates `clap` from 4.5.57 to 4.5.59
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.57...clap_complete-v4.5.59)

Updates `env_logger` from 0.11.8 to 0.11.9
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/v0.11.8...v0.11.9)

Updates `libc` from 0.2.181 to 0.2.182
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.182/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.181...0.2.182)

Updates `uuid` from 1.20.0 to 1.21.0
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/v1.20.0...v1.21.0)

Updates `arc-swap` from 1.8.1 to 1.8.2
- [Changelog](https://github.com/vorner/arc-swap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/arc-swap/compare/v1.8.1...v1.8.2)

Updates `futures` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `async-executor` from 1.13.3 to 1.14.0
- [Release notes](https://github.com/smol-rs/async-executor/releases)
- [Changelog](https://github.com/smol-rs/async-executor/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/async-executor/compare/v1.13.3...v1.14.0)

Updates `cc` from 1.2.55 to 1.2.56
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.55...cc-v1.2.56)

Updates `clap_builder` from 4.5.57 to 4.5.59
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.5.57...v4.5.59)

Updates `clap_lex` from 0.7.7 to 1.0.0
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_lex-v0.7.7...clap_lex-v1.0.0)

Updates `env_filter` from 0.1.4 to 1.0.0
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/env_filter-v0.1.4...env_filter-v1.0.0)

Updates `futures-channel` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-core` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-executor` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-io` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-macro` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-sink` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-task` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-util` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `jiff` from 0.2.19 to 0.2.20
- [Release notes](https://github.com/BurntSushi/jiff/releases)
- [Changelog](https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/jiff/compare/jiff-static-0.2.19...jiff-static-0.2.20)

Updates `jiff-static` from 0.2.19 to 0.2.20
- [Release notes](https://github.com/BurntSushi/jiff/releases)
- [Changelog](https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/jiff/compare/jiff-static-0.2.19...jiff-static-0.2.20)

Updates `syn` from 2.0.114 to 2.0.116
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.114...2.0.116)

Updates `toml_parser` from 1.0.6+spec-1.1.0 to 1.0.9+spec-1.1.0
- [Commits](https://github.com/toml-rs/toml/compare/toml_parser-v1.0.6...toml_parser-v1.0.9)

Updates `unicode-ident` from 1.0.23 to 1.0.24
- [Release notes](https://github.com/dtolnay/unicode-ident/releases)
- [Commits](https://github.com/dtolnay/unicode-ident/compare/1.0.23...1.0.24)

Updates `zmij` from 1.0.20 to 1.0.21
- [Release notes](https://github.com/dtolnay/zmij/releases)
- [Commits](https://github.com/dtolnay/zmij/compare/1.0.20...1.0.21)

Updates `bitflags` from 2.10.0 to 2.11.0
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.10.0...2.11.0)

Updates `clap` from 4.5.57 to 4.5.59
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.57...clap_complete-v4.5.59)

Updates `libc` from 0.2.181 to 0.2.182
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.182/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.181...0.2.182)

Updates `uuid` from 1.20.0 to 1.21.0
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/v1.20.0...v1.21.0)

Updates `arc-swap` from 1.8.1 to 1.8.2
- [Changelog](https://github.com/vorner/arc-swap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/arc-swap/compare/v1.8.1...v1.8.2)

Updates `cc` from 1.2.55 to 1.2.56
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.55...cc-v1.2.56)

Updates `clap_builder` from 4.5.57 to 4.5.59
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.5.57...v4.5.59)

Updates `clap_lex` from 0.7.7 to 1.0.0
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_lex-v0.7.7...clap_lex-v1.0.0)

Updates `futures-core` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-sink` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `syn` from 2.0.114 to 2.0.116
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.114...2.0.116)

Updates `toml_parser` from 1.0.6+spec-1.1.0 to 1.0.9+spec-1.1.0
- [Commits](https://github.com/toml-rs/toml/compare/toml_parser-v1.0.6...toml_parser-v1.0.9)

Updates `unicode-ident` from 1.0.23 to 1.0.24
- [Release notes](https://github.com/dtolnay/unicode-ident/releases)
- [Commits](https://github.com/dtolnay/unicode-ident/compare/1.0.23...1.0.24)

Updates `zmij` from 1.0.20 to 1.0.21
- [Release notes](https://github.com/dtolnay/zmij/releases)
- [Commits](https://github.com/dtolnay/zmij/compare/1.0.20...1.0.21)

Updates `libfuzzer-sys` from 0.4.10 to 0.4.12
- [Changelog](https://github.com/rust-fuzz/libfuzzer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-fuzz/libfuzzer/commits)

---
updated-dependencies:
- dependency-name: bitflags
  dependency-version: 2.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: clap
  dependency-version: 4.5.59
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: env_logger
  dependency-version: 0.11.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: libc
  dependency-version: 0.2.182
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: uuid
  dependency-version: 1.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: arc-swap
  dependency-version: 1.8.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures
  dependency-version: 0.3.32
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: async-executor
  dependency-version: 1.14.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: cc
  dependency-version: 1.2.56
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap_builder
  dependency-version: 4.5.59
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap_lex
  dependency-version: 1.0.0
  dependency-type: indirect
  update-type: version-update:semver-major
  dependency-group: non-rust-vmm
- dependency-name: env_filter
  dependency-version: 1.0.0
  dependency-type: indirect
  update-type: version-update:semver-major
  dependency-group: non-rust-vmm
- dependency-name: futures-channel
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-core
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-executor
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-io
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-macro
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-sink
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-task
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-util
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: jiff
  dependency-version: 0.2.20
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: jiff-static
  dependency-version: 0.2.20
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: syn
  dependency-version: 2.0.116
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: toml_parser
  dependency-version: 1.0.9+spec-1.1.0
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: unicode-ident
  dependency-version: 1.0.24
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: zmij
  dependency-version: 1.0.21
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: bitflags
  dependency-version: 2.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: clap
  dependency-version: 4.5.59
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: libc
  dependency-version: 0.2.182
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: uuid
  dependency-version: 1.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: arc-swap
  dependency-version: 1.8.2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: cc
  dependency-version: 1.2.56
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap_builder
  dependency-version: 4.5.59
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap_lex
  dependency-version: 1.0.0
  dependency-type: indirect
  update-type: version-update:semver-major
  dependency-group: non-rust-vmm
- dependency-name: futures-core
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-sink
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: syn
  dependency-version: 2.0.116
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: toml_parser
  dependency-version: 1.0.9+spec-1.1.0
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: unicode-ident
  dependency-version: 1.0.24
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: zmij
  dependency-version: 1.0.21
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: libfuzzer-sys
  dependency-version: 0.4.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 01:03:53 +00:00
dependabot[bot]
2a5c4f0e4d build: Bump crate-ci/typos from 1.43.4 to 1.43.5
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.43.4 to 1.43.5.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crate-ci/typos/compare/v1.43.4...v1.43.5)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-version: 1.43.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 00:49:30 +00:00
Rob Bradford
5dd5659440 build: Switch to released version of acpi_tables
Replace git version with latest released version from crates.io

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-02-16 22:07:52 +00:00
Anatol Belski
16d6a16e5c performance-metrics: Add standalone qcow2 perf tests
Add performance tests for standalone qcow2 images without backing
files - uncompressed, zlib and zstd compressed. Each variant
includes single queue and multiqueue tests for sequential
read, random read and warmed up sequential read.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-16 11:50:23 +00:00
Anatol Belski
333db1acb3 performance-metrics: Add multi-queue overlay block I/O tests
Add multiqueue num_queues=4 performance tests for qcow2 overlay
images with both qcow2 and raw backing files - sequential read,
random read, and warm read variants.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-16 11:50:23 +00:00
Anatol Belski
ecb971a491 performance-metrics: Add backing_files=on for overlay tests
The backing_files option defaults to false, so qcow2 overlay
tests fail with MaxNestingDepthExceeded. Pass backing_files=on
when the test file is an overlay.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-15 12:31:32 +00:00
Anatol Belski
20f5cadb6f scripts: Fix run_metrics.sh to use sha1sums common file
The focal image checksums have been moved in the -common
sha1sums file. Use the correct file for metrics.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-15 12:31:32 +00:00
Demi Marie Obenour
ce93686ad2 block: do not allow guest to not negotiate VIRTIO_BLK_F_RO
Unlike most virtio feature bits, VIRTIO_BLK_F_RO is not optional.
It indicates that the host is refusing to permit write operations, and
the guest must not be allowed to override it.

However, the block device currently does not enforce this.  If the guest
does not negotiate VIRTIO_BLK_F_RO, the block device will think the
device is writable and forward write requests to the backend.

This is not a security problem right now because the backing device of a
read-only device is always opened read-only.  The kernel will thus
reject the write operations with EBADF.  If support is added for
receiving the backing device file descriptor via SCM_RIGHTS (#7704),
it will be possible to have a read-only block device backed by a
writable file descriptor.  This would make the bug a genuine security
vulnerability.

Fix the bug by explicitly checking if VIRTIO_BLK_F_RO was offered but
not negotiated.  In this case, log a warning and proceed as if the guest
did acknowledge the feature.  This always indicates a guest driver bug.

Fixes: #7697
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-14 09:55:42 +00:00
Demi Marie Obenour
80ea1fe62d block: Allow (and ignore) FLUSH requests on read-only devices
OVMF sends FLUSH requests to read-only virtio-block devices.  Refusing
these requests prevents OVMF from accessing the EFI System Partition and
therefore makes VMs unable to boot.  Accept these requests instead.
them.

Ignoring these requests is possible, but inconsistent with fsync(2)
which honors them.

Fixes: #7698
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-14 09:54:46 +00:00
Muminul Islam
ff4c8f7480 hypervisor: mshv: handle Special Debug Print VMG exit
Add handling for GHCB_INFO_SPECIAL_DBGPRINT VMG exit in the SEV-SNP
guest exit handler. This exit occurs when the guest sends debug print
requests through the GHCB interface.

Without this handler, SEV-SNP guests fail to boot when debug output
is triggered, such as when a debugger is attached to the guest image.

The handler acknowledges the exit without printing to avoid performance
degradation from frequent debug print requests.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-13 22:22:00 +00:00
Leander Kohler
30c86d5999 vmm: fix --net fd helptext for list syntax
The --net help text documented fd as fd=<fd1,fd2...>, but
comma-separated FD lists in option values must be bracketed to avoid
top-level option splitting.

Update NetConfig::SYNTAX to use fd=<[fd1,fd2,...]>, matching parser
behavior and existing net parsing tests:
`cargo test -p vmm test_net_parsing`

On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
2026-02-13 20:58:30 +00:00
Leander Kohler
adfcd17bfc vmm: Include invalid UUID string in ParseUuid err
On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
2026-02-13 20:58:30 +00:00
Anatol Belski
8e51c57aea tests: Add integration tests for virtio-blk DISCARD operations
Add comprehensive integration tests for DISCARD and WRITE_ZEROES:

Multiqueue stress tests verify concurrent operations across queues,
testing scattered writes with simultaneous fstrim, and write/discard
races that stress refcount table locking.

Format specific tests verify QCOW2 deallocates clusters after DISCARD,
raw files create holes using fallocate, and unsupported formats VHD
and VHDX correctly reject DISCARD requests.

Tests for sparse=off verify raw files preallocate full disk size and
QCOW2 uses zero flag instead of deallocating clusters.

Add helper functions to verify sparse files, count QCOW2 zero flagged
regions using qemu-img map, and verify guest reads zeros from
discarded regions.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
4676fdb494 block: Add unit tests for DISCARD zero flag
Add comprehensive tests for DISCARD and WRITE_ZEROES operations:

QCOW2 zero flag test validates the complete workflow: allocate
cluster, DISCARD it, verify reads return zeros, write new data,
verify cluster reallocated.

QcowSync tests verify punch_hole and write_zeroes with Arc<Mutex<>>
sharing, including tests for cache consistency with multiple async
I/O operations.

RawFileSync tests verify punch_hole and write_zeroes using
fallocate.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
45b115aeb0 block: raw: Implement punch_hole and write_zeroes
Implement punch_hole() and write_zeroes() for raw file backends using
io_uring and fallocate.

punch_hole() uses FALLOC_FL_PUNCH_HOLE to deallocate storage.
write_zeroes() uses FALLOC_FL_ZERO_RANGE to write zeros efficiently.

Both use FALLOC_FL_KEEP_SIZE to maintain file size.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
6c94975c80 block: qcow: Implement punch_hole and write_zeroes for QcowSync
Implement punch_hole and write_zeroes for QcowSync backend by
delegating to QcowFile::punch_hole which triggers cluster
deallocation. write_zeroes delegates to punch_hole as unallocated
clusters read as zeros in QCOW2.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
81c075b317 block: Add virtio-blk DISCARD and WRITE_ZEROES support
Add VIRTIO_BLK_T_DISCARD and VIRTIO_BLK_T_WRITE_ZEROES request types.
Parse discard/write_zeroes descriptors (sector, num_sectors, flags),
convert to byte offsets, and call punch_hole/write_zeroes on the disk
backend. Mark as unsupported in sync mode.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
e913d0d9cb block: qcow: Implement DISCARD with sparse aware deallocation
Implement DISCARD using QCOW2 zero flag (bit 0 of L2 entries) with
sparse aware behavior.

When sparse=true - fully deallocate clusters by decrementing
refcount, clearing L2 entry, and reclaiming storage via punch_hole
when refcount reaches zero.

When sparse=false - use zero flag to keep storage allocated while
marking as reading zeros. Only works when cluster is not shared.
Shared clusters are fully deallocated.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
49a30cbbaf block: raw: Implement disk preallocation for sparse=false
When sparse=false is configured, preallocate the entire raw disk file
at startup using fallocate(). This provides space reservation and
reduces fragmentation.

Only applies to raw disks. QCOW2/VHD/VHDX formats manage their own
allocation.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
0a287793df block: qcow: Thread sparse configuration to QCOW2 constructors
Add sparse parameter to QcowFile constructors and propagate it from
device_manager through QcowDiskSync. This makes the sparse configuration
available throughout the QCOW2 implementation for controlling allocation
and deallocation behavior.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
46e6ecddfe block: Add supports_zero_flag trait method
Add supports_zero_flag() to DiskFile trait to indicate whether a disk
format can mark clusters/blocks as reading zeros without deallocating
storage.

QCOW2 supports this via the zero flag in L2 entries. VHDX also has
PAYLOAD_BLOCK_ZERO state for this, though it's not yet implemented in
cloud-hypervisor.

This enables DISCARD to be advertised even with sparse=false for formats
with zero-flag support, since they can mark regions as zeros (keeps
storage allocated) instead of requiring full deallocation.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
7dfcbff309 vmm: config: Add sparse flag to control disk space allocation
Add sparse boolean configuration option to DiskConfig with a default
value of true to control disk space allocation behavior.

When sparse is true, the disk uses sparse allocation where deallocated
blocks are returned to the filesystem, and the DISCARD feature is
advertised to the guest.

When sparse is false, disk space is kept fully allocated and DISCARD
is not advertised.

WRITE_ZEROES is always advertised when the backend supports it,
regardless of the sparse setting.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
7f4b56b217 block: Add sparse operations capability query
Add capability query to DiskFile trait to check backend
support for sparse operations (punch hole, write zeroes,
discard). Only advertise VIRTIO_BLK_F_DISCARD and
VIRTIO_BLK_F_WRITE_ZEROES when the backend supports these
operations.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
d5dad48618 block: Add sparse capability detection
Add functions to probe whether a file or block device actually
supports PUNCH_HOLE and ZERO_RANGE operations at runtime. The
probe is performed at file open time by testing the operations
at EOF with a zero-length range, which is a safe no-op.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
7095605d84 block: Add punch_hole and write_zeroes to AsyncIo trait
Add punch_hole() and write_zeroes() methods to the AsyncIo trait
with stub implementations for all backends. These will be used to
support DISCARD and WRITE_ZEROES operations.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Muminul Islam
41b23229a5 vmm: refactor VM initialization into modular helper methods
Decompose the monolithic `new_from_memory_manager` function into
smaller, focused helper methods to improve code readability,
maintainability, and testability.

Changes:
- Extract `should_force_iommu()` to determine IOMMU requirements for
  confidential computing (TDX/SEV-SNP)
- Extract `should_stop_on_boot()` to check debug pause configuration
- Extract `create_cpu_manager()` to encapsulate CPU manager creation
  and CPUID population
- Extract `init_tdx_if_enabled()` for TDX-specific VM initialization
- Extract `create_device_manager()` to encapsulate device manager setup
- Extract `hypervisor_specific_init()` to orchestrate initialization
  sequences for different hypervisors (KVM, MSHV, SEV-SNP)
- Extract `init_sev_snp()` for SEV-SNP confidential VM setup
- Extract `init_mshv()` for MSHV hypervisor initialization
- Extract `init_kvm()` for KVM hypervisor initialization
- Extract `create_fw_cfg_if_enabled()` for fw_cfg device creation

This refactoring replaces complex nested `cfg_if!` blocks with cleaner
conditional method calls, providing clear separation between hypervisor-
specific initialization paths while preserving existing functionality.

No functional changes intended.
Issue: https://github.com/cloud-hypervisor/cloud-hypervisor/issues/7598

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-13 10:18:50 +00:00
Philipp Schuster
03ef7d1991 vmm: remove lock for VmState
The lock doesn't make any sense. There is no shared ownership. All
accesses are already synchronized by accesses on a higher level.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
2026-02-13 09:46:13 +00:00
Saravanan D
9babad0114 ci: fix lychee link-checker failures
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 <saravanand@crusoe.ai>
2026-02-12 22:54:54 +00:00
Saravanan D
3af9ac78a9 docs: Document Generic Initiator NUMA support
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 <saravanand@crusoe.ai>
2026-02-12 22:54:54 +00:00
Saravanan D
18768e9bf8 tests: Add integration test for Generic Initiator
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 <saravanand@crusoe.ai>
2026-02-12 22:54:54 +00:00
Saravanan D
df67c3690e arch: Handle Generic Initiator in ARM64 FDT
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 <saravanand@crusoe.ai>
2026-02-12 22:54:54 +00:00
Saravanan D
dc0c306dd9 vmm: Add ACPI Generic Initiator support
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 <saravanand@crusoe.ai>
2026-02-12 22:54:54 +00:00