Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-25 Thread Baolu Lu
On 2022/5/25 23:25, Jason Gunthorpe wrote: On Wed, May 25, 2022 at 01:19:08PM +0800, Baolu Lu wrote: Hi Jason, On 2022/5/24 21:44, Jason Gunthorpe wrote: diff --git a/drivers/iommu/iommu-sva-lib.c b/drivers/iommu/iommu-sva-lib.c index 106506143896..210c376f6043 100644 +++

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-25 Thread Jason Gunthorpe via iommu
On Wed, May 25, 2022 at 01:19:08PM +0800, Baolu Lu wrote: > Hi Jason, > > On 2022/5/24 21:44, Jason Gunthorpe wrote: > > > diff --git a/drivers/iommu/iommu-sva-lib.c b/drivers/iommu/iommu-sva-lib.c > > > index 106506143896..210c376f6043 100644 > > > +++ b/drivers/iommu/iommu-sva-lib.c > > > @@

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-25 Thread Baolu Lu
On 2022/5/25 19:06, Jean-Philippe Brucker wrote: On Wed, May 25, 2022 at 11:07:49AM +0100, Robin Murphy wrote: Did you mean @handler and @handler_token staffs below? struct iommu_domain {     unsigned type;     const struct iommu_domain_ops *ops;     unsigned long

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-25 Thread Jean-Philippe Brucker
On Wed, May 25, 2022 at 11:07:49AM +0100, Robin Murphy wrote: > > Did you mean @handler and @handler_token staffs below? > > > > struct iommu_domain { > >     unsigned type; > >     const struct iommu_domain_ops *ops; > >     unsigned long pgsize_bitmap;    /* Bitmap of page sizes

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-25 Thread Robin Murphy
On 2022-05-25 07:20, Baolu Lu wrote: Hi Robin, On 2022/5/24 22:36, Robin Murphy wrote: On 2022-05-19 08:20, Lu Baolu wrote: [...] diff --git a/drivers/iommu/iommu-sva-lib.c b/drivers/iommu/iommu-sva-lib.c index 106506143896..210c376f6043 100644 --- a/drivers/iommu/iommu-sva-lib.c +++

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-25 Thread Baolu Lu
Hi Robin, On 2022/5/24 22:36, Robin Murphy wrote: On 2022-05-19 08:20, Lu Baolu wrote: [...] diff --git a/drivers/iommu/iommu-sva-lib.c b/drivers/iommu/iommu-sva-lib.c index 106506143896..210c376f6043 100644 --- a/drivers/iommu/iommu-sva-lib.c +++ b/drivers/iommu/iommu-sva-lib.c @@ -69,3

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-24 Thread Baolu Lu
On 2022/5/24 21:44, Jason Gunthorpe wrote: +{ + struct iommu_sva_domain *sva_domain; + struct iommu_domain *domain; + + if (!bus->iommu_ops || !bus->iommu_ops->sva_domain_ops) + return ERR_PTR(-ENODEV); + + sva_domain = kzalloc(sizeof(*sva_domain),

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-24 Thread Baolu Lu
Hi Jason, On 2022/5/24 21:44, Jason Gunthorpe wrote: diff --git a/drivers/iommu/iommu-sva-lib.c b/drivers/iommu/iommu-sva-lib.c index 106506143896..210c376f6043 100644 +++ b/drivers/iommu/iommu-sva-lib.c @@ -69,3 +69,51 @@ struct mm_struct *iommu_sva_find(ioasid_t pasid) return

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-24 Thread Baolu Lu
On 2022/5/24 17:39, Tian, Kevin wrote: From: Lu Baolu Sent: Thursday, May 19, 2022 3:21 PM The iommu_sva_domain represents a hardware pagetable that the IOMMU hardware could use for SVA translation. This adds some infrastructure to support SVA domain in the iommu common layer. It includes: -

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-24 Thread Baolu Lu
On 2022/5/25 08:44, Tian, Kevin wrote: From: Jason Gunthorpe Sent: Tuesday, May 24, 2022 9:39 PM On Tue, May 24, 2022 at 09:39:52AM +, Tian, Kevin wrote: From: Lu Baolu Sent: Thursday, May 19, 2022 3:21 PM The iommu_sva_domain represents a hardware pagetable that the IOMMU hardware

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-24 Thread Baolu Lu
On 2022/5/24 17:44, Tian, Kevin wrote: From: Baolu Lu Sent: Monday, May 23, 2022 3:13 PM @@ -254,6 +259,7 @@ struct iommu_ops { int (*def_domain_type)(struct device *dev); const struct iommu_domain_ops *default_domain_ops; + const struct iommu_domain_ops *sva_domain_ops;

RE: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-24 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, May 24, 2022 9:39 PM > > On Tue, May 24, 2022 at 09:39:52AM +, Tian, Kevin wrote: > > > From: Lu Baolu > > > Sent: Thursday, May 19, 2022 3:21 PM > > > > > > The iommu_sva_domain represents a hardware pagetable that the > IOMMU > > > hardware could

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-24 Thread Robin Murphy
On 2022-05-19 08:20, Lu Baolu wrote: [...] diff --git a/drivers/iommu/iommu-sva-lib.c b/drivers/iommu/iommu-sva-lib.c index 106506143896..210c376f6043 100644 --- a/drivers/iommu/iommu-sva-lib.c +++ b/drivers/iommu/iommu-sva-lib.c @@ -69,3 +69,51 @@ struct mm_struct *iommu_sva_find(ioasid_t

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-24 Thread Jason Gunthorpe via iommu
On Thu, May 19, 2022 at 03:20:40PM +0800, Lu Baolu wrote: > The iommu_sva_domain represents a hardware pagetable that the IOMMU > hardware could use for SVA translation. This adds some infrastructure > to support SVA domain in the iommu common layer. It includes: > > - Add a new struct

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-24 Thread Jason Gunthorpe via iommu
On Tue, May 24, 2022 at 09:39:52AM +, Tian, Kevin wrote: > > From: Lu Baolu > > Sent: Thursday, May 19, 2022 3:21 PM > > > > The iommu_sva_domain represents a hardware pagetable that the IOMMU > > hardware could use for SVA translation. This adds some infrastructure > > to support SVA domain

RE: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-24 Thread Tian, Kevin
> From: Baolu Lu > Sent: Monday, May 23, 2022 3:13 PM > > @@ -254,6 +259,7 @@ struct iommu_ops { > > int (*def_domain_type)(struct device *dev); > > > > const struct iommu_domain_ops *default_domain_ops; > > + const struct iommu_domain_ops *sva_domain_ops; > > Per Joerg's comment in

RE: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-24 Thread Tian, Kevin
> From: Lu Baolu > Sent: Thursday, May 19, 2022 3:21 PM > > The iommu_sva_domain represents a hardware pagetable that the IOMMU > hardware could use for SVA translation. This adds some infrastructure > to support SVA domain in the iommu common layer. It includes: > > - Add a new struct

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-23 Thread Baolu Lu
On 2022/5/19 15:20, Lu Baolu wrote: The iommu_sva_domain represents a hardware pagetable that the IOMMU hardware could use for SVA translation. This adds some infrastructure to support SVA domain in the iommu common layer. It includes: - Add a new struct iommu_sva_domain and new

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-19 Thread Baolu Lu
On 2022/5/20 00:33, Jean-Philippe Brucker wrote: diff --git a/drivers/iommu/iommu-sva-lib.h b/drivers/iommu/iommu-sva-lib.h index 8909ea1094e3..1be21e6b93ec 100644 --- a/drivers/iommu/iommu-sva-lib.h +++ b/drivers/iommu/iommu-sva-lib.h @@ -7,6 +7,7 @@ #include #include +#include

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-19 Thread Jean-Philippe Brucker
On Thu, May 19, 2022 at 03:20:40PM +0800, Lu Baolu wrote: > The iommu_sva_domain represents a hardware pagetable that the IOMMU > hardware could use for SVA translation. This adds some infrastructure > to support SVA domain in the iommu common layer. It includes: > > - Add a new struct

[PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-19 Thread Lu Baolu
The iommu_sva_domain represents a hardware pagetable that the IOMMU hardware could use for SVA translation. This adds some infrastructure to support SVA domain in the iommu common layer. It includes: - Add a new struct iommu_sva_domain and new IOMMU_DOMAIN_SVA domain type. - Add a new domain