Re: [RFCv2 PATCH 05/36] iommu/process: Bind and unbind process to and from devices

2018-01-19 Thread okaya
On 2018-01-19 05:27, Jean-Philippe Brucker wrote: Hi Sinan, On 19/01/18 04:52, Sinan Kaya wrote: Hi Jean-Philippe, On 10/6/2017 9:31 AM, Jean-Philippe Brucker wrote: /** + * iommu_process_bind_device - Bind a process address space to a device + * @dev: the device + * @task: the process to

Re: [RFCv2 PATCH 05/36] iommu/process: Bind and unbind process to and from devices

2018-01-19 Thread Jean-Philippe Brucker
Hi Sinan, On 19/01/18 04:52, Sinan Kaya wrote: > Hi Jean-Philippe, > > On 10/6/2017 9:31 AM, Jean-Philippe Brucker wrote: >> /** >> + * iommu_process_bind_device - Bind a process address space to a device >> + * @dev: the device >> + * @task: the process to bind >> + * @pasid: valid address wher

Re: [RFCv2 PATCH 05/36] iommu/process: Bind and unbind process to and from devices

2018-01-18 Thread Sinan Kaya
Hi Jean-Philippe, On 10/6/2017 9:31 AM, Jean-Philippe Brucker wrote: > /** > + * iommu_process_bind_device - Bind a process address space to a device > + * @dev: the device > + * @task: the process to bind > + * @pasid: valid address where the PASID will be stored > + * @flags: bond properties (I

Re: [RFCv2 PATCH 05/36] iommu/process: Bind and unbind process to and from devices

2017-11-30 Thread Jean-Philippe Brucker
On 30/11/17 01:11, Yisheng Xie wrote: > Hi, Jean, > > On 2017/11/29 23:01, Jean-Philippe Brucker wrote: >> On 29/11/17 06:08, Yisheng Xie wrote: >>> >>> >>> On 2017/10/6 21:31, Jean-Philippe Brucker wrote: +int iommu_process_bind_device(struct device *dev, struct task_struct *task,

Re: [RFCv2 PATCH 05/36] iommu/process: Bind and unbind process to and from devices

2017-11-29 Thread Yisheng Xie
Hi, Jean, On 2017/11/29 23:01, Jean-Philippe Brucker wrote: > On 29/11/17 06:08, Yisheng Xie wrote: >> >> >> On 2017/10/6 21:31, Jean-Philippe Brucker wrote: >>> +int iommu_process_bind_device(struct device *dev, struct task_struct *task, >>> + int *pasid, int flags) >>> +{

Re: [RFCv2 PATCH 05/36] iommu/process: Bind and unbind process to and from devices

2017-11-29 Thread Jean-Philippe Brucker
On 29/11/17 06:08, Yisheng Xie wrote: > > > On 2017/10/6 21:31, Jean-Philippe Brucker wrote: >> +int iommu_process_bind_device(struct device *dev, struct task_struct *task, >> + int *pasid, int flags) >> +{ > [..] >> +err = iommu_process_attach_locked(

Re: [RFCv2 PATCH 05/36] iommu/process: Bind and unbind process to and from devices

2017-11-28 Thread Yisheng Xie
On 2017/10/6 21:31, Jean-Philippe Brucker wrote: > +int iommu_process_bind_device(struct device *dev, struct task_struct *task, > + int *pasid, int flags) > +{ [..] > + err = iommu_process_attach_locked(context, dev); > + if (err)

Re: [RFCv2 PATCH 05/36] iommu/process: Bind and unbind process to and from devices

2017-11-02 Thread Jean-Philippe Brucker
On 21/10/17 16:47, Sinan Kaya wrote: > Just some improvement suggestions. > > On 10/6/2017 9:31 AM, Jean-Philippe Brucker wrote: >> +spin_lock(&iommu_process_lock); >> +idr_for_each_entry(&iommu_process_idr, process, i) { >> +if (process->pid != pid) >> +con

Re: [RFCv2 PATCH 05/36] iommu/process: Bind and unbind process to and from devices

2017-10-21 Thread Sinan Kaya
Just some improvement suggestions. On 10/6/2017 9:31 AM, Jean-Philippe Brucker wrote: > + spin_lock(&iommu_process_lock); > + idr_for_each_entry(&iommu_process_idr, process, i) { > + if (process->pid != pid) > + continue; if you see this construct a lot, thi

Re: [RFCv2 PATCH 05/36] iommu/process: Bind and unbind process to and from devices

2017-10-12 Thread Joerg Roedel
Hi Jean-Philippe, On Thu, Oct 12, 2017 at 12:13:20PM +0100, Jean-Philippe Brucker wrote: > On 11/10/17 12:33, Joerg Roedel wrote: > > Here is how I think the base API should look like: > > > > * iommu_iovm_device_init(struct device *dev); > > iommu_iovm_device_shutdown(struct device *de

Re: [RFCv2 PATCH 05/36] iommu/process: Bind and unbind process to and from devices

2017-10-12 Thread Jean-Philippe Brucker
Hi Joerg, On 11/10/17 12:33, Joerg Roedel wrote: > Hi Jean-Philipe, > > Thanks for your patches, this is definitly a step in the right direction > to get generic support for IO virtual memory into the IOMMU core code. > > But I see an issue with the design around task_struct, please see > below.

Re: [RFCv2 PATCH 05/36] iommu/process: Bind and unbind process to and from devices

2017-10-11 Thread Joerg Roedel
Hi Jean-Philipe, Thanks for your patches, this is definitly a step in the right direction to get generic support for IO virtual memory into the IOMMU core code. But I see an issue with the design around task_struct, please see below. On Fri, Oct 06, 2017 at 02:31:32PM +0100, Jean-Philippe Brucke

[RFCv2 PATCH 05/36] iommu/process: Bind and unbind process to and from devices

2017-10-06 Thread Jean-Philippe Brucker
Add bind and unbind operations to the IOMMU API. Device drivers can use them to share process page tables with their device. iommu_process_bind_group is provided for VFIO's convenience, as it needs to provide a coherent interface on containers. Device drivers will most likely want to use iommu_proc