attach a pcie root port as hostdev

Laine Stump laine at redhat.com
Wed Aug 4 14:39:33 UTC 2021



On 8/4/21 3:21 AM, Jiatong Shen wrote:
> Hello community,
> 
> I am working on plugging a xilinx fpga card as a hostdev.  This fpga 
> card has 2 functions, each has a different role, for some reason, I 
> would like to attach both of them but do not want to attach them 
> separately, so I have tried to attach a pci bridge where fpga cards 
> connect to. but got the following  error,
> 
> error: Failed to attach device from bridge.xml
> error: internal error: Non-endpoint PCI devices cannot be assigned to guests 
> 
> 
> so, my question is is it possible to attach a pci-bridge as hostdev? 
> thank you.

No, it isn't possible. VFIO only supports attaching endpoint devices.

You will need to attach each of your endpoint devices separately. (If 
the issue is that you want both devices to show up on the same root port 
in the guest, that is easily accomplished by manually setting the 
guest-side pci address of the devices to have the same same bus/slot, 
but different function; this does mean that you can't hotplug, but will 
deliver the desired topology. Note that although I've heard of people 
who thought that they needed devices to be on the same slot, I've never 
seen any evidence that this was actually required by any OS or driver)




More information about the libvirt-users mailing list