fix(vm): use QEMU firmware for ARM TCG fallback

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
This commit is contained in:
Drew Newberry
2026-07-28 21:15:00 -07:00
parent 09390c13f8
commit a102a49c01
4 changed files with 16 additions and 7 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ The Release Canary (`.github/workflows/release-canary.yml`) smoke-tests the arti
The Linux VM matrix sets `OPENSHELL_VERSION=dev`, so it tests the packages published by Release Dev. The Snap job downloads artifacts from the triggering run, and Kubernetes pins the `0.0.0-dev` chart and `:dev` images. The macOS job retains the installer's default latest-tagged release behavior.
On Linux, the VM harness uses KVM when `/dev/kvm` is readable and writable. It falls back automatically to native-architecture QEMU TCG when KVM is unavailable, which is expected on public ARM64 runners. Normal canaries do not cross-emulate architectures. The manual `arm64_tcg_benchmark` mode is the exception: it boots the same pinned ARM64 Ubuntu image with TCG on x86_64 and ARM64 Linux hosts.
On Linux, the VM harness uses KVM when `/dev/kvm` is readable and writable. It falls back automatically to native-architecture QEMU TCG when KVM is unavailable, which is expected on public ARM64 runners. The ARM64 fallback switches from the default firmware to QEMU's bundled EDK2 firmware, which is validated under TCG. Normal canaries do not cross-emulate architectures. The manual `arm64_tcg_benchmark` mode is the exception: it boots the same pinned ARM64 Ubuntu image with TCG on x86_64 and ARM64 Linux hosts.
## Trigger paths
+6 -4
View File
@@ -180,13 +180,15 @@ The high-level CI model:
After each successful Release Dev run, the release canary smoke-tests published
artifacts. Linux package installs run in native-architecture Ubuntu and Fedora
QEMU guests on public AMD64 and ARM64 GitHub runners. The VM harness uses KVM
when available and falls back to TCG otherwise. Separate jobs retain macOS
Homebrew, Ubuntu Snap, and kind-based Helm coverage.
when available and falls back to TCG otherwise. The ARM64 fallback uses QEMU's
bundled EDK2 firmware, which is validated under TCG on both public Linux host
architectures. Separate jobs retain macOS Homebrew, Ubuntu Snap, and kind-based
Helm coverage.
A manual `arm64_tcg_benchmark` dispatch mode skips the artifact canaries and
boots the same pinned ARM64 Ubuntu cloud image under QEMU TCG on public x86_64
and ARM64 Linux runners. This isolates host-dependent TCG boot behavior before
the production ARM64 canary strategy changes.
and ARM64 Linux runners. The comparison keeps the native ARM64 runner as the
production host while verifying that x86_64 TCG remains a viable fallback.
See `CI.md` for the contributor workflow, labels, and maintainer merge-queue workflow.
+2 -2
View File
@@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0
# Test Guests
This prototype uses Nix, QEMU, and Ansible to boot and configure disposable Linux VMs for testing OpenShell packages and binaries. It supports HVF on Apple Silicon macOS, KVM on native-architecture Linux hosts, and a slower TCG fallback on Linux when KVM is unavailable. A separate Linux-only app boots the pinned ARM64 guest with TCG on either an x86_64 or ARM64 host for performance comparisons.
This prototype uses Nix, QEMU, and Ansible to boot and configure disposable Linux VMs for testing OpenShell packages and binaries. It supports HVF on Apple Silicon macOS, KVM on native-architecture Linux hosts, and a slower TCG fallback on Linux when KVM is unavailable. The ARM64 fallback switches to QEMU's bundled EDK2 firmware, which is validated with TCG. A separate Linux-only app boots the pinned ARM64 guest with TCG on either an x86_64 or ARM64 host for performance comparisons.
## Requirements
@@ -237,7 +237,7 @@ Arguments after `--` are executed inside the guest. Without a command, the runne
Each invocation checks for an exact prepared local cache entry. On a miss, Nix realizes the hash-pinned cloud image and the runner applies the selected configurations. It then:
1. Creates a temporary QCOW2 overlay backed by the prepared cache disk or pinned cloud image.
2. Boots QEMU with HVF, KVM, or the Linux TCG fallback.
2. Boots QEMU with HVF, KVM, or the Linux TCG fallback. Native ARM64 Linux guests use QEMU's bundled EDK2 firmware when KVM is unavailable.
3. Creates a fresh cloud-init instance and ephemeral SSH key.
4. Applies the selected Ansible configurations only when the base is not prepared.
5. Installs or copies the supplied artifacts.
+7
View File
@@ -245,6 +245,13 @@ if [ "${TEST_GUEST_ACCELERATOR}" = kvm ] &&
TEST_GUEST_ACCELERATOR=tcg
test_vm_cpu=max
ssh_wait_seconds=600
if [ "${TEST_VM_ARCHITECTURE}" = aarch64 ]; then
: "${TEST_VM_TCG_FIRMWARE_CODE:?missing QEMU ARM TCG firmware code}"
: "${TEST_VM_TCG_FIRMWARE_VARS:?missing QEMU ARM TCG firmware variables}"
TEST_VM_FIRMWARE_CODE=${TEST_VM_TCG_FIRMWARE_CODE}
TEST_VM_FIRMWARE_VARS=${TEST_VM_TCG_FIRMWARE_VARS}
echo "==> Using QEMU-bundled ARM firmware for TCG fallback"
fi
fi
# shellcheck disable=SC1090