Re: [PATCH 1/2] iommu/vt-d: Set FPD when tearing down a PASID entry with fault_ignore
From: Baolu Lu
Date: Tue Nov 17 2026 - 23:29:46 EST
On 11/12/2026 1:58 PM, Tian, Kevin wrote:
From: Baolu Lu <baolu.lu@xxxxxxxxxxxxxxx>
Sent: Monday, November 9, 2026 3:35 PM
On 11/6/2026 6:01 AM, Vinicius Costa Gomes wrote:
Lu Baolu<baolu.lu@xxxxxxxxxxxxxxx> writes:intel_iommu *iommu, struct device *dev,
static void
pasid_cache_invalidation_with_pasid(struct intel_iommu *iommu,
u16 did, u32 pasid)
@@ -253,7 +238,6 @@ void intel_pasid_tear_down_entry(struct
intel_iommu *iommu, struct device *dev,
if (!pasid_pte_is_present(pte)) {
if (!pasid_pte_is_fault_disabled(pte)) {
- WARN_ON(READ_ONCE(pte->val[0]) != 0);
spin_unlock(&iommu->lock);
return;
}
@@ -266,6 +250,8 @@ void intel_pasid_tear_down_entry(struct
*/I think it's worth documenting in the commit message why both of these
pasid_clear_entry(pte);
spin_unlock(&iommu->lock);
+ if (!ecap_coherent(iommu->ecap))
+ clflush_cache_range(pte, sizeof(*pte));
intel_iommu_drain_pasid_prq(dev, pasid);
are needed, removing the warning and adding the flush.
Yes. I will add the following to the commit message:
Also drop the WARN_ON() for a non-present entry without FPD. Since
commit 75ed00055c05 a concurrent teardown can see such an entry before
it is zeroed. Flush the cache after clearing an FPD-only entry, as
other PASID entry updates do on non-coherent hardware.
hmm is it a separate fix?
I have added "Fixes: 75ed00055c05" to this patch.
Thanks,
baolu