lkml.org 
[lkml]   [2023]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 2/3] iommu/arm-smmu-v3-sva: Remove bond refcount
On Tue, Sep 05, 2023 at 07:49:13PM +0800, Michael Shavit wrote:
> Always allocate a new arm_smmu_bond in __arm_smmu_sva_bind and remove
> the bond refcount since arm_smmu_bond can never be shared across calls
> to __arm_smmu_sva_bind.
>
> The iommu framework will not allocate multiple SVA domains for the same
> (device/mm) pair, nor will it call set_dev_pasid for a device if a
> domain is already attached on the given pasid. There's also a one-to-one
> mapping between MM and PASID. __arm_smmu_sva_bind is therefore never
> called with the same (device/mm) pair, and so there's no reason to try
> and normalize allocations of the arm_smmu_bond struct for a (device/mm)
> pair across set_dev_pasid.
>
> Signed-off-by: Michael Shavit <mshavit@google.com>
> ---
> Note that this is true today because iommu_sva_bind_device calls
> iommu_get_domain_for_dev_pasid to elude the iommu_attach_device_pasid if
> a domain is already attached.
> But even with Tina's patch series where iommu_get_domain_for_dev_pasid
> is no longer used, iommu_attach_device_pasid also checks whether a
> domain is already attached in the group's pasid_array.
>
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 12 +-----------
> 1 file changed, 1 insertion(+), 11 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

\
 
 \ /
  Last update: 2023-09-05 18:54    [W:0.199 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site