On 11/16/23 10:12, Julien Grall wrote:
> Hi Volodymyr,
>
> On 16/11/2023 15:07, Volodymyr Babchuk wrote:
>> With my vPCI patch series in place, hypervisor itself assigns BDFs for
>> passed-through devices. Toolstack needs to get this information to know
>> which BDFs are free and can be used by virtio-pci.
>
> It sounds a bit odd to let the hypervisor to assign the BDFs. At least
> because there might be case where you want to specific vBDF (for instance
> this is the case with some intel graphic cards). This should be the toolstack
> job to say "I want to assign the pBDF to this vBDF".
Keep in mind we are also supporting dom0less PCI passthrough.
>
> Do you have a link to the patch adding the logic in the hypervisor? I will
> comment there as well.
See add_virtual_device() in [1], specifically the line:
pdev->vpci->guest_sbdf = PCI_SBDF(0, 0, new_dev_number, 0);
[1] https://lists.xenproject.org/archives/html/xen-devel/2023-10/msg00673.html