Skip to content

fix(doctor): install EDK2 firmware on x86_64 too - #349

Open
CMGS wants to merge 1 commit into
masterfrom
fix/edk2-x86
Open

CMGS wants to merge 1 commit into
masterfrom
fix/edk2-x86

Conversation

@CMGS

@CMGS CMGS commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Why

The cocoonstack Cloud Hypervisor dev build now carries upstream #9529, which lets the guest assign PCI BAR addresses. rust-hypervisor-firmware allocates the virtio-blk BARs before it reads the disk (src/main.rs allocate_bars), has no allocation window on x86_64 PVH (pci_bar_memory() is None outside the FDT path), and panics on the zero BAR (src/pci.rs: "Zero BAR address and no allocation available to allocate from"). Every firmware boot on x86_64 then hangs right after event = booted, whatever the guest OS. Until this lands, cocoon-check --upgrade on x86_64 installs the new CH next to that firmware.

x86_64 OCI images use direct kernel boot without firmware and are not affected; neither is Firecracker.

What

  • doctor/check.sh: x86_64 installs EDK2 ch-1e1b96f126 CLOUDHV.fd (sha256 9fb511fc…60218, pinned like the aarch64 build); FW_REF and the rust-hypervisor-firmware download are gone; any other CLOUDHV.fd is FAIL on both architectures (aarch64 already did this).
  • Docs: README, install, index, vm, windows describe EDK2. known-issues.md: the x86_64 cloud image UEFI compatibility entry (Ubuntu 24.04+, Debian 13+) and the Windows ACPI power-button entry are marked fixed by EDK2.

Evidence

  • Digest: CLOUDHV.fd downloaded from the ch-1e1b96f126 release hashes to the pinned value.
  • shellcheck -S warning doctor/check.sh: clean.
  • doctor/check.sh in ubuntu:24.04 containers, linux/amd64 and linux/arm64, with a fresh root:
    • rust-hypervisor-firmware installed: [FAIL] CLOUDHV.fd (140616 bytes) … is not EDK2 ch-1e1b96f126 — run --upgrade (aarch64: … is not EDK2 ch-97eeb7b09)
    • --upgrade: [FIXED] EDK2 ch-1e1b96f126 CLOUDHV.fd -> …/firmware/CLOUDHV.fd, then [PASS] CLOUDHV.fd (4194304 bytes); aarch64 unchanged (CLOUDHV_EFI.fd, 3145728 bytes, PASS)
  • Hardware (bare metal, earlier rounds on the same CH builds, raw CH with cocoon's argv shape):
    • Linux cloud images jammy, noble and bookworm boot, reboot and power off under EDK2 on both the current and the new CH.
    • Windows 11 25H2 under EDK2: cold boot, wake from hibernation, NIC and ACPI power-off (~10 s) show no regression from the current to the new CH. A Windows VM hibernated under the old CH with rust-hypervisor-firmware wakes on the new CH and reboots under EDK2 once the firmware file is replaced.
    • New CH with rust-hypervisor-firmware: every Windows cold boot hangs.

Pending, will be added here: a hardware round through the cocoon CLI on this branch (Windows and Linux cloud images, Windows cold-boot ACPI stop, watchdog device, nested virtualization), and one Linux cloud image boot with rust-hypervisor-firmware on the new CH.

Rollout

Every <root>/firmware/CLOUDHV.fd that Cloud Hypervisor can read must be EDK2 before a node takes the new CH. Running VMs and existing snapshots need no change: the firmware is read again only on a guest reboot or a cold boot.

The cocoonstack Cloud Hypervisor dev build lets the guest assign PCI BAR
addresses. rust-hypervisor-firmware allocates virtio-blk BARs before it
reads the disk, has no allocation window on x86_64 PVH, and panics on the
zero BAR, so every firmware boot hangs after "booted". EDK2 boots Windows
and Linux cloud images under both the old and the new build.

cocoon-check now installs and pins EDK2 ch-1e1b96f126 CLOUDHV.fd on
x86_64 and reports any other CLOUDHV.fd as FAIL on both architectures.
x86_64 OCI direct boot uses no firmware and is unaffected.

This branch has not been deployed

No deployments
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.

1 participant