[vfio-users] Passthru of one GPU with a PC with 2 identical GPUs installed

Alex Williamson alex.williamson at redhat.com
Tue May 21 23:11:14 UTC 2019


On Tue, 21 May 2019 23:45:22 +0100
James Courtier-Dutton <james.dutton at gmail.com> wrote:

> On Sun, 19 May 2019 at 09:30, James Courtier-Dutton <james.dutton at gmail.com>
> wrote:
> 
> > Hi,
> >
> > I have a PC with two identical GPUs.
> > One I wish to hand over to vfio and do passthru with, the other I wish the
> > host to use.
> > I know about commands like:
> > echo 1002 687f  >/sys/bus/pci/drivers/vfio-pci/new_id
> >
> > But those will cause both GPUs to be claimed by vfio.
> > I would prefer to do it by slot, e.g. echo 09:00.0  
> > >/sys/bus/pci/drivers/vfio-pci/new_id  
> > But, I cannot see how to do it by slot instead of PCI-ID.
> >
> >  
> How about something like the attached:
> It lets you future filter down what vfio-pci will claim by entering them as
> module options.

For submitting patches, please see:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst

I think a better approach would be to extend the pci= kernel command
line option to include driver_override support, perhaps something like:

pci=...,driver_overrides=<pci_dev1>=<driver1>;<pci_dev2>=<driver2>,

This would follow the disable_acs_redir= option as an example where the
device is specified by the path to the device, such that it identifies a
persistent device regardless of bus number changes (see lspci -P).  It
would also make use of the existing driver_override functionality for
all PCI devices rather than unique to the vfio-pci driver.  In fact,
several bus types support driver_override, so we might want to consider
whether the format should be something like:

driver_overrides=pci:<pci_dev1>=<driver1>,pci:<pci_dev2>=<driver2>

I find having two levels of filtering, like in the patch proposed
confusing and difficult to use (also it ignores PCI domains, see lspci
-D).  Thanks,

Alex




More information about the vfio-users mailing list