Re: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-11-23 Thread Bob Liu
On 2017/11/22 21:04, Jean-Philippe Brucker wrote: > On 22/11/17 03:15, Bob Liu wrote: >> Hey Jean, >> >> On 2017/10/6 21:31, Jean-Philippe Brucker wrote: >>> IOMMU drivers need a way to bind Linux processes to devices. This is used >>> for Shared Virtual Memory (SVM), where devices support paging.

Re: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-11-22 Thread Jean-Philippe Brucker
On 22/11/17 03:15, Bob Liu wrote: > Hey Jean, > > On 2017/10/6 21:31, Jean-Philippe Brucker wrote: >> IOMMU drivers need a way to bind Linux processes to devices. This is used >> for Shared Virtual Memory (SVM), where devices support paging. In that >> mode, DMA can directly target virtual

Re: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-11-21 Thread Bob Liu
Hey Jean, On 2017/10/6 21:31, Jean-Philippe Brucker wrote: > IOMMU drivers need a way to bind Linux processes to devices. This is used > for Shared Virtual Memory (SVM), where devices support paging. In that > mode, DMA can directly target virtual addresses of a process. > > Introduce

RE: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-11-13 Thread Bharat Kumar Gogada
> > In this case even though hardware supports PASID, BIND flow fails. It should fail, since we're reserving PASID 0 for non-PASID transactions with S1DSS=0b10. In addition, the SMMUv3 specification does not allow using PASID with a single entry. See the description of S1CDMax in 5.2

Re: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-11-09 Thread Jean-Philippe Brucker
Hi Bharat, On 11/08/2017 05:50 PM, Bharat Kumar Gogada wrote: > Hi Jean, > > +static struct iommu_process * > +iommu_process_alloc(struct iommu_domain *domain, struct task_struct > +*task) { > + int err; > + int pasid; > + struct iommu_process *process; > + > + if

Re: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-11-09 Thread Jean-Philippe Brucker
Hi Bharat, On 11/08/2017 05:50 PM, Bharat Kumar Gogada wrote: > Hi Jean, > > +static struct iommu_process * > +iommu_process_alloc(struct iommu_domain *domain, struct task_struct > +*task) { > + int err; > + int pasid; > + struct iommu_process *process; > + > + if

RE: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-11-08 Thread Bharat Kumar Gogada
Hi Jean, +static struct iommu_process * +iommu_process_alloc(struct iommu_domain *domain, struct task_struct +*task) { + int err; + int pasid; + struct iommu_process *process; + + if (WARN_ON(!domain->ops->process_alloc || !domain->ops->process_free)) +

Re: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-11-02 Thread Jean-Philippe Brucker
Hi Sinan, Sorry for the delay, thanks for reviewing this! On 21/10/17 00:32, Sinan Kaya wrote: > few nits below. > >> +/* >> + * Allocate a iommu_process structure for the given task. >> + * >> + * Ideally we shouldn't need the domain parameter, since iommu_process is >> + * system-wide, but we

Re: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-10-30 Thread Jean-Philippe Brucker
On 25/10/17 19:05, Raj, Ashok wrote: > Hi Jean > > On Mon, Oct 23, 2017 at 01:17:07PM +0100, Jean-Philippe Brucker wrote: >> On 23/10/17 12:04, Liu, Yi L wrote: + idr_preload(GFP_KERNEL); + spin_lock(_process_lock); + pasid = idr_alloc_cyclic(_process_idr, process,

Re: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-10-25 Thread Raj, Ashok
Hi Jean On Mon, Oct 23, 2017 at 01:17:07PM +0100, Jean-Philippe Brucker wrote: > On 23/10/17 12:04, Liu, Yi L wrote: > >> + idr_preload(GFP_KERNEL); > >> + spin_lock(_process_lock); > >> + pasid = idr_alloc_cyclic(_process_idr, process, domain->min_pasid, > >> +

Re: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-10-23 Thread Jean-Philippe Brucker
On 23/10/17 12:04, Liu, Yi L wrote: >> +idr_preload(GFP_KERNEL); >> +spin_lock(_process_lock); >> +pasid = idr_alloc_cyclic(_process_idr, process, domain->min_pasid, >> + domain->max_pasid + 1, GFP_ATOMIC); >> +process->pasid = pasid; > > [Liu, Yi L] If

RE: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-10-23 Thread Liu, Yi L
com; Liu, Yi > L <yi.l@intel.com>; Raj, Ashok <ashok....@intel.com>; robdcl...@gmail.com > Subject: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs > > IOMMU drivers need a way to bind Linux processes to devices. This is used for > Shared Virtual Memory (SV

Re: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-10-20 Thread Sinan Kaya
few nits below. > +/* > + * Allocate a iommu_process structure for the given task. > + * > + * Ideally we shouldn't need the domain parameter, since iommu_process is > + * system-wide, but we use it to retrieve the driver's allocation ops and a > + * PASID range. > + */ > +static struct

[RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-10-06 Thread Jean-Philippe Brucker
IOMMU drivers need a way to bind Linux processes to devices. This is used for Shared Virtual Memory (SVM), where devices support paging. In that mode, DMA can directly target virtual addresses of a process. Introduce boilerplate code for allocating process structures and binding them to devices.