Skip to content

PCI ROM BAR not exposed to guest when using xen-pci-passthrough #786

@timemaster5

Description

@timemaster5

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions