mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baolu Lu <baolu.lu@linux.intel.com>
To: Guanghui Feng <guanghuifeng@linux.alibaba.com>,
	dwmw2@infradead.org, joro@8bytes.org, will@kernel.org,
	robin.murphy@arm.com
Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
	alikernel-developer@linux.alibaba.com
Subject: Re: [PATCH] iommu/vt-d: Fix CACHE_TAG_NESTING_DEVTLB polluting shared variables in flush loop
Date: Mon, 27 Jul 2026 10:47:45 +0800	[thread overview]
Message-ID: <b118776e-2d87-42bc-8609-b0e4516be713@linux.intel.com> (raw)
In-Reply-To: <20260623060122.3796325-1-guanghuifeng@linux.alibaba.com>

On 6/23/26 14:01, Guanghui Feng wrote:
> In cache_tag_flush_range(), the CACHE_TAG_NESTING_DEVTLB case modifies the
> shared local variables 'addr' and 'mask' before falling through to
> CACHE_TAG_DEVTLB. This causes all subsequent CACHE_TAG_DEVTLB entries in
> the same loop iteration to incorrectly use the full-range flush parameters
> (addr=0, mask=MAX_AGAW_PFN_WIDTH) instead of the precisely calculated PSI
> range. This is not the intended behavior, as regular DEVTLB entries should
> always perform targeted range-based invalidation.
> 
> Fix this by having CACHE_TAG_NESTING_DEVTLB directly call
> cache_tag_flush_devtlb_psi() with the full-range constants and break,
> instead of modifying shared variables and falling through. This ensures
> CACHE_TAG_DEVTLB always uses the original calculated addr and mask for
> precise range flush.
> 
> Signed-off-by: Guanghui Feng<guanghuifeng@linux.alibaba.com>
> Signed-off-by: Guixin Liu<kanie@linux.alibaba.com>
> ---
>   drivers/iommu/intel/cache.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)

Queued for v7.3-rc1. Thanks a lot!

      parent reply	other threads:[~2026-07-27  2:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23  6:01 Guanghui Feng
2026-06-27  6:57 ` Baolu Lu
2026-07-27  2:47 ` Baolu Lu [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=b118776e-2d87-42bc-8609-b0e4516be713@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=alikernel-developer@linux.alibaba.com \
    --cc=dwmw2@infradead.org \
    --cc=guanghuifeng@linux.alibaba.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /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®