RE: [PATCH v3 01/12] iommu/vt-d: Add cache tag assignment interface
From: Tian, Kevin
Date: Tue Apr 23 2024 - 05:02:07 EST
> From: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> Sent: Tuesday, April 16, 2024 4:07 PM
>
> @@ -1757,6 +1759,9 @@ int domain_attach_iommu(struct dmar_domain
> *domain, struct intel_iommu *iommu)
> unsigned long ndomains;
> int num, ret = -ENOSPC;
>
> + if (domain->domain.type == IOMMU_DOMAIN_SVA)
> + return 0;
> +
> info = kzalloc(sizeof(*info), GFP_KERNEL);
> if (!info)
> return -ENOMEM;
> @@ -1804,6 +1809,9 @@ void domain_detach_iommu(struct dmar_domain
> *domain, struct intel_iommu *iommu)
> {
> struct iommu_domain_info *info;
>
> + if (domain->domain.type == IOMMU_DOMAIN_SVA)
> + return;
> +
> spin_lock(&iommu->lock);
> info = xa_load(&domain->iommu_array, iommu->seq_id);
> if (--info->refcnt == 0) {
above two are not called for SVA. Why do they start checking
SVA type now?