[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ff4426d8-c76e-dd9b-96b9-fc35eede00c4@linux.intel.com>
Date: Tue, 12 Apr 2022 20:08:16 +0800
From: Lu Baolu <baolu.lu@...ux.intel.com>
To: "Tian, Kevin" <kevin.tian@...el.com>,
Joerg Roedel <joro@...tes.org>,
Jason Gunthorpe <jgg@...dia.com>,
Christoph Hellwig <hch@...radead.org>,
"Raj, Ashok" <ashok.raj@...el.com>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>,
Jean-Philippe Brucker <jean-philippe@...aro.com>
Cc: baolu.lu@...ux.intel.com, Eric Auger <eric.auger@...hat.com>,
"Liu, Yi L" <yi.l.liu@...el.com>,
"Pan, Jacob jun" <jacob.jun.pan@...el.com>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RFC v3 04/12] iommu/sva: Basic data structures for SVA
On 2022/4/12 14:56, Tian, Kevin wrote:
>> From: Lu Baolu <baolu.lu@...ux.intel.com>
>> Sent: Sunday, April 10, 2022 6:25 PM
>>
>> Use below data structures for SVA implementation in the IOMMU core:
>>
>> - struct iommu_sva_ioas
>> Represent the I/O address space shared with an application CPU address
>> space. This structure has a 1:1 relationship with an mm_struct. It
>> graps a "mm->mm_count" refcount during creation and drop it on release.
>
> s/graps/grabs
Thanks!
>
>>
>> - struct iommu_domain (IOMMU_DOMAIN_SVA type)
>> Represent a hardware pagetable that the IOMMU hardware could use for
>> SVA translation. Multiple iommu domains could be bound with an SVA ioas
>> and each graps a refcount from ioas in order to make sure ioas could
>> only be freed after all domains have been unbound.
>>
>> - struct iommu_sva
>> Represent a bond relationship between an SVA ioas and an iommu domain.
>> If a bond already exists, it's reused and a reference is taken.
>>
>> Signed-off-by: Lu Baolu <baolu.lu@...ux.intel.com>
>
> btw given the actually intention of above structures does it make more
> sense to s/iommu_sva_ioas/iommu_sva/ and s/iommu_sva/iommu_sva_bond?
The use of iommu_sva has been scattered in external files as it's the
return type or parameter of the the iommu sva intefaces:
$ git grep "struct iommu_sva" :^drivers/iommu :^include/linux
drivers/dma/idxd/cdev.c: struct iommu_sva *sva;
drivers/dma/idxd/cdev.c: struct iommu_sva *sva;
drivers/dma/idxd/idxd.h: struct iommu_sva *sva;
drivers/dma/idxd/init.c: struct iommu_sva *sva;
drivers/misc/uacce/uacce.c: struct iommu_sva *handle;
Your suggestion makes sense to me as I've also thought about it. :-)
It might be easier to arrive there through a separated cleanup series.
Best regards,
baolu
Powered by blists - more mailing lists