Skip to content

vfio-pci: keep option ROMs that list the device unmodified - #7184

Draft
eriknordmark wants to merge 6 commits into
lf-edge:masterfrom
eriknordmark:vfio-rom-device-list
Draft

eriknordmark wants to merge 6 commits into
lf-edge:masterfrom
eriknordmark:vfio-rom-device-list

Conversation

@eriknordmark

Copy link
Copy Markdown
Contributor

Description

Since Linux 6.14, vfio-pci exposes the firmware's shadow copy of a device's
option ROM when the device has no ROM BAR of its own. On Intel I210 NICs that
copy is the Boot Agent ROM. QEMU's ROM loader then rewrites the PCIR device ID
to the passed-through device's ID (1521 to 1533) and writes the checksum fix
into byte 6, which is the lret ending the ROM's init entry. A SeaBIOS guest
with the NIC assigned crashes about 2.5 s after boot and never gets an IP.

The fix leaves a ROM unmodified when its PCIR device list already names the
device. It applies to both QEMUs EVE runs:

  • pkg/qemu (EVE-kvm): new patch on EVE's QEMU.
  • pkg/virt-launcher (EVE-k): KubeVirt v1.7.3's launcher rebuilt with the same
    patch ported to CentOS Stream 9 qemu-kvm-9.1.0-20.el9, and selected through
    virt-operator's VIRT_LAUNCHER_IMAGE. The launcher image is pulled, not
    bundled, since it would push the EVE-k rootfs past 512 MB.

Draft because:

  • The two TEST ONLY commits get dropped: one points VIRT_LAUNCHER_IMAGE at
    a personal Docker Hub copy, the other builds EVE-k with the core kernel and
    kvm firmware so the test image fits a 512 MB device.
  • lfedge/eve-virt-launcher needs publishing under a fixed tag.
  • kube-init applies kubevirt-operator.yaml only on first install, so an
    upgraded node keeps the stock launcher. That needs handling.
  • The fixup commits get squashed.

PR dependencies

None. lf-edge/eve-kernel#337 fixes the same crash on the kernel side by
limiting the firmware ROM fallback to display devices; either fix alone is
sufficient.

How to test and validate this PR

On an EVE-k device with an Intel I210 (or another NIC whose firmware carries a
Boot Agent ROM listing the device), running a 6.14+ kernel, assign the NIC to
a VM app booting with SeaBIOS. Without the fix the domain goes to
suspended paused shortly after start and the app gets no IP; with it the app
boots and gets an address. Confirm the launcher pod runs the patched image
(kubectl get pods -A -l kubevirt.io=virt-launcher -o jsonpath='{..image}').

Tested with ztest test_app_assigned_eth on a Supermicro E300 with I210 NICs:
3/3 passed (726–782 s) on a 6.18 kernel without eve-kernel#337.

Changelog notes

Fixed VMs with a passed-through Intel I210 (or similar) NIC crashing at boot
on EVE-k.

PR Backports

  • 17.0-stable: No, its 6.12 kernel does not expose the firmware ROM.
  • 16.0-stable: No, its 6.12 kernel does not expose the firmware ROM.
  • 14.5-stable: No, its 6.1 kernel does not expose the firmware ROM.
  • 13.4-stable: No, its 6.1 kernel does not expose the firmware ROM.

Checklist

  • I've provided a proper description

  • I've added the proper documentation

  • I've tested my PR on amd64 device

  • I've tested my PR on arm64 device

  • I've written the test verification instructions

  • I've set the proper labels to this PR

  • I've checked the boxes above, or I've provided a good reason why I didn't
    check them.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VyjigXVFZhuUg5LiRSVwsj

@codecov

codecov Bot commented Nov 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 31.25%. Comparing base (479b54b) to head (3371662).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7184      +/-   ##
==========================================
+ Coverage   30.78%   31.25%   +0.46%     
==========================================
  Files         562      573      +11     
  Lines      101223   102818    +1595     
==========================================
+ Hits        31166    32132     +966     
- Misses      67638    68313     +675     
+ Partials     2419     2373      -46     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

eriknordmark and others added 6 commits November 23, 2026 13:38
With a 6.14 or later kernel, a SeaBIOS app VM with a passed-through NIC
that has no option ROM of its own, such as the Intel I210 on a
Supermicro X10SDV-TP8F, stops at boot with a KVM internal error. The
kernel exposes the platform firmware's copy of the ROM, and QEMU
rewrites its device ID and checksum in a way that corrupts the image,
although the ROM's own device list already names the device. OVMF
guests are unaffected. EVE-k cannot work around it with rombar=0,
since KubeVirt has no ROM setting for host devices.

Add a QEMU patch that leaves such a ROM untouched.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
On EVE-k, app VMs run in KubeVirt's virt-launcher, whose qemu-kvm is
CentOS Stream 9's rather than EVE's pkg/qemu. A SeaBIOS VM with an
assigned NIC that has no ROM of its own, such as the I210 on a
Supermicro X10SDV, therefore still stops with a KVM internal error on
a 6.14+ kernel, since QEMU corrupts the platform ROM the kernel exposes.

Add pkg/virt-launcher, which rebuilds the launcher's qemu-kvm RPM from
its source package with the vfio ROM patch, ported to QEMU 9.1. pkg/kube
bundles it as docker.io/lfedge/eve-virt-launcher:v1.7.3-eve1, kube-init
imports it, and virt-operator uses it through VIRT_LAUNCHER_IMAGE.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VyjigXVFZhuUg5LiRSVwsj
linuxkit runs RUN steps without network unless build.yml asks for it,
and dnf has to fetch the QEMU build dependencies.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VyjigXVFZhuUg5LiRSVwsj
The full launcher image is 531 MB uncompressed and pushes the EVE-k rootfs past the 512 MB device limit. Nodes now pull it on first use via virt-operator's VIRT_LAUNCHER_IMAGE, like the stock quay image.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VyjigXVFZhuUg5LiRSVwsj
Points VIRT_LAUNCHER_IMAGE at a personal Docker Hub copy of pkg/virt-launcher until lfedge/eve-virt-launcher is published.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VyjigXVFZhuUg5LiRSVwsj
Builds EVE-k with the core kernel flavor and the kvm firmware list so
the amd64 EVE-k rootfs fits under 512 MiB for a ZEDCloud upload. Loses
the hwe kernel's broader driver and firmware coverage. Do not merge.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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