[vfio-users] Question about device ID
Alex Williamson
alex.williamson at redhat.com
Fri Jul 7 14:29:54 UTC 2017
On Fri, 7 Jul 2017 15:05:48 +0800
Eddie Yen <missile0407 at gmail.com> wrote:
> Hi everyone,
>
> This question may dumb but I really don't know how to analysis the deeper
> ID.
>
> According from Alex Williamson's VIO blog, we can do a trick that make all
> NVIDIA or AMD GPUs catch and drive by VFIO driver.
>
> options vfio-pci ids=
> 1002:ffffffff:ffffffff:ffffffff:00030000:ffff00ff,1002:ffffffff:ffffffff:ffffffff:00040300:ffffffff,10de:ffffffff:ffffffff:ffffffff:00030000:ffff00ff,10de:ffffffff:ffffffff:ffffffff:00040300:ffffffff
>
> But how do I know to found these information?
>
> For "00030000", I found that it means device class when check lspci.
> But for "ffff00ff" in the 0300 end, I don't know where to find this
> information.
>
> Because I may going to passthrough the compute GPU, like NVIDIA Tesla, and
> obviously it will be a different device class and other ID position.
>
> Does anyone know about this?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/pci-stub.c#n25
MODULE_PARM_DESC(ids, "Initial PCI IDs to add to the stub driver, format is "
"\"vendor:device[:subvendor[:subdevice[:class[:class_mask]]]]\""
" and multiple comma separated entries can be specified");
The trick is that these are uint32_t, so to get PCI_ANY_ID (~0) it needs
to be needs to be specified as a full dword. Thanks,
Alex
More information about the vfio-users
mailing list