[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190308180317.GA30821@nvidia.com>
Date: Fri, 8 Mar 2019 10:03:18 -0800
From: Neo Jia <cjia@...dia.com>
To: Alex Williamson <alex.williamson@...hat.com>
CC: Lu Baolu <baolu.lu@...ux.intel.com>,
Joerg Roedel <joro@...tes.org>,
David Woodhouse <dwmw2@...radead.org>,
Kirti Wankhede <kwankhede@...dia.com>, <ashok.raj@...el.com>,
<sanjay.k.kumar@...el.com>, <jacob.jun.pan@...el.com>,
<kevin.tian@...el.com>,
Jean-Philippe Brucker <jean-philippe.brucker@....com>,
<yi.l.liu@...el.com>, <yi.y.sun@...el.com>, <peterx@...hat.com>,
<tiwei.bie@...el.com>, <xin.zeng@...el.com>,
<iommu@...ts.linux-foundation.org>, <kvm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>
Subject: Re: [PATCH v7 9/9] vfio/type1: Handle different mdev isolation type
On Thu, Mar 07, 2019 at 04:56:23PM -0700, Alex Williamson wrote:
> On Thu, 7 Mar 2019 00:44:54 -0800
> Neo Jia <cjia@...dia.com> wrote:
>
> > On Fri, Feb 22, 2019 at 10:19:27AM +0800, Lu Baolu wrote:
> > > This adds the support to determine the isolation type
> > > of a mediated device group by checking whether it has
> > > an iommu device. If an iommu device exists, an iommu
> > > domain will be allocated and then attached to the iommu
> > > device. Otherwise, keep the same behavior as it is.
> > >
> > > Cc: Ashok Raj <ashok.raj@...el.com>
> > > Cc: Jacob Pan <jacob.jun.pan@...ux.intel.com>
> > > Cc: Kevin Tian <kevin.tian@...el.com>
> > > Signed-off-by: Sanjay Kumar <sanjay.k.kumar@...el.com>
> > > Signed-off-by: Liu Yi L <yi.l.liu@...el.com>
> > > Signed-off-by: Lu Baolu <baolu.lu@...ux.intel.com>
> > > Reviewed-by: Jean-Philippe Brucker <jean-philippe.brucker@....com>
> > > ---
> > > drivers/vfio/vfio_iommu_type1.c | 48 ++++++++++++++++++++++++++++-----
> > > 1 file changed, 41 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
> > > index ccc4165474aa..f1392c582a3c 100644
> > > --- a/drivers/vfio/vfio_iommu_type1.c
> > > +++ b/drivers/vfio/vfio_iommu_type1.c
> > > @@ -1368,13 +1368,40 @@ static void vfio_iommu_detach_group(struct vfio_domain *domain,
> > > iommu_detach_group(domain->domain, group->iommu_group);
> > > }
> > >
> >
> > Hi Baolu,
> >
> > To allow IOMMU-awared mdev, I think you need to modify the
> > vfio_iommu_type1_pin_pages and vfio_iommu_type1_unpin_pages to remove the
> > iommu->external_domain check.
> >
> > Could you please include that in your patch? If not, I can send out a separate
> > patch to address that issue.
>
> I figured it was intentional that an IOMMU backed mdev would not use
> the pin/unpin interface and therefore the exiting -EINVAL returns would
> be correct. Can you elaborate on the use case for still requiring the
> mdev pin/unpin interface for these devices? Thanks,
Sure. We are using this api to fetch a pfn of a guest physical address so we can
access it for PV.
Thanks,
Neo
>
> Alex
Powered by blists - more mailing lists