Skip to content

Rebase the edera fork commits onto v54.0 - #3

Merged
asher merged 7 commits into
edera/v54.xfrom
asher/v54-rebase
Oct 16, 2026
Merged

asher merged 7 commits into
edera/v54.xfrom
asher/v54-rebase

Conversation

@asher

@asher asher commented Oct 15, 2026 •

Copy link
Copy Markdown

Rebase the six edera/v53.x fork commits onto upstream v54.0 and bump rustls, as the base for KVM zone fork, export and import in protect.

Merge this PR with "Create a merge commit", as edera/v53.x does. Do not rebase or squash it, so that the seven commits keep their shas and signatures and the next rebase can carry them one by one.

Why v54.0

Upstream v54.0 contains the four fixes that KVM snapshot and restore need, so this branch carries none of them as backports:

  • 4c6bb7951 virtio-devices: pci: Skip ring index restore for unused queues. Without it, an aarch64 restore panics for a virtio device whose queues the guest never set up.
  • b47c26fa5 virtio-devices: Resume vhost-user devices after snapshot. Without it, a snapshot stops the source VM's virtio-fs.
  • efa34d789 and 18366e1b7: derive the vCPU MPIDR and the per-vCPU GICR_TYPER values. Without them, an aarch64 snapshot saves the redistributor and ICC state of vCPU 0 for every vCPU, and the restored guest stalls.

v54.0 also adds the VM generation ID device and preserve_source.

Commits

Each commit is a rebase of the edera/v53.x commit in parentheses:

  • 7f1d3468f DNM: vmm: Rename ConsoleConfig.file to output_file (5948abda1)
  • c98229153 DNM: vmm: Support console input_file option (504bccf73). Conflict in the vmm/src/config.rs tests only: the console_config test helper takes the v54 IommuType and the fork's output_file and input_file.
  • 530738d7f arch: x86_64: derive guest cache topology from the synthesized topology (eaafe4dae)
  • ef7a922cb arch, vmm: vNUMA-aware x2APIC IDs for unbalanced NUMA layouts (6a482e476)
  • e414c7b3e arch: x86_64: clear SSBD CPUID bit when SPEC_CTRL is absent (59afbd425)
  • 4943d564e block: flush the image with fdatasync instead of a full fsync (596d2f1bd)

One new commit:

  • 400f4f5d7 build: Bump rustls to 0.23.46. It fixes RUSTSEC-2026-0346 to 0349, which make the audit check fail on the v54.0 Cargo.lock. Only vm-migration/src/tls.rs uses rustls, for migration over TLS.

Changes from the edera/v53.x originals, for CI:

  • 7f1d3468f and c98229153 also update the console configs in fuzz/fuzz_targets/http_api.rs, and c98229153 drops a needless borrow in File::open(input_file_path). Without them, fuzz-build and every quality job fail.
  • ef7a922cb also puts #[allow(clippy::too_many_arguments)] on CpuManager::configure, because its new x2apic_id argument makes 8 with igvm on x86_64. Without it, the kvm,sev_snp clippy step fails.
  • 530738d7f has a shorter title, and ef7a922cb and 4943d564e have bodies rewrapped at 72 characters, for gitlint.

Known CI failure

gitlint refuses the DNM component in the titles of 7f1d3468f and c98229153. A new title needs the owners' decision on the DNM convention.

Testing

  • cargo build --release -p cloud-hypervisor --locked --features ivshmem for aarch64 and amd64.
  • On an aarch64 KVM host with protect: boot, disk I/O across a pause, fork (-c 3, from a suspended parent, a grandchild, a child with no network), export and import of a 4-vCPU zone, a 20-import GIC stall check, host mounts through virtio-fs, and the protect fork and snapshot e2e suites.
  • The builds and the aarch64 tests ran on the earlier tip de78ff894. The current tip differs from it only in the fuzz target, the removed borrow, the clippy allow and the rustls version. On the current tip, cargo audit passed, CI clippy passed for aarch64 (kvm) and for the x86_64 steps from kvm,sev_snp to the end of the job, and a fuzz http_api check passed on amd64.
  • x86_64: the CI unit tests pass. The protect x86_64 KVM run needs the kvm-oci image, and kvm-oci builds only edera/vNN.x branch tips, so that run comes after this merge. protect pins no v54 image yet, so a fix that the run needs goes to edera/v54.x in a new PR.

Generated with Claude Code

sveith and others added 3 commits October 15, 2026 16:52
In order to prepare for supporting bidirectional communication over a
file-backed virtio-console device, rename the field in `ConsoleConfig`
from `file` to `output_file` to clarify its purpose.

No functional change intended, but merging this change would likely
break API compatibility.

Signed-off-by: Simon Veith <simon@edera.dev>
When used as `--console file=<path>`, the virtio-console device is
currently unidirectional (output from guest only).

Add an optional parameter `input_file=<path>` which allows input into
the guest from the given file or pipe as well.

Signed-off-by: Simon Veith <simon@edera.dev>
The deterministic cache leaf (0x8000_001d on AMD, 0x4 on Intel) is
inherited verbatim from the host via KVM_GET_SUPPORTED_CPUID, so its
"logical processors sharing this cache" field still describes the host's
last-level cache span (e.g. a whole CCX). When a guest is given a
multi-package topology to back a vNUMA layout, the guest's LLC then
appears to cross NUMA node boundaries and the kernel warns:

  sched: CPU #2's llc-sibling CPU #0 is not on the same node!

Re-derive the cache-sharing field from the topology we synthesize:
per-core caches (L1/L2) share across a core's threads, and the
last-level cache shares across a whole package (== one vNUMA node).
Cache geometry is left untouched, and single-package guests keep the
host's cache topology, which is already self-consistent.

Signed-off-by: Steven Noonan <steven@edera.dev>
tycho and others added 4 commits October 15, 2026 17:22
cloud-hypervisor derives a vCPU's x2APIC ID from cpu_id /
(threads*cores*dies), so it can only carve equal-sized packages. An
unbalanced vNUMA layout (e.g. 4+3 vCPUs) therefore cannot map one guest
package per node, which is what keeps a node's last-level cache from
appearing to span nodes.

Add vcpu_x2apic_id(), mirroring Xen's guest_vcpu_x2apic_id: each node
occupies a power-of-two APIC-ID window sized to the largest node
(encoded as cores_per_die); a vCPU's ID is (node << pkg_shift) | offset,
and under-filled nodes leave the tail of their window unused. For
balanced layouts this is bit-identical to the uniform encoding.

Compute every vCPU's APIC ID once in CpuManager from the NUMA layout and
feed it to the vlapic, MADT, SRAT, the AML _MAT and the per-vCPU CPUID
topology leaves so all interfaces agree. Relax the topology-count check
to allow over-provisioned APIC space (total >= max_vcpus).

Signed-off-by: Steven Noonan <steven@edera.dev>
KVM_GET_SUPPORTED_CPUID can advertise CPUID(7,0).EDX[31] (SSBD via
IA32_SPEC_CTRL) without EDX[26] (SPEC_CTRL) on AMD hosts, where
speculation control is exposed through leaf 0x8000_0008 instead. The
guest kernel's cpuid-deps check then warns:

  x86 CPU feature dependency check failure: CPU0 has '18*32+31' enabled
  but '18*32+26' disabled.

Enforce the dependency in the guest CPUID: drop EDX[31] when EDX[26] is
clear. Real SSBD stays available to the guest via 0x8000_0008.EBX[24].

Signed-off-by: Steven Noonan <steven@edera.dev>
A guest flush asks that written data survive a crash. fdatasync gives
that: the data plus the metadata needed to read it back. fsync also
commits the timestamps, and on ext4 every O_DIRECT write updates the
image mtime, so each guest flush forced a host journal commit on top of
the device flush.
This was already in QEMU already.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
0.23.46 fixes RUSTSEC-2026-0346, RUSTSEC-2026-0347, RUSTSEC-2026-0348
and RUSTSEC-2026-0349, which cargo audit reports for 0.23.45.

Signed-off-by: Asher Feldman <asher@edera.dev>
@asher
asher marked this pull request as ready for review October 16, 2026 00:51
@asher
asher merged commit d9bd094 into edera/v54.x Oct 16, 2026
41 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants