Description
When passing through a GPU to an HVM guest using xen-pci-passthrough on XCP-ng, the PCI Expansion ROM BAR is not exposed to the guest. As a result, the guest operating system cannot access the device VBIOS through the standard PCI ROM interface.
Inside the guest, the ROM BAR register (0x30) remains unset and the expansion ROM cannot be mapped:
setpci -s 00:08.0 30.l 00000000
For GPUs such as AMD Phoenix (Radeon 780M), the Linux amdgpu driver requires access to the VBIOS to initialize the device. Because the ROM BAR is not exposed, the driver fails with errors similar to:
amdgpu: Unable to locate a BIOS ROM amdgpu: Fatal error during GPU init
Even when specifying romfile and rombar properties on the xen-pci-passthrough device in QEMU, the ROM region is not mapped into guest memory.
Observed behavior
xen-pci-passthrough device exposes romfile and rombar properties internally.
- The ROM BAR is not enabled or mapped for the guest.
- The guest driver cannot read the VBIOS via
/sys/bus/pci/devices/.../rom.
- The PCI ROM BAR register (
0x30) remains 0x00000000.
Expected behavior
If a passthrough device has a valid option ROM or a romfile is provided, the PCI Expansion ROM BAR should be exposed to the guest so that standard firmware discovery mechanisms work.
Impact
Modern GPU drivers (for example amdgpu) rely on the PCI ROM interface to retrieve the VBIOS. Without ROM BAR exposure, GPU passthrough may fail to initialize.
Question
Is the ROM BAR intentionally hidden for security reasons in xen-pci-passthrough, or is this a limitation or bug in the current implementation?
Description
When passing through a GPU to an HVM guest using
xen-pci-passthroughon XCP-ng, the PCI Expansion ROM BAR is not exposed to the guest. As a result, the guest operating system cannot access the device VBIOS through the standard PCI ROM interface.Inside the guest, the ROM BAR register (
0x30) remains unset and the expansion ROM cannot be mapped:setpci -s 00:08.0 30.l 00000000For GPUs such as AMD Phoenix (Radeon 780M), the Linux
amdgpudriver requires access to the VBIOS to initialize the device. Because the ROM BAR is not exposed, the driver fails with errors similar to:amdgpu: Unable to locate a BIOS ROM amdgpu: Fatal error during GPU initEven when specifying
romfileandrombarproperties on thexen-pci-passthroughdevice in QEMU, the ROM region is not mapped into guest memory.Observed behavior
xen-pci-passthroughdevice exposesromfileandrombarproperties internally./sys/bus/pci/devices/.../rom.0x30) remains0x00000000.Expected behavior
If a passthrough device has a valid option ROM or a
romfileis provided, the PCI Expansion ROM BAR should be exposed to the guest so that standard firmware discovery mechanisms work.Impact
Modern GPU drivers (for example
amdgpu) rely on the PCI ROM interface to retrieve the VBIOS. Without ROM BAR exposure, GPU passthrough may fail to initialize.Question
Is the ROM BAR intentionally hidden for security reasons in
xen-pci-passthrough, or is this a limitation or bug in the current implementation?