Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-10-15 Thread Jacob Pan
On Wed, 3 Oct 2018 18:52:16 +0100 Jean-Philippe Brucker wrote: > On 26/09/2018 23:35, Jacob Pan wrote: > > On Thu, 20 Sep 2018 18:00:39 +0100 > > Jean-Philippe Brucker wrote: > > > >> + > >> +static int io_mm_attach(struct iommu_domain *domain, struct device > >> *dev, > >> +

RE: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-10-08 Thread Liu, Yi L
Hi Jean, > From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Thursday, September 27, 2018 9:38 PM > To: Liu, Yi L ; Joerg Roedel > Subject: Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces > > On 27/09/2018 04:22, Liu, Yi L wrote: >

Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-10-03 Thread Jean-Philippe Brucker
On 26/09/2018 23:35, Jacob Pan wrote: > On Thu, 20 Sep 2018 18:00:39 +0100 > Jean-Philippe Brucker wrote: > >> + >> +static int io_mm_attach(struct iommu_domain *domain, struct device >> *dev, >> +struct io_mm *io_mm, void *drvdata) >> +{ >> +int ret; >> +bool

Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-09-27 Thread Jean-Philippe Brucker
On 27/09/2018 04:22, Liu, Yi L wrote: >> For the "classic" vfio-pci case, "SVA in guest" still means giving the >> guest control over the whole PASID table. > > No, if giving guest control over the whole PASID table, it means guest may > have > its own PASID namespace. right? And for vfio-mdev

RE: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-09-26 Thread Liu, Yi L
> From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- > boun...@lists.linux-foundation.org] On Behalf Of Jean-Philippe Brucker > Sent: Wednesday, September 26, 2018 9:50 PM > Subject: Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces > > On 26/09/2018 1

Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-09-26 Thread Jacob Pan
On Wed, 26 Sep 2018 14:45:27 +0200 Joerg Roedel wrote: > On Wed, Sep 26, 2018 at 11:20:34AM +0100, Jean-Philippe Brucker wrote: > > Yes, at the moment it's difficult to guess what device drivers will > > want, but I can imagine some driver offering SVA to userspace, while > > keeping a few

Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-09-26 Thread Jacob Pan
On Thu, 20 Sep 2018 18:00:39 +0100 Jean-Philippe Brucker wrote: > + > +static int io_mm_attach(struct iommu_domain *domain, struct device > *dev, > + struct io_mm *io_mm, void *drvdata) > +{ > + int ret; > + bool attach_domain = true; > + int pasid = io_mm->pasid;

Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-09-26 Thread Jean-Philippe Brucker
On 26/09/2018 13:45, Joerg Roedel wrote: > On Wed, Sep 26, 2018 at 11:20:34AM +0100, Jean-Philippe Brucker wrote: >> Yes, at the moment it's difficult to guess what device drivers will >> want, but I can imagine some driver offering SVA to userspace, while >> keeping a few PASIDs for themselves to

Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-09-26 Thread Joerg Roedel
On Wed, Sep 26, 2018 at 11:20:34AM +0100, Jean-Philippe Brucker wrote: > Yes, at the moment it's difficult to guess what device drivers will > want, but I can imagine some driver offering SVA to userspace, while > keeping a few PASIDs for themselves to map kernel memory. Or create mdev > devices

Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-09-26 Thread Jean-Philippe Brucker
On 26/09/2018 00:33, Lu Baolu wrote: > Hi Joerg, > > On 09/25/2018 09:26 PM, Joerg Roedel wrote: >> On Tue, Sep 25, 2018 at 11:15:40AM +0800, Lu Baolu wrote: >>> This might be problematic for vt-d (and other possible arch's which use >>> PASID other than SVA). When vt-d iommu works in scalable

Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-09-25 Thread Lu Baolu
Hi, On 09/25/2018 06:32 PM, Jean-Philippe Brucker wrote: On 25/09/2018 04:15, Lu Baolu wrote: + /* If an io_mm already exists, use it */ + spin_lock(_sva_lock); + idr_for_each_entry(_pasid_idr, io_mm, i) { This might be problematic for vt-d (and other possible arch's which use

Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-09-25 Thread Lu Baolu
Hi Joerg, On 09/25/2018 09:26 PM, Joerg Roedel wrote: On Tue, Sep 25, 2018 at 11:15:40AM +0800, Lu Baolu wrote: This might be problematic for vt-d (and other possible arch's which use PASID other than SVA). When vt-d iommu works in scalable mode, a PASID might be allocated for: (1) SVA (2)

Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-09-25 Thread Joerg Roedel
On Tue, Sep 25, 2018 at 11:15:40AM +0800, Lu Baolu wrote: > This might be problematic for vt-d (and other possible arch's which use > PASID other than SVA). When vt-d iommu works in scalable mode, a PASID > might be allocated for: > > (1) SVA > (2) Device Assignable Interface (might be a mdev or

Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-09-25 Thread Jean-Philippe Brucker
On 25/09/2018 04:15, Lu Baolu wrote: >> + /* If an io_mm already exists, use it */ >> + spin_lock(_sva_lock); >> + idr_for_each_entry(_pasid_idr, io_mm, i) { > > This might be problematic for vt-d (and other possible arch's which use > PASID other than SVA). When vt-d iommu works in

Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-09-24 Thread Lu Baolu
Hi, On 09/21/2018 01:00 AM, Jean-Philippe Brucker wrote: Allocate IOMMU mm structures and bind them to devices. Four operations are added to IOMMU drivers: * mm_alloc(): to create an io_mm structure and perform architecture- specific operations required to grab the process (for instance on