public inbox for patches@lists.linux.dev
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Weinan Liu <wnliu@google.com>
Cc: iommu@lists.linux.dev, joro@8bytes.org, patches@lists.linux.dev,
	robin.murphy@arm.com, suravee.suthikulpanit@amd.com,
	wei.w.wang@hotmail.com, will@kernel.org, kpsingh@kernel.org,
	josef@toxicpanda.com
Subject: Re: [PATCH v1 1/1] iommu/amd: Don't split flush for amd_iommu_domain_flush_all()
Date: Tue, 14 Apr 2026 20:36:07 -0300	[thread overview]
Message-ID: <20260414233607.GK2588311@nvidia.com> (raw)
In-Reply-To: <20260414210626.2097722-2-wnliu@google.com>

On Tue, Apr 14, 2026 at 09:06:26PM +0000, Weinan Liu wrote:
> diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
> index 760d5f4623b5..bcec8721d228 100644
> --- a/drivers/iommu/amd/iommu.c
> +++ b/drivers/iommu/amd/iommu.c
> @@ -1769,7 +1769,8 @@ void amd_iommu_domain_flush_pages(struct protection_domain *domain,
>  {
>  	lockdep_assert_held(&domain->lock);
>  
> -	if (likely(!amd_iommu_np_cache)) {
> +	if (likely(!amd_iommu_np_cache) ||
> +		size == CMD_INV_IOMMU_ALL_PAGES_ADDRESS) {

This is better as size >= (1ULL<<52)

Which is the break point where it switches over to full invalidation
anyhow, there is no sense then in doing the special np flow..

Otherwise

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

  reply	other threads:[~2026-04-14 23:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-14 21:06 [PATCH v1 0/1] Don't split flush for amd_iommu_domain_flush_all() Weinan Liu
2026-04-14 21:06 ` [PATCH v1 1/1] iommu/amd: " Weinan Liu
2026-04-14 23:36   ` Jason Gunthorpe [this message]
2026-04-15  0:30     ` Weinan Liu
2026-04-17 11:57       ` Jason Gunthorpe
2026-04-14 23:55   ` Samiullah Khawaja

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=20260414233607.GK2588311@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=josef@toxicpanda.com \
    --cc=kpsingh@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=wei.w.wang@hotmail.com \
    --cc=will@kernel.org \
    --cc=wnliu@google.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