Commit Graph

10980 Commits

Author SHA1 Message Date
Alexander Lvov
4bb3e1ca04 block: vhd: switch to AsyncIoOperation::validate_bounds
Reuse global validate_bounds() operation helper instead of
having a local implementation in vhd/worker/common.rs

Signed-off-by: Alexander Lvov <alexander.lvov.git@gmail.com>
2026-07-07 09:56:20 +00:00
Alexander Lvov
73efde72b3 block: vhdx: extract dynamic_vhdx test helper into test_util
Extract the dynamic VHDX qemu-img helper into a shared vhdx::
test_util module to reuse inside the upcoming VhdxSync bounds-check.

Signed-off-by: Alexander Lvov <alexander.lvov.git@gmail.com>
2026-07-07 09:56:20 +00:00
Alexander Lvov
43c29096eb block: async_io: add AsyncIoOperation::validate_bounds
Implement global helper to validate vhd and vhdx sync workers'
I/O requests whose offset + length exceeds the virtual disk's
logical size.

Signed-off-by: Alexander Lvov <alexander.lvov.git@gmail.com>
2026-07-07 09:56:20 +00:00
Rob Bradford
854bd6bf65 devices: Fix clippy: unneeded late initialization
```
warning: unneeded late initialization
   --> devices/src/legacy/gpio_pl061.rs:258:9
    |
258 |         let value;
    |         ^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
    = note: `-D clippy::needless-late-init` implied by `-D clippy::all`
```

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-07 08:31:22 +00:00
Rob Bradford
52f5d5fc9a pci: Fix clippy: use mem::take instead of drain().collect()
```
warning: you seem to be trying to move all elements into a new `Vec`
   --> pci/src/configuration.rs:951:24
    |
951 |                 return self.pending_bar_reprogram.drain(..).collect();
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `mem::take` to avoid creating a new allocation: `std::mem::take(&mut self.pending_bar_reprogram)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#drain_collect
    = note: `-D clippy::drain-collect` implied by `-D clippy::all`
```

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-07 08:31:22 +00:00
Rob Bradford
308033de40 block: Fix clippy: unused import
```
warning: unused import: `Bytes`
   --> block/src/io/request.rs:659:21
    |
659 |     use vm_memory::{Bytes as _, GuestMemoryMmap};
    |                     ^^^^^^^^^
    |
    = note: `-D unused-imports` implied by `-D warnings`
```

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-07 08:31:22 +00:00
Rob Bradford
f5468a6dae block: Fix clippy: chunks_exact with constant chunk size
```
warning: using `chunks_exact` with a constant chunk size
   --> block/src/formats/qcow/internal/header.rs:253:39
    |
253 |                     for entry in data.chunks_exact(FEATURE_NAME_ENTRY_SIZE) {
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `as_chunks` instead
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D clippy::all`
```

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-07 08:31:22 +00:00
Wei Liu
2a3512fb71 docs: update SEV-SNP build information
sev_snp no longer selects a hypervisor backend implicitly.

Assisted-by: Copilot:GPT-5.5
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2026-07-06 23:29:52 +00:00
Wei Liu
47e88d26e5 build: decouple igvm and sev_snp from mshv
igvm and sev_snp only need the MSHV backend when a caller selects that
backend. Stop enabling mshv implicitly from those top-level features so
KVM SEV-SNP builds do not compile unused MSHV backend code.

Require igvm and sev_snp to be built with kvm or mshv. Backend-less
configurations having no runtime hypervisor are not supported.

Assisted-by: Copilot:GPT-5.5
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2026-07-06 23:29:52 +00:00
Wei Liu
8f38928757 ci: cover explicit igvm sev_snp backends
Decoupling removes the old implicit MSHV coverage from standalone igvm
and sev_snp jobs. Replace those jobs with explicit KVM feature sets and
add MSHV igvm and sev_snp build and clippy jobs so both backends remain
covered.

This keeps the previous implicit combinations tested while making the
selected backend visible in CI.

Assisted-by: Copilot:GPT-5.5
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2026-07-06 23:29:52 +00:00
Wei Liu
d71ef33b83 vmm: decouple igvm loader from mshv
IGVM no longer implies the MSHV backend at the feature layer. Gate the
loader paths that use MSHV page types, MSHV SNP launch defaults, or
MSHV-specific CPUID page rewriting on the MSHV feature.

This preserves existing MSHV behavior while letting KVM SEV-SNP use the
shared IGVM loader without compiling the full MSHV backend.

Assisted-by: Copilot:GPT-5.5
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2026-07-06 23:29:52 +00:00
Sayed Kaif
6882276e2d block: vhdx: reject overflowing region table entries
The region table overlap fix in RegionInfo::new computes each entry's
end offset as `file_offset + length`. Both values are taken verbatim
from the image, so a crafted or corrupt VHDX can set a file offset near
u64::MAX and make that addition wrap. A wrapped end offset compares as a
small value, which can slip a genuinely overlapping region past the
half-open interval check that #8483 added.

Use checked_add for the end offset and return a new RegionEntryOverflow
error when it wraps, so a malformed entry is rejected instead of being
folded into a valid-looking range. The computed end is now reused for
the region_entries map so the bound is only calculated once. Add a
regression test for a wrapping entry.

Signed-off-by: Sayed Kaif <metsw24@gmail.com>
2026-07-06 22:50:24 +00:00
Rob Bradford
4b120c3702 virtio-devices: Gate VIRTIO_NET_S_ANNOUNCE on feature acked
Only set the VIRTIO_NET_S_ANNOUNCE status bit if the feature
VIRTIO_NET_F_GUEST_ANNOUNCE was acknowledged.

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-06 18:46:56 +00:00
Rob Bradford
9161b18f9b virtio-devices: iommu: Translate buffers spanning adjacent mappings
The virtio-iommu translation required the whole [addr, addr+size) span
to be covered by a single mapping. A guest is free to describe one
contiguous buffer with several adjacent mappings: the specification lets
the driver map at page granularity and the Linux IOMMU core splits a
single mapping request at page size boundaries. A descriptor buffer
backed this way was rejected as an invalid translation even though every
page was mapped, wedging the device.

Walk consecutive mappings when no single one covers the span, accepting
the translation once the mappings are adjacent in IOVA space and
contiguous in guest-physical space. A non-contiguous span cannot be
represented by the single returned address and is still rejected.

Assisted-by: Claude:Opus-4.8
Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-06 18:35:11 +00:00
Anirudh Rayabharam
0b150ea560 tests: add integration test for PPTT cache topology
Add an integration test to verify the newly added code to expose
cache topology information in PPTT.

Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
2026-07-06 16:31:21 +00:00
Anirudh Rayabharam
ec73733b21 vmm: add cache topology info to ACPI PPTT
Read the host cache info from sysfs and pass through the same to the
guest via the PPTT table. This is the same as the approach taken for
FDT. Similar to that, assume that the L3 cache is always shared and the
L2 cache is unique per CPU.

Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
2026-07-06 16:31:21 +00:00
Anirudh Rayabharam
9446dad1d0 arch: aarch64: extract cache topology collection into a helper
Both arch/src/aarch64/fdt.rs and vmm/src/cpu.rs declared the same
~14 cache info locals (size/line_size/sets for L1D/L1I/L2/L3, plus
shared flags for L2/L3), checked for /sys/devices/system/cpu/cpu0/cache,
and populated those locals via get_cache_size /
get_cache_coherency_line_size / get_cache_number_of_sets /
get_cache_shared. Two near-identical ~30-line blocks.

Add a CacheTopologyInfo struct in arch/src/aarch64/cache.rs whose
field names mirror the existing locals, plus a read_cache_topology()
helper that returns None when the sysfs hierarchy is missing and
only queries get_cache_shared for L2/L3 when their size is non-zero
(preserving current behavior).

Both call sites now obtain the info via read_cache_topology() and
destructure it back into locals of the same name, so all downstream
references are unchanged.

Assisted-by: Copilot-CLI:Claude-Opus-4.7
Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
2026-07-06 16:31:21 +00:00
Anirudh Rayabharam
c30732c9c1 arch: use bit-shift expressions for cache size units
Replace 1024, 1024u32.pow(2), and 1024u32.pow(3) with 1u32 << 10,
1u32 << 20, and 1u32 << 30 in get_cache_size. The shift form makes
the binary (KiB/MiB/GiB) nature of the conversion immediately
obvious and is easier to read at a glance.

Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
2026-07-06 16:31:21 +00:00
Anirudh Rayabharam
2bb02d51ed arch: aarch64: move cache helpers to a new file
fdt.rs has helper functions to query host cache details (topology, size
etc.). Extract these helpers to a new file cache.rs so that they can be
used for PPTT construction as well.

No functional change.

Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
2026-07-06 16:31:21 +00:00
Anirudh Rayabharam
f5089c705b vmm: use acpi_tables helpers for PPTT
Use the helpers from the acpi_tables crate to construct the PPTT. This
is in preparation for adding cache hierarchy info to the PPTT which is
simpler using the helpers.

Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
2026-07-06 16:31:21 +00:00
doge
3d5f06ff03 vmm: acpi: provide FADT PM1a event/control blocks for nested Hyper-V
A Windows guest that launches nested Hyper-V (for example to run WSL2)
fails to start its hypervisor on cloud-hypervisor's HW-reduced-ACPI
FADT. hvloader's hypervisor-launch path (0x18000f01c -> 0x180015628 ->
0x180015788) registers every legacy PM register block via 0x1800158dc
and rejects any block whose GAS address is 0 with status 8
(STATUS_INVALID_DEVICE_REQUEST). hvix64 then never launches and
HypervisorPresent stays False. The HW-reduced FADT leaves those blocks
zero.

Emit valid PM1a event/control blocks (I/O ports, lengths and X_GAS) in
the FADT and reserve those ports in the I/O allocator so nothing else
claims them. The HW-reduced guest OS ignores the legacy ports; only
hvloader's ACPI validation reads them.

These blocks are only useful to a guest that itself runs an enlightened
hypervisor, so emit them only when both guest nesting and the Hyper-V
enlightenments are enabled (--cpu nested=on,kvm_hyperv=on).

Signed-off-by: doge <me@crackerben.com>
2026-07-06 14:42:11 +00:00
Gauthier Jolly
5b3416adf4 ci: Add riscv64 cross-build check
The previous CI (removed in #7760) built natively inside a riscv64 QEMU
VM over SSH on a self-hosted host. That setup was disabled for chronic
infrastructure flakiness (#7758).

Reintroduce coverage deliberately minimal: cross-compile the
cloud-hypervisor binary on a stock ubuntu-latest runner, and nothing
more.

- No integration tests: no riscv64 hardware needed.
- No clippy: cross clippy with -D warnings currently trips on
  riscv64-gated lints that need a separate cleanup commit first.

Cross-compiling needs only a riscv64 linker, not Docker/cross: the
binary does not pull openssl-sys (that arrives via a dev-dependency of
test_infra, unused by -p cloud-hypervisor), so no cross sysroot is
required.

Signed-off-by: Gauthier Jolly <contact@gjolly.fr>
2026-07-06 14:41:40 +00:00
Anatol Belski
67095b0da1 block: Drop the AlignedFile Read, Write, and Seek impls
Nothing reads or writes the AlignedFile through a cursor anymore, so
remove the Read, Write, and Seek impls together with the in memory
position field. SeekHole no longer tracks a position. The cursor unit
tests move to read_at and write_at, dropping the one that duplicated
existing coverage.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-06 14:41:08 +00:00
Anatol Belski
4596c502fb vhost_user_block: Query the disk size instead of seeking
The disk size in sectors was computed by seeking the AlignedFile to the
end. Use query_device_size instead, which also handles block devices,
and drop the now unused Seek and SeekFrom imports.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-06 14:41:08 +00:00
Anatol Belski
15b59fdd9f block: Execute synchronous block requests positionally
Request::execute seeked the disk to the request sector and then read or
wrote sequentially through the cursor. Walk a running offset with
read_exact_at and write_all_at instead, and flush with fsync, so the
bound becomes FileExt and FileSync rather than Seek, Read, and Write.

The seek step is gone, so drop the now unused ExecuteError::Seek.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-06 14:41:08 +00:00
Anatol Belski
06cad2cdcd block: Detect the image type positionally
detect_image_type read the first block through the AlignedFile Read
cursor. Read it with read_exact_at at offset 0 instead, so image type
detection no longer depends on the cursor.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-06 14:41:08 +00:00
Anatol Belski
26080f264a block: vhd: Read the VHD footer positionally
Read the trailing footer sector with query_device_size and
read_exact_at instead of seeking to the end of the AlignedFile and
reading through its cursor.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-06 14:41:08 +00:00
Gauthier Jolly
c257cdd695 vmm: Gate tpm import for riscv64
The `tpm` module in the `devices` crate is disabled on riscv64 (see
commit 0042447fb "devices: Disable tpm module for riscv64"), and every
use of `tpm` in the device manager is already gated behind
`#[cfg(not(target_arch = "riscv64"))]`. However, the import itself was
merged into the unconditional `use devices::{...}` line in commit
025e782e5 "vmm: trim qualified paths", which broke the riscv64 build:

    error[E0432]: unresolved import `devices::tpm`
      --> vmm/src/device_manager.rs:70:83

Split the `tpm` import out into its own line gated with
`#[cfg(not(target_arch = "riscv64"))]`, matching all of its usages.

Signed-off-by: Gauthier Jolly <contact@gjolly.fr>
2026-07-06 07:24:56 +00:00
Wei Liu
de4ff39f4d pci: align VFIO MMIO mmap to a huge page boundary
mmap(NULL, ...) only guarantees page-sized alignment, so the device
MMIO regions mapped for VFIO passthrough were not necessarily aligned
on a huge page boundary and thus could not take fast paths in the
kernel.

Align the address to the largest possible size. This allows VFIO to take
fast paths when walking the page table.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
Assisted-by: Copilot:Opus-4.8
Assisted-by: Copilot:GPT-5.5
2026-07-05 17:08:50 +00:00
Rob Bradford
14481800e3 build: Only run MSHV integration tests on MQ
There is a single runner for this so avoid overloading/queueing by
running only on MQ.

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-04 18:42:59 +00:00
Anatol Belski
cbef28e5cd ci: Switch to Windows Server 25H2 for AARCH64
The updated image is configured in a same way as before

SSH and RDP are enabled.

Includes latest stable virtio-win 0.1.285 drivers.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-04 18:42:06 +00:00
Anatol Belski
899c2df248 block: qcow: Make the qcow image compressor test positional
Convert the qcow image compressor test helper to positional access
instead of the cursor. Test only change.

Assisted-by: Claude:Opus-4.8
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-03 20:29:52 +00:00
Anatol Belski
6be2a52d14 block: qcow: Make the qcow sync worker tests positional
Convert the qcow sync worker test helpers to positional access instead
of the cursor. Test only change.

Assisted-by: Claude:Opus-4.8
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-03 20:29:52 +00:00
Anatol Belski
62bdf2b209 block: qcow: Make the qcow header tests positional
Convert the qcow header test helpers to positional access instead of
the AlignedFile cursor. Test only change.

Assisted-by: Claude:Opus-4.8
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-03 20:29:52 +00:00
Anatol Belski
8c068fce5e block: qcow: Make the qcow raw file tests positional
Convert the QcowRawFile unit test verifications to positional access
instead of the cursor. Test only change.

Assisted-by: Claude:Opus-4.8
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-03 20:29:52 +00:00
Anatol Belski
aa4eb943f3 block: qcow: Access the qcow header feature bits positionally
Convert the qcow header feature bit writes to positional access and
drop the now unused Seek imports. The result is unchanged.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-03 20:29:52 +00:00
Anatol Belski
43682e22b0 block: qcow: Access the qcow header positionally
Convert the qcow header reader and writer to positional access instead
of the AlignedFile Read, Write, and Seek cursor. The writes still go
through the AlignedFile O_DIRECT bounce, so alignment is unchanged.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-03 20:29:52 +00:00
Adel-Ayoub
4abdb3419b block: Make the sparse-file size test portable across filesystems
zfs and virtiofs do not eagerly account a mode-0 fallocate() in
st_blocks, so detect those filesystems with fstatfs() and skip the
physical-size assertions there. A skip now names a proven platform
limitation instead of being inferred from the value under test, and
every assertion still runs unconditionally on ext4/xfs.

Fixes #8296

Signed-off-by: Adel-Ayoub <adelayoub.maaziz@gmail.com>
2026-07-03 16:27:55 +00:00
Sebastian Eydam
4ac2340c1f virtio-devices: net: offer VIRTIO_NET_F_GUEST_ANNOUNCE to guests
The virtio-net guest announce feature bit was accidentally dropped
during upstreaming, so the device never advertised it to guests. Restore
the feature offer for virtio-net.

On-behalf-of: SAP sebastian.eydam@sap.com
Signed-off-by: Sebastian Eydam <sebastian.eydam@cyberus-technology.de>
2026-07-03 13:47:11 +00:00
dependabot[bot]
629151481b build(deps): bump the non-rust-vmm group across 2 directories with 18 updates
Bumps the non-rust-vmm group with 12 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.102` | `1.0.103` |
| [env_logger](https://github.com/rust-cli/env_logger) | `0.11.10` | `0.11.11` |
| [jiff](https://github.com/BurntSushi/jiff) | `0.2.29` | `0.2.31` |
| [uuid](https://github.com/uuid-rs/uuid) | `1.23.3` | `1.23.4` |
| [crc-any](https://github.com/magiclen/crc-any) | `2.5.0` | `2.5.1` |
| [io-uring](https://github.com/tokio-rs/io-uring) | `0.7.12` | `0.7.13` |
| [arc-swap](https://github.com/vorner/arc-swap) | `1.9.1` | `1.9.2` |
| [chacha20](https://github.com/RustCrypto/stream-ciphers) | `0.10.0` | `0.10.1` |
| [debug-helper](https://github.com/magiclen/debug-helper) | `0.3.13` | `0.3.14` |
| [hashbrown](https://github.com/rust-lang/hashbrown) | `0.17.0` | `0.17.1` |
| [hybrid-array](https://github.com/RustCrypto/hybrid-array) | `0.4.12` | `0.4.13` |
| [js-sys](https://github.com/wasm-bindgen/wasm-bindgen) | `0.3.102` | `0.3.103` |

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

| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.102` | `1.0.103` |
| [uuid](https://github.com/uuid-rs/uuid) | `1.23.3` | `1.23.4` |
| [crc-any](https://github.com/magiclen/crc-any) | `2.5.0` | `2.5.1` |
| [arc-swap](https://github.com/vorner/arc-swap) | `1.9.1` | `1.9.2` |
| [chacha20](https://github.com/RustCrypto/stream-ciphers) | `0.10.0` | `0.10.1` |
| [debug-helper](https://github.com/magiclen/debug-helper) | `0.3.13` | `0.3.14` |
| [hybrid-array](https://github.com/RustCrypto/hybrid-array) | `0.4.12` | `0.4.13` |
| [js-sys](https://github.com/wasm-bindgen/wasm-bindgen) | `0.3.102` | `0.3.103` |



Updates `anyhow` from 1.0.102 to 1.0.103
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.102...1.0.103)

Updates `env_logger` from 0.11.10 to 0.11.11
- [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.10...v0.11.11)

Updates `jiff` from 0.2.29 to 0.2.31
- [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.29...jiff-static-0.2.31)

Updates `uuid` from 1.23.3 to 1.23.4
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/v1.23.3...v1.23.4)

Updates `crc-any` from 2.5.0 to 2.5.1
- [Commits](https://github.com/magiclen/crc-any/compare/v2.5.0...v2.5.1)

Updates `io-uring` from 0.7.12 to 0.7.13
- [Commits](https://github.com/tokio-rs/io-uring/compare/v0.7.12...v0.7.13)

Updates `arc-swap` from 1.9.1 to 1.9.2
- [Changelog](https://github.com/vorner/arc-swap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/arc-swap/commits)

Updates `chacha20` from 0.10.0 to 0.10.1
- [Commits](https://github.com/RustCrypto/stream-ciphers/compare/chacha20-v0.10.0...chacha20-v0.10.1)

Updates `debug-helper` from 0.3.13 to 0.3.14
- [Commits](https://github.com/magiclen/debug-helper/compare/v0.3.13...v0.3.14)

Updates `env_filter` from 1.0.1 to 2.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-v1.0.1...env_filter-v2.0.0)

Updates `hashbrown` from 0.17.0 to 0.17.1
- [Release notes](https://github.com/rust-lang/hashbrown/releases)
- [Changelog](https://github.com/rust-lang/hashbrown/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/hashbrown/compare/v0.17.0...v0.17.1)

Updates `hybrid-array` from 0.4.12 to 0.4.13
- [Changelog](https://github.com/RustCrypto/hybrid-array/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RustCrypto/hybrid-array/compare/v0.4.12...v0.4.13)

Updates `jiff-static` from 0.2.29 to 0.2.31
- [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.29...jiff-static-0.2.31)

Updates `js-sys` from 0.3.102 to 0.3.103
- [Release notes](https://github.com/wasm-bindgen/wasm-bindgen/releases)
- [Changelog](https://github.com/wasm-bindgen/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wasm-bindgen/wasm-bindgen/commits)

Updates `wasm-bindgen` from 0.2.125 to 0.2.126
- [Release notes](https://github.com/wasm-bindgen/wasm-bindgen/releases)
- [Changelog](https://github.com/wasm-bindgen/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wasm-bindgen/wasm-bindgen/compare/0.2.125...0.2.126)

Updates `wasm-bindgen-macro` from 0.2.125 to 0.2.126
- [Release notes](https://github.com/wasm-bindgen/wasm-bindgen/releases)
- [Changelog](https://github.com/wasm-bindgen/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wasm-bindgen/wasm-bindgen/compare/0.2.125...0.2.126)

Updates `wasm-bindgen-macro-support` from 0.2.125 to 0.2.126
- [Release notes](https://github.com/wasm-bindgen/wasm-bindgen/releases)
- [Changelog](https://github.com/wasm-bindgen/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wasm-bindgen/wasm-bindgen/compare/0.2.125...0.2.126)

Updates `wasm-bindgen-shared` from 0.2.125 to 0.2.126
- [Release notes](https://github.com/wasm-bindgen/wasm-bindgen/releases)
- [Changelog](https://github.com/wasm-bindgen/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wasm-bindgen/wasm-bindgen/compare/0.2.125...0.2.126)

Updates `anyhow` from 1.0.102 to 1.0.103
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.102...1.0.103)

Updates `uuid` from 1.23.3 to 1.23.4
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/v1.23.3...v1.23.4)

Updates `crc-any` from 2.5.0 to 2.5.1
- [Commits](https://github.com/magiclen/crc-any/compare/v2.5.0...v2.5.1)

Updates `arc-swap` from 1.9.1 to 1.9.2
- [Changelog](https://github.com/vorner/arc-swap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/arc-swap/commits)

Updates `chacha20` from 0.10.0 to 0.10.1
- [Commits](https://github.com/RustCrypto/stream-ciphers/compare/chacha20-v0.10.0...chacha20-v0.10.1)

Updates `debug-helper` from 0.3.13 to 0.3.14
- [Commits](https://github.com/magiclen/debug-helper/compare/v0.3.13...v0.3.14)

Updates `hybrid-array` from 0.4.12 to 0.4.13
- [Changelog](https://github.com/RustCrypto/hybrid-array/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RustCrypto/hybrid-array/compare/v0.4.12...v0.4.13)

Updates `js-sys` from 0.3.102 to 0.3.103
- [Release notes](https://github.com/wasm-bindgen/wasm-bindgen/releases)
- [Changelog](https://github.com/wasm-bindgen/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wasm-bindgen/wasm-bindgen/commits)

Updates `wasm-bindgen` from 0.2.125 to 0.2.126
- [Release notes](https://github.com/wasm-bindgen/wasm-bindgen/releases)
- [Changelog](https://github.com/wasm-bindgen/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wasm-bindgen/wasm-bindgen/compare/0.2.125...0.2.126)

Updates `wasm-bindgen-macro` from 0.2.125 to 0.2.126
- [Release notes](https://github.com/wasm-bindgen/wasm-bindgen/releases)
- [Changelog](https://github.com/wasm-bindgen/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wasm-bindgen/wasm-bindgen/compare/0.2.125...0.2.126)

Updates `wasm-bindgen-macro-support` from 0.2.125 to 0.2.126
- [Release notes](https://github.com/wasm-bindgen/wasm-bindgen/releases)
- [Changelog](https://github.com/wasm-bindgen/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wasm-bindgen/wasm-bindgen/compare/0.2.125...0.2.126)

Updates `wasm-bindgen-shared` from 0.2.125 to 0.2.126
- [Release notes](https://github.com/wasm-bindgen/wasm-bindgen/releases)
- [Changelog](https://github.com/wasm-bindgen/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wasm-bindgen/wasm-bindgen/compare/0.2.125...0.2.126)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-version: 1.0.103
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: env_logger
  dependency-version: 0.11.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: jiff
  dependency-version: 0.2.31
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: uuid
  dependency-version: 1.23.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: crc-any
  dependency-version: 2.5.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: io-uring
  dependency-version: 0.7.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: arc-swap
  dependency-version: 1.9.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: chacha20
  dependency-version: 0.10.1
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: debug-helper
  dependency-version: 0.3.14
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: env_filter
  dependency-version: 2.0.0
  dependency-type: indirect
  update-type: version-update:semver-major
  dependency-group: non-rust-vmm
- dependency-name: hashbrown
  dependency-version: 0.17.1
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: hybrid-array
  dependency-version: 0.4.13
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: jiff-static
  dependency-version: 0.2.31
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: js-sys
  dependency-version: 0.3.103
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: wasm-bindgen
  dependency-version: 0.2.126
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: wasm-bindgen-macro
  dependency-version: 0.2.126
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: wasm-bindgen-macro-support
  dependency-version: 0.2.126
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: wasm-bindgen-shared
  dependency-version: 0.2.126
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: anyhow
  dependency-version: 1.0.103
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: uuid
  dependency-version: 1.23.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: crc-any
  dependency-version: 2.5.1
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: arc-swap
  dependency-version: 1.9.2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: chacha20
  dependency-version: 0.10.1
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: debug-helper
  dependency-version: 0.3.14
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: hybrid-array
  dependency-version: 0.4.13
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: js-sys
  dependency-version: 0.3.103
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: wasm-bindgen
  dependency-version: 0.2.126
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: wasm-bindgen-macro
  dependency-version: 0.2.126
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: wasm-bindgen-macro-support
  dependency-version: 0.2.126
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: wasm-bindgen-shared
  dependency-version: 0.2.126
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-03 00:55:56 +00:00
dependabot[bot]
43d97b0546 build(deps): bump dorny/paths-filter from 4.0.1 to 4.0.2
Bumps [dorny/paths-filter](https://github.com/dorny/paths-filter) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/dorny/paths-filter/releases)
- [Changelog](https://github.com/dorny/paths-filter/blob/master/CHANGELOG.md)
- [Commits](fbd0ab8f3e...7b450fff21)

---
updated-dependencies:
- dependency-name: dorny/paths-filter
  dependency-version: 4.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-03 00:37:37 +00:00
Rob Bradford
6f815c4546 vmm: config: Check NetConfig::socket set if vhost_user is set
This check was already included in the DiskConfig validation but missing
for NetConfig.

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-02 15:35:39 +00:00
Rob Bradford
e9ee46f62b vmm: config: Reject invalid virtio queue sizes
The queue size must fit into a u16 and be a power of 2 according to the
spec.

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-02 15:35:39 +00:00
Rob Bradford
7c7fe7091c vmm: config: Replace integer list conversion
Now that IntegerList can handle any width number type use that for the
queue_sizes parameter on `--generic-vhost-user`

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-02 15:35:39 +00:00
Rob Bradford
1a441fb7ed option_parser: Make IntegerList generic
This allows its use for all integer types and will generate an error if
the value is too wide for the type.

Assisted-by: Claude:Opus-4.8
Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-02 15:35:39 +00:00
Philipp Schuster
da80fde887 vmm: streamline printing of error chains
In [0] we agreed on the current format.

- Use `: ` over ` => `
- Streamline usages in a helper

Context https://github.com/cloud-hypervisor/cloud-hypervisor/issues/8510

[0] https://github.com/cloud-hypervisor/cloud-hypervisor/pull/7066

On-behalf-of: SAP philipp.schuster@sap.com
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
2026-07-02 15:24:20 +00:00
Sebastian Eydam
53a00c0514 virtio-devices: net: add guest-announce plumbing
Advertise `VIRTIO_NET_F_GUEST_ANNOUNCE` on virtio-net devices, surface
`VIRTIO_NET_S_ANNOUNCE` through config status, and handle
`VIRTIO_NET_CTRL_ANNOUNCE_ACK` on the control queue.

This adds the guest-visible state needed for post-migration or
post-restore announce requests; the VMM side triggering is added in
follow-up commits.

The motivation is to reduce post-migration and post-restore
connectivity gap. After a live migration or after restoring, it can
take the guest several seconds to be reachable again over the network.
With these announcements, the network path should be refreshed within a
few milliseconds.

On-behalf-of: SAP sebastian.eydam@sap.com
Signed-off-by: Sebastian Eydam <sebastian.eydam@cyberus-technology.de>
2026-07-02 15:17:40 +00:00
Sebastian Eydam
e17c0be127 virtio-devices: net: report link up in config status
Expose `VIRTIO_NET_S_LINK_UP` through the virtio-net config status field
when `VIRTIO_NET_F_STATUS` was negotiated.

This makes the guest-visible status bits reflect the device runtime
state and prepares the config status path used by later post-migration
announce handling.

On-behalf-of: SAP sebastian.eydam@sap.com
Signed-off-by: Sebastian Eydam <sebastian.eydam@cyberus-technology.de>
2026-07-02 15:17:40 +00:00
Saravanan D
f5967cf287 docs: Document VFIO snapshot and restore support
Add a Snapshot and Restore section to docs/vfio.md covering the
migration v2 requirements (Linux 5.18 kernel, variant VFIO
driver such as mlx5_vfio_pci) and the restore sequence for
devices that advertise migration v2.

The behavior description covers the full restore sequence. It
documents the RUNNING to RESUMING single transition (the kernel
walks the intermediate STOP arc), the post load PCI_COMMAND push
to the device, and the MSI or MSI-X eventfd rearm that the
kernel state does not carry. Behavior matches QEMU
vfio_pci_load_config().

It notes one limitation, the snapshot format stores the opaque
device blob as base64 inside the snapshot JSON, which may benefit
from a binary transport path for very large state.

docs/snapshot_restore.md replaces its VFIO out of scope
limitation with a short section that points to docs/vfio.md for
the requirements and behavior.

Signed-off-by: Saravanan D <saravanand@crusoe.ai>
2026-07-02 01:13:03 +00:00
Saravanan D
8b31602650 pci: vfio: Add unit tests for migration state machine
The VFIO save and load paths drive the kernel migration state machine
through a strict transition sequence and must recover correctly when a
transition or the data transfer fails. Validating that on real hardware
needs a migratable device, which CI does not have, so the behavior would
otherwise go unverified until it breaks in the field.

Introduce a mock Vfio wrapper that records state transitions and keeps
the migration blob in memory, then test VfioCommon save and load against
it. This pins the transition ordering, the data round trip, and the
failure recovery in CI on any host, independent of hardware. The trait
defaults and the VfioMigrationState conversions are covered too, so a
non migratable device and an unknown state value stay well defined. A
restore that carries migration state onto a device without migration
support is checked to fail instead of dropping the state.

A shadow sync test guards the related save path change, confirming a non
BAR config write reaches the PciConfiguration shadow so a snapshot
captures the live value instead of the post init zero.

Signed-off-by: Saravanan D <saravanand@crusoe.ai>
2026-07-02 01:13:03 +00:00