Re: [PATCH 2/2] iommu: Move pasid array from group to device

From: Baolu Lu
Date: Tue Aug 01 2023 - 04:40:29 EST


On 2023/8/1 16:07, tina.zhang wrote:
Hi Baolu,

Hi Tina,

Although this patch moves the domain reference pointer from a per-group
structure to a per-device structure, the domain life-cycle is still
expected to be managed per-group (i.e., iommu_domain_free() is called in
iommu_group_release()). Is this what we expect?

The lifecycle of an iommu domain is independent of the lifecycle of the
iommu group that it is attached to. The system domains, such as the
default domain and the blocking domain, are allocated and managed by the
iommu core. These domains are freed when the group is freed.

However, any device driver can allocate its own iommu domains. The
device driver can set/remove the domain to/from the RID or PASID of the
device.

Best regards,
baolu