[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200116184027.2954c3f5.cohuck@redhat.com>
Date: Thu, 16 Jan 2020 18:40:27 +0100
From: Cornelia Huck <cohuck@...hat.com>
To: "Liu, Yi L" <yi.l.liu@...el.com>
Cc: "alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"kwankhede@...dia.com" <kwankhede@...dia.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"Tian, Kevin" <kevin.tian@...el.com>,
"joro@...tes.org" <joro@...tes.org>,
"peterx@...hat.com" <peterx@...hat.com>,
"baolu.lu@...ux.intel.com" <baolu.lu@...ux.intel.com>,
Masahiro Yamada <yamada.masahiro@...ionext.com>
Subject: Re: [PATCH v4 11/12] samples: add vfio-mdev-pci driver
On Thu, 16 Jan 2020 13:23:28 +0000
"Liu, Yi L" <yi.l.liu@...el.com> wrote:
> > From: Cornelia Huck [mailto:cohuck@...hat.com]
> > Sent: Wednesday, January 15, 2020 8:30 PM
> > To: Liu, Yi L <yi.l.liu@...el.com>
> > Subject: Re: [PATCH v4 11/12] samples: add vfio-mdev-pci driver
> >
> > On Tue, 7 Jan 2020 20:01:48 +0800
> > Liu Yi L <yi.l.liu@...el.com> wrote:
> > > diff --git a/samples/Kconfig b/samples/Kconfig
> > > index 9d236c3..50d207c 100644
> > > --- a/samples/Kconfig
> > > +++ b/samples/Kconfig
> > > @@ -190,5 +190,15 @@ config SAMPLE_INTEL_MEI
> > > help
> > > Build a sample program to work with mei device.
> > >
> > > +config SAMPLE_VFIO_MDEV_PCI
> > > + tristate "Sample driver for wrapping PCI device as a mdev"
> > > + select VFIO_PCI_COMMON
> > > + select VFIO_PCI
> >
> > Why does this still need to select VFIO_PCI? Shouldn't all needed
> > infrastructure rather be covered by VFIO_PCI_COMMON already?
>
> VFIO_PCI_COMMON is supposed to be the dependency of both VFIO_PCI and
> SAMPLE_VFIO_MDEV_PCI. However, the source code of VFIO_PCI_COMMON are
> under drivers/vfio/pci which is compiled per the configuration of VFIO_PCI.
> Besides of letting SAMPLE_VFIO_MDEV_PCI select VFIO_PCI, I can also add
> a line in drivers/vfio/Makefile to make the source code under drivers/vfio/pci
> to be compiled when either VFIO_PCI or VFIO_PCI_COMMON are configed. But
> I'm afraid it is a bit ugly. So I choose to let SAMPLE_VFIO_MDEV_PCI select
> VFIO_PCI. If you have other idea, I would be pleased to
> know it. :-)
Shouldn't building drivers/vfio/pci/ for CONFIG_VFIO_PCI_COMMON already
be enough (the Makefile changes look fine to me)? Or am I missing
something obvious?
>
> >
> > > + depends on VFIO_MDEV && VFIO_MDEV_DEVICE
> >
> > VFIO_MDEV_DEVICE already depends on VFIO_MDEV. But maybe also make this
> > depend on PCI?
> >
> > > + help
> > > + Sample driver for wrapping a PCI device as a mdev. Once bound to
> > > + this driver, device passthru should through mdev path.
> >
> > "A PCI device bound to this driver will be assigned through the
> > mediated device framework."
> >
> > ?
>
> Maybe I should have mentioned it as "A PCI device bound to this
> sample driver should follow the passthru steps for mdevs as showed
> in Documentation/driver-api/vfio-mediated-device.rst."
>
> Does it make more sense?
Yes, it does :)
Powered by blists - more mailing lists