[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9875863a-eba5-c8fa-a39b-7d3300e3b5ca@linux.intel.com>
Date: Fri, 14 Jul 2023 11:28:14 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: "Tian, Kevin" <kevin.tian@...el.com>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>,
LKML <linux-kernel@...r.kernel.org>,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
Joerg Roedel <joro@...tes.org>,
Jean-Philippe Brucker <jean-philippe@...aro.com>,
Robin Murphy <robin.murphy@....com>
Cc: baolu.lu@...ux.intel.com, Jason Gunthorpe <jgg@...dia.com>,
Will Deacon <will@...nel.org>,
"Liu, Yi L" <yi.l.liu@...el.com>,
"Yu, Fenghua" <fenghua.yu@...el.com>,
"Luck, Tony" <tony.luck@...el.com>
Subject: Re: [PATCH v10 5/7] iommu/vt-d: Make prq draining code generic
On 2023/7/13 15:49, Tian, Kevin wrote:
>> From: Jacob Pan <jacob.jun.pan@...ux.intel.com>
>> Sent: Thursday, July 13, 2023 12:34 AM
>>
>> - /* Domain type specific cleanup: */
>> domain = iommu_get_domain_for_dev_pasid(dev, pasid, 0);
>> - if (domain) {
>> - switch (domain->type) {
>> - case IOMMU_DOMAIN_SVA:
>> - intel_svm_remove_dev_pasid(dev, pasid);
>> - break;
>> - default:
>> - /* should never reach here */
>> - WARN_ON(1);
>> - break;
>> - }
>> + if (!domain)
>> + goto out_tear_down;
>
> WARN_ON()
Why?
My understanding is that remve_device_pasid could be call in any context
including no domain attached.
>
>> * large and has to be physically contiguous. So it's
>> * hard to be as defensive as we might like.
>> */
>> - intel_pasid_tear_down_entry(iommu, dev, svm->pasid,
>> false);
>> - intel_svm_drain_prq(dev, svm->pasid);
>
> after removing the 2 lines the comment above becomes stale.
Yes.
>
>> -static void intel_svm_drain_prq(struct device *dev, u32 pasid)
>> +void intel_drain_pasid_prq(struct device *dev, u32 pasid)
>> {
>> struct device_domain_info *info;
>> struct dmar_domain *domain;
>
> later we should move generic prq handling logic out of svm.c into
> a new prq.c
Yes.
Best regards,
baolu
Powered by blists - more mailing lists