mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Ferdinand Schober <ferdinand.schober@fau.de>,
	linux-kernel@vger.kernel.org
Cc: ashok.raj@intel.com, baolu.lu@linux.intel.com,
	dwmw2@infradead.org, iommu@lists.linux.dev, joro@8bytes.org,
	kevin.tian@intel.com, sanjay.k.kumar@intel.com,
	stable@vger.kernel.org, will@kernel.org, yi.l.liu@intel.com
Subject: Re: [PATCH v3] iommu/vt-d: Avoid superfluous IOTLB tracking in lazy mode
Date: Fri, 20 Feb 2026 10:34:11 +0000	[thread overview]
Message-ID: <555e100a-b995-47c1-b616-275d2e3b0946@arm.com> (raw)
In-Reply-To: <20260220015239.375598-1-ferdinand.schober@fau.de>

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
> 
> 
> 
> 


      reply	other threads:[~2026-02-20 10:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 17:53 Jacob Pan
2026-02-20  1:44 ` Ferdinand Schober
2026-02-20  1:52 ` Ferdinand Schober
2026-02-20 10:34   ` Robin Murphy [this message]

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=555e100a-b995-47c1-b616-275d2e3b0946@arm.com \
    --to=robin.murphy@arm.com \
    --cc=ashok.raj@intel.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=dwmw2@infradead.org \
    --cc=ferdinand.schober@fau.de \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sanjay.k.kumar@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=will@kernel.org \
    --cc=yi.l.liu@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®