Re: [PATCH 1/2] iommu/vt-d: Set FPD when tearing down a PASID entry with fault_ignore

From: Baolu Lu

Date: Mon Nov 09 2026 - 02:46:49 EST


On 11/6/2026 6:01 AM, Vinicius Costa Gomes wrote:
Lu Baolu<baolu.lu@xxxxxxxxxxxxxxx> writes:

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 intel_iommu *iommu, struct device *dev,
*/
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);

I think it's worth documenting in the commit message why both of these
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.

Thanks,
baolu