Re: [PATCH RFC 02/19] iommufd: Dirty tracking for io_pagetable

2022-05-02 Thread Joao Martins
On 4/30/22 00:51, Baolu Lu wrote: > On 2022/4/29 05:09, Joao Martins wrote: >> +int iopt_set_dirty_tracking(struct io_pagetable *iopt, >> +struct iommu_domain *domain, bool enable) >> +{ >> +struct iommu_domain *dom; >> +unsigned long index; >> +int ret = -EOPNOT

Re: [PATCH RFC 02/19] iommufd: Dirty tracking for io_pagetable

2022-04-29 Thread Baolu Lu
On 2022/4/29 05:09, Joao Martins wrote: +int iopt_set_dirty_tracking(struct io_pagetable *iopt, + struct iommu_domain *domain, bool enable) +{ + struct iommu_domain *dom; + unsigned long index; + int ret = -EOPNOTSUPP; + + down_write(&iopt->iova_r

Re: [PATCH RFC 02/19] iommufd: Dirty tracking for io_pagetable

2022-04-29 Thread Joao Martins
On 4/29/22 12:56, Jason Gunthorpe wrote: > On Fri, Apr 29, 2022 at 08:07:14AM +, Tian, Kevin wrote: >>> From: Joao Martins >>> Sent: Friday, April 29, 2022 5:09 AM >>> >>> +static int __set_dirty_tracking_range_locked(struct iommu_domain >>> *domain, >> >> suppose anything using iommu_domain a

Re: [PATCH RFC 02/19] iommufd: Dirty tracking for io_pagetable

2022-04-29 Thread Jason Gunthorpe via iommu
On Fri, Apr 29, 2022 at 08:07:14AM +, Tian, Kevin wrote: > > From: Joao Martins > > Sent: Friday, April 29, 2022 5:09 AM > > > > +static int __set_dirty_tracking_range_locked(struct iommu_domain > > *domain, > > suppose anything using iommu_domain as the first argument should > be put in the

Re: [PATCH RFC 02/19] iommufd: Dirty tracking for io_pagetable

2022-04-29 Thread Joao Martins
On 4/29/22 09:07, Tian, Kevin wrote: >> From: Joao Martins >> Sent: Friday, April 29, 2022 5:09 AM >> >> +static int __set_dirty_tracking_range_locked(struct iommu_domain >> *domain, > > suppose anything using iommu_domain as the first argument should > be put in the iommu layer. Here it's more r

RE: [PATCH RFC 02/19] iommufd: Dirty tracking for io_pagetable

2022-04-29 Thread Tian, Kevin
> From: Joao Martins > Sent: Friday, April 29, 2022 5:09 AM > > +static int __set_dirty_tracking_range_locked(struct iommu_domain > *domain, suppose anything using iommu_domain as the first argument should be put in the iommu layer. Here it's more reasonable to use iopt as the first argument or

[PATCH RFC 02/19] iommufd: Dirty tracking for io_pagetable

2022-04-28 Thread Joao Martins
Add an io_pagetable kernel API to toggle dirty tracking: * iopt_set_dirty_tracking(iopt, [domain], state) It receives either NULL (which means all domains) or an iommu_domain. The intended caller of this is via the hw_pagetable object that is created on device attach, which passes an iommu_domain