Skip to content

[amd64-v6.18.55-generic] vfio/pci: Expose setup ROM only for display devices - #337

Open
eriknordmark wants to merge 1 commit into
lf-edge:eve-kernel-amd64-v6.18.55-genericfrom
eriknordmark:vfio-pci-setup-rom-display-only
Open

eriknordmark wants to merge 1 commit into
lf-edge:eve-kernel-amd64-v6.18.55-genericfrom
eriknordmark:vfio-pci-setup-rom-display-only

Conversation

@eriknordmark

Copy link
Copy Markdown
Contributor

Since v6.14 (e021e6c), vfio-pci exposes the platform firmware's copy of a device's option ROM at the ROM BAR of any device that has none. On a Supermicro X10SDV that hands the guest Intel's Boot Agent ROM for the onboard I210. QEMU's vfio ROM loader rewrites the ROM's mismatched PCIR device ID (1521 → 1533) and puts the checksum correction in byte 6, which in this ROM is the lret ending its init entry. A SeaBIOS guest given the NIC then crashes with a KVM internal error (EIP 0x98000). QEMU 9.1 through current master do this, so a QEMU upgrade does not avoid it.

This limits the setup-ROM fallback to display-class devices, the case e021e6c was written for.

Tested on sc-sm-e300-10 (EVE-k, 6.18.55): test_app_assigned_eth fails on the stock kernel and passes with this patch. Bare QEMU with romfile= reproduces the crash from the fixed-up image alone. Details in #334.

Fixes #334

🤖 Generated with Claude Code

https://claude.ai/code/session_01VyjigXVFZhuUg5LiRSVwsj

Since e021e6c ("vfio/pci: Expose setup ROM at ROM bar when needed")
vfio-pci exposes the firmware-provided ROM copy (pdev->rom) at the ROM BAR
of any device without a ROM BAR resource. Platform UEFI also hands over
legacy PXE ROMs for onboard NICs that have no ROM BAR of their own, e.g.
Intel's Boot Agent GE for the I210 on a Supermicro X10SDV.

That image is shared across Intel GbE parts and its PCIR names 8086:1521.
QEMU's vfio ROM loader rewrites a mismatched device ID to the device's own
(1533) and stores the checksum correction in ROM byte 6, which in this ROM
is the far return ending its init entry. A SeaBIOS guest given the NIC then
crashes in the ROM's init with a KVM internal error. QEMU 9.1 through
current master do this, so limit the fallback to display-class devices.

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
@eriknordmark
eriknordmark requested review from rene and rucoder November 12, 2026 09:53
@eriknordmark

Copy link
Copy Markdown
Contributor Author

Tested this PR's head (97d2463, core flavor) in an EVE-k build on the Supermicro X10SDV (onboard I210 assigned to a SeaBIOS guest): test_app_assigned_eth passed in 837 s. It fails on the stock 6.18.55 kernel. The rest of the hardware test soak on the same image passed, apart from two tests that also fail on other images on this device.

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