x86_64_v2: OVMF ships x86-64-v3 code (noarch, not rebuilt) — no UEFI guest can boot #1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
AlmaLinux 10's
edk2-ovmfis anoarchpackage, so it is not rebuilt for thex86_64_v2variant — thex86_64_v2repositories serve the same binary as thestandard
x86_64ones. That binary contains BMI1 instructions, so on a CPU thatonly implements
x86-64-v2the firmware triple-faults immediately after SEC and theguest never boots.
The
x86_64_v2variant exists to support pre-v3 CPUs, but its UEFI firmware does notrun on them, which makes UEFI virtualization unusable on such hosts.
ipxe-roms-qemuhas the same problem for the same reason (alsonoarch); detailsat the end. The two compound: fixing only
edk2-ovmfstill leaves every libvirt guesthanging, because libvirt always attaches a NIC and OVMF always loads its option ROM.
The failure is silent — nothing on the guest serial console, nothing in
dmesg, noSELinux AVC. The VNC console just shows
Guest has not initialized the display (yet)while the vCPU spins at 100%.
Affected environment
x86_64_v2variant (repos are?arch=x86_64_v2)edk2-ovmf-20251114-5.el10_2.2.noarchqemu-kvm-18:10.1.0-16.el10_2.2.alma.1.x86_64_v2,libvirt 11.10.0avx,avx2,bmi1,bmi2,abm/lzcnt,fma,f16c.ld.so --helpreportsx86-64-v2 (supported)as thehighest level.
Any
x86-64-v2-only CPU should reproduce (Goldmont / Goldmont Plus / Silvermont basedAtom, Celeron and Pentium Silver; early Nehalem/Westmere-era parts, etc.).
Steps to reproduce — no v2-only hardware required
TCG lets you subtract CPU features, so this reproduces on any machine:
/tmp/ovmf.logfills with nothing but the SEC entry banner, repeated forever:Remove
bmi1=offand the same command reaches the UEFI boot manager normally.bmi1=offalone is sufficient to reproduce;bmi2=offorabm=offalone are not.Evidence
Firmware / accelerator matrix, same host, same disk:
edk2-ovmfel10_2.2-cpu host(J4125)edk2-ovmfel10_2.2-cpu Nehalem/host-modeledk2-ovmfel10_2.2-cpu maxedk2-ovmfel10_2.2-cpu max,bmi1=offedk2-ovmffrom el9 (20241117-8.el9)-cpu host(J4125)seabios-bin)-cpu host(J4125)The
x86_64_v2repository ships the identical file as the standardx86_64repository, confirming that no separate v2 build exists:
Root cause
edk2.specdoes export the distro flags:but
EXTRA_OPTFLAGSis only consumed byBaseTools/Source/C/Makefiles/header.makefile,i.e. the host build tools. The firmware itself is compiled with EDK2's own flag set
(
tools_def.template), which contains no-march. An actual firmware compile linefrom the build log:
So the compiler's built-in default decides the ISA baseline of the shipped binary,
and on a RHEL-10-baseline builder that default is
x86-64-v3.Note that EDK2 does disable SIMD explicitly (
-mno-mmx -mno-sse), because firmwarecannot rely on FPU/SIMD state — but nothing guards against general-purpose ISA
extensions such as BMI1, which the compiler emits freely whenever the default
-marchallows it. That is exactly the gap here.Combined with
BuildArch: noarchon the firmware subpackage, the result is a packagelabelled architecture-independent whose payload is x86_64 machine code built for
whatever the builder's compiler defaulted to.
A plain rebuild fixes it — no spec or source change needed
Rebuilding the unmodified SRPM on an
x86_64_v2AlmaLinux 10 host is sufficient,because that host's GCC defaults to
-march=x86-64-v2:Result — a different binary that boots on the v2-only CPU under KVM:
Suggested fix
edk2on thex86_64_v2builders and ship that binary inthe
x86_64_v2repositories, even though the subpackage isnoarch.-march=x86-64or-march=x86-64-v2) instead of inheriting the builder's compilerdefault. A firmware image shipped as
noarchshould not silently depend on whichmachine built it.
noarchpackage carrying compiled x86_64 payloads is suspect.seabios-bin/seavgabios-binappeared to work in our testing, but the whole classshould be checked.
Same problem in
ipxe-roms-qemuipxe-roms-qemu-20240119-5.gitde8a0821.el10.noarchshipsefi-virtio.rom(the iPXE EFIdriver) with the same defect.
ipxe.specdoes not pass%{optflags}at all — it justruns
make %{?_smp_mflags} NO_WERROR=1 V=1 GITVERSION=...— so iPXE's own flags plus thecompiler default apply, and the subpackage is
noarchtoo.With working firmware but the stock ROM, OVMF faults while loading the option ROM of a
virtio-net device (
1af4:1000):The vCPU then spins at a fixed
RIP(CpuDeadLoop()), which is why the guest looks"hung" rather than "crashed". This is easy to mistake for a libvirt bug: bare
qemu-kvmwithout a NIC boots fine, while every libvirt guest hangs.
A plain
rpmbuild --rebuildof the unmodifiedipxeSRPM on a v2 host fixes it too:romfile=efi-virtio.rom#UDinside1af41000.efidrv, thenCpuDeadLoop()efi-virtio.rom[Bds] Entry...→>>Start PXE over IPv4.— iPXE runs normallyI am happy to file that as a separate issue against
rpms/ipxeif you prefer themtracked separately.
Workarounds for users on v2-only hardware
OVMF_CODE.fd/OVMF_VARS.fdfrom the EL9edk2-ovmfpackage and point thedomain at them, and
<rom enabled='no'/>, i.e.romfile=""),which is harmless unless PXE/HTTP boot is needed.
Hi.
Could you please check if it helps you?
edk2 - https://build.almalinux.org/build/74889
ipxe - https://build.almalinux.org/build/75251
You can add it as repo to your system