Re: [PATCH v3] iommu/vt-d: Avoid superfluous IOTLB tracking in lazy mode
From: Robin Murphy
Date: Fri Feb 20 2026 - 05:34:42 EST
On 2026-02-20 1:52 am, Ferdinand Schober wrote:
Hi,
I've stumbled upon this patch trying to figure out how lazy invalidation is implemented in intel IOMMUs.
The patch suggests that lazy invalidation is active whenever iotlb_gather.queued is set.
However, the only place in which gather.queued is written seems to be in dma-iommu.c:
-- drivers/iommu/dma-iommu.c
820: iotlb_gather.queued = READ_ONCE(cookie->fq_domain);
2038: iotlb_gather.queued = free_iova && READ_ONCE(cookie->fq_domain);
Both of these depend on fq_domain but fq_domain is always NULL for intel iommus,
since iommu/intel/iommu.c reports IOMMU_CAP_DEFERRED_FLUSH:
-- drivers/iommu/dma-iommu.c:708
if (domain->type == IOMMU_DOMAIN_DMA_FQ &&
(!device_iommu_capable(dev, IOMMU_CAP_DEFERRED_FLUSH) || iommu_dma_init_fq(domain)))
domain->type = IOMMU_DOMAIN_DMA;
(Above line numbers are from Kernel 6.17).
So I'm not sure, this commit does what it should?
Please let me know what I'm missing here.
IOMMU_CAP_DEFERRED_FLUSH *is* the "I can usefully support flush queues" capability; if that is reported then iommu_dma_init_fq() is called, and if that succeeds then fq_domain will have been set. If it fails, or if the IOMMU doesn't support flush queues in the first place, then we fall back to the regular strict domain type.
Thanks,
Robin.
Best Regards,
Ferdinand Schober