From: Baolu Lu <baolu.lu@linux.intel.com>
To: Tina Zhang <tina.zhang@intel.com>, Kevin Tian <kevin.tian@intel.com>
Cc: baolu.lu@linux.intel.com, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/5] vt-d/iommu: Enable batching of IOTLB/Dev-IOTLB invalidations
Date: Fri, 9 Aug 2024 16:22:18 +0800 [thread overview]
Message-ID: <284bed78-c9ff-4715-a85e-bf353cabaa22@linux.intel.com> (raw)
In-Reply-To: <20240809025431.14605-6-tina.zhang@intel.com>
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
next prev parent reply other threads:[~2024-08-09 8:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 2:54 [PATCH v2 0/5] Batch IOTLB/dev-IOTLB invalidation Tina Zhang
2024-08-09 2:54 ` [PATCH v2 1/5] iommu/vt-d: Refactor IOTLB/Dev-IOTLB invalidation command logic Tina Zhang
2024-08-09 2:54 ` [PATCH v2 2/5] iommu/vt-d: Refactor IOTLB and Dev-IOTLB flush logic Tina Zhang
2024-08-09 8:09 ` Baolu Lu
2024-08-09 2:54 ` [PATCH v2 3/5] iommu/vt-d: Introduce interfaces for QI batching operations Tina Zhang
2024-08-09 8:15 ` Baolu Lu
2024-08-09 8:59 ` Zhang, Tina
2024-08-09 2:54 ` [PATCH v2 4/5] vt-d/iommu: Refactor quirk_extra_dev_tlb_flush() Tina Zhang
2024-08-09 8:25 ` Baolu Lu
2024-08-09 9:10 ` Zhang, Tina
2024-08-09 2:54 ` [PATCH v2 5/5] vt-d/iommu: Enable batching of IOTLB/Dev-IOTLB invalidations Tina Zhang
2024-08-09 8:22 ` Baolu Lu [this message]
2024-08-09 9:24 ` Zhang, Tina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=284bed78-c9ff-4715-a85e-bf353cabaa22@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tina.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®