public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Yi Liu <yi.l.liu@intel.com>
To: Baolu Lu <baolu.lu@linux.intel.com>, <joro@8bytes.org>,
	<jgg@nvidia.com>, <kevin.tian@intel.com>
Cc: <alex.williamson@redhat.com>, <eric.auger@redhat.com>,
	<nicolinc@nvidia.com>, <kvm@vger.kernel.org>,
	<chao.p.peng@linux.intel.com>, <iommu@lists.linux.dev>,
	<zhenzhong.duan@intel.com>, <vasant.hegde@amd.com>,
	<will@kernel.org>
Subject: Re: [PATCH v3 5/7] iommu/vt-d: Make the blocked domain support PASID
Date: Tue, 5 Nov 2024 13:11:13 +0800	[thread overview]
Message-ID: <421c5022-eeef-42b4-b173-63e52d6f4361@intel.com> (raw)
In-Reply-To: <557b9c59-1ecb-485a-9e36-c926180a199b@linux.intel.com>

On 2024/11/5 11:46, Baolu Lu wrote:
> On 11/4/24 21:20, Yi Liu wrote:
>> @@ -4291,15 +4296,18 @@ void domain_remove_dev_pasid(struct iommu_domain 
>> *domain,
>>       kfree(dev_pasid);
>>   }
>> -static void intel_iommu_remove_dev_pasid(struct device *dev, ioasid_t 
>> pasid,
>> -                     struct iommu_domain *domain)
>> +static int blocking_domain_set_dev_pasid(struct iommu_domain *domain,
>> +                     struct device *dev, ioasid_t pasid,
>> +                     struct iommu_domain *old)
>>   {
>>       struct device_domain_info *info = dev_iommu_priv_get(dev);
>>       struct intel_iommu *iommu = info->iommu;
>>       intel_pasid_tear_down_entry(iommu, dev, pasid, false);
>>       intel_drain_pasid_prq(dev, pasid);
>> -    domain_remove_dev_pasid(domain, dev, pasid);
>> +    domain_remove_dev_pasid(old, dev, pasid);
>> +
>> +    return 0;
>>   }
>>   struct dev_pasid_info *
>> @@ -4664,7 +4672,6 @@ const struct iommu_ops intel_iommu_ops = {
>>       .dev_disable_feat    = intel_iommu_dev_disable_feat,
>>       .is_attach_deferred    = intel_iommu_is_attach_deferred,
>>       .def_domain_type    = device_def_domain_type,
>> -    .remove_dev_pasid    = intel_iommu_remove_dev_pasid,
> 
> This will cause iommu_attach_device_pasid() to fail due to the check and
> failure condition introduced in patch 1/7.

the check introduced in patch 1 were enhanced in patch 3. So removing
remove_dev_pasid op does not fail as intel iommu driver provides
blocked domain which has the set_dev_pasid op.

-- 
Regards,
Yi Liu

  reply	other threads:[~2024-11-05  5:06 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04 13:20 [PATCH v3 0/7] Support attaching PASID to the blocked_domain Yi Liu
2024-11-04 13:20 ` [PATCH v3 1/7] iommu: Prevent pasid attach if no ops->remove_dev_pasid Yi Liu
2024-11-05 15:42   ` Jason Gunthorpe
2024-11-07  9:33     ` Tian, Kevin
2024-11-07 10:02       ` Yi Liu
2024-11-04 13:20 ` [PATCH v3 2/7] iommu: Consolidate the ops->remove_dev_pasid usage into a helper Yi Liu
2024-11-05 15:42   ` Jason Gunthorpe
2024-11-06  9:33   ` Vasant Hegde
2024-11-07  9:34   ` Tian, Kevin
2024-11-04 13:20 ` [PATCH v3 3/7] iommu: Detaching pasid by attaching to the blocked_domain Yi Liu
2024-11-05 15:42   ` Jason Gunthorpe
2024-11-06  9:37   ` Vasant Hegde
2024-11-07  9:35   ` Tian, Kevin
2024-11-07 10:04     ` Yi Liu
2024-11-04 13:20 ` [PATCH v3 4/7] iommu/arm-smmu-v3: Make the blocked domain support PASID Yi Liu
2024-11-04 13:20 ` [PATCH v3 5/7] iommu/vt-d: " Yi Liu
2024-11-05  3:46   ` Baolu Lu
2024-11-05  5:11     ` Yi Liu [this message]
2024-11-05  5:45       ` Baolu Lu
2024-11-05 15:43   ` Jason Gunthorpe
2024-11-04 13:20 ` [PATCH v3 6/7] iommu/amd: " Yi Liu
2024-11-05 15:44   ` Jason Gunthorpe
2024-11-06  9:27   ` Vasant Hegde
2024-11-07  9:36   ` Tian, Kevin
2024-11-04 13:20 ` [PATCH v3 7/7] iommu: Remove the remove_dev_pasid op Yi Liu
2024-11-05 15:44   ` Jason Gunthorpe
2024-11-06  9:39   ` Vasant Hegde
2024-11-07  9:37   ` Tian, Kevin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=421c5022-eeef-42b4-b173-63e52d6f4361@intel.com \
    --to=yi.l.liu@intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=chao.p.peng@linux.intel.com \
    --cc=eric.auger@redhat.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=nicolinc@nvidia.com \
    --cc=vasant.hegde@amd.com \
    --cc=will@kernel.org \
    --cc=zhenzhong.duan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox