Hi BaoLu,
On Thu, 20 May 2021 11:15:21 +0800, Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
wrote:
We are about to use iommu_sva_alloc/free_pasid() helpers in iommu core.I feel a little awkward to have a separate xarray for storing per IOASID
That means the pasid life cycle will be managed by iommu core. Use a
local array to save the per pasid private data instead of attaching it
the real pasid.
data. Seems duplicated.
Jason suggested in another thread that we can make ioasid_data public
and embeded in struct intel_svm, then we can get rid of the private data
pointer. ioasid_find will return the ioasid_data, then we can retrieve the
private data with container_of.
roughly,
struct intel_svm {
...
struct ioasid_data;
};
struct ioasid_data {
ioasid_t id;
refcount_t refs;
struct mm_struct *mm;
};
This can be a separate patch/effort if it make sense to you.