Re: [PATCH v6] vfio/cdx: add support for CDX bus

From: Jason Gunthorpe
Date: Thu Jun 01 2023 - 10:15:01 EST


On Mon, May 29, 2023 at 01:36:30PM +0530, Nipun Gupta wrote:
>
>
> On 5/25/2023 1:18 AM, Alex Williamson wrote:
> >
> > On Wed, 24 May 2023 10:45:29 -0600
> > Alex Williamson <alex.williamson@xxxxxxxxxx> wrote:
> >
> > > On Wed, 17 May 2023 15:27:18 +0530
> > > Nipun Gupta <nipun.gupta@xxxxxxx> wrote:
> > >
>
> <snip>
>
> > > > +
> > > > +MODULE_DEVICE_TABLE(cdx, vfio_cdx_table);
> > > > +
> > > > +static struct cdx_driver vfio_cdx_driver = {
> > > > + .probe = vfio_cdx_probe,
> > > > + .remove = vfio_cdx_remove,
> > > > + .match_id_table = vfio_cdx_table,
> > > > + .driver = {
> > > > + .name = "vfio-cdx",
> > > > + .owner = THIS_MODULE,
> > > > + },
> > > > + .driver_managed_dma = true,
> >
> > Hmm, looks like cdx bus is broken here, there's no actual
> > implementation of a dma_configure callback and no setup of the IOMMU
> > default domain for theoretical cdx drivers that might want to use the
> > DMA API. Without that, this driver_manged_dma flag doesn't provide any
> > guarantees to a vfio driver that we have exclusive ownership of the
> > group. Please fix, this flag needs to actually have some meaning on
> > cdx. Thanks,
> >
> > Alex
>
> Agree, this change was missed on CDX bus and we are working on fixing this.
> Shall I send this fix as a commit with this patch?

You should send it as a rc fixup for your already merged CDX bus stuff

Jason