[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <284bed78-c9ff-4715-a85e-bf353cabaa22@linux.intel.com>
Date: Fri, 9 Aug 2024 16:22:18 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: Tina Zhang <tina.zhang@...el.com>, Kevin Tian <kevin.tian@...el.com>
Cc: baolu.lu@...ux.intel.com, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 5/5] vt-d/iommu: Enable batching of IOTLB/Dev-IOTLB
invalidations
On 2024/8/9 10:54, Tina Zhang wrote:
> +static inline void handle_batched_iotlb_descs(struct dmar_domain *domain,
> + struct cache_tag *tag,
> + unsigned long addr,
> + unsigned long pages,
> + unsigned long mask,
> + int ih)
> +{
> + struct intel_iommu *iommu = tag->iommu;
> +
> + if (domain->use_first_level) {
> + qi_batch_add_piotlb_desc(iommu, tag->domain_id,
> + tag->pasid, addr, pages,
> + ih, domain->qi_batch);
> + } else {
> + /*
> + * Fallback to domain selective flush if no
> + * PSI support or the size is too big.
> + */
> + if (!cap_pgsel_inv(iommu->cap) ||
> + mask > cap_max_amask_val(iommu->cap) ||
> + pages == -1)
> + qi_batch_add_iotlb_desc(iommu, tag->domain_id,
> + 0, 0, DMA_TLB_DSI_FLUSH,
> + domain->qi_batch);
> + else
> + qi_batch_add_iotlb_desc(iommu, tag->domain_id,
> + addr | ih, mask,
> + DMA_TLB_PSI_FLUSH,
> + domain->qi_batch);
> + }
> +
> +}
What if the iommu driver is running on an early or emulated hardware
where the queued invalidation is not supported?
Thanks,
baolu
Powered by blists - more mailing lists