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

Alex Williamson alex.williamson at redhat.com
Mon Jun 17 14:22:15 UTC 2019


On Sat, 15 Jun 2019 14:30:49 +0100
James <James at superbug.co.uk> wrote:

> Hi,
> 
> Please find attached a kernel patch. This is based from a very old patch 
> that never made it into the kernel in 2014. 
> https://lkml.org/lkml/2014/10/20/295. I am not sure who else I should be 
> adding to the Signed-off-by section.
> 
> I have modified it and tested it, so that it works against kernel 5.1.10.
> 
> Summary below:
> 
> 
>     PCI: Introduce new device binding path using pci_dev.driver_override
> 
>      In order to bind PCI slots to specific drivers use:
> pci=driver[xxxx:xx:xx.x]=foo,driver[xxxx:xx:xx.x]=bar,...
> 
>      The main use case for this is in relation to qemu passthrough
>      of a pci device using IOMMU and vfio-pci.
>      Example:
>      The host has two identical devices. E.g. 2 AMD Vega GPUs,
>      The user wishes to passthrough only one GPU.
>      This new feature allows the user to select which GPU to passthrough.
> 
>      Signed-off-by: James Courtier-Dutton <James at superbug.co.uk>

vfio-users is not a development list, patches should not be posted here
with the intent of upstream inclusion, especially patches outside of
the vfio driver itself.

Upstream patches should be posted inline, not as attachments.  Messages
with this sort of attachment are likely to get rejected by upstream
lists.

This is simply a reposting of patch that was thoroughly discussed
upstream in the link you provided.  None of the issues raised in that
thread have been addressed in this reposting.

While I like the idea of a driver_override command line option, there
are existing mechanisms to deal with two identical cards with different
driver binding requirements.  I'd suggest using a modprobe.d install
command to perform the driver_override on the device instance intended
for use with vfio-pci, for example:

install amdgpu echo vfio-pci > /sys/bus/pci/devices/0000:02:00.0/driver_override; modprobe --ignore-install amdgpu

Thanks,
Alex




More information about the vfio-users mailing list