Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Zhichuang Sun <zhichuang@google.com>
Cc: stable@vger.kernel.org, Nadav Amit <namit@vmware.com>,
	Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Lu Baolu <baolu.lu@linux.intel.com>,
	iommu@lists.linux-foundation.org
Subject: Re: [PATCH] commit 6b080c4e815ceba3c08ffa980c858595c07e786a upstream
Date: Thu, 2 Oct 2025 07:16:32 +0200	[thread overview]
Message-ID: <2025100207-writing-judgingly-6b2a@gregkh> (raw)
In-Reply-To: <20251001211909.721369-1-zhichuang@google.com>

On Wed, Oct 01, 2025 at 09:19:09PM +0000, Zhichuang Sun wrote:
> iommu/amd: fix amd iotlb flush range in unmap

Shouldn't this be the subject line?

> This was fixed in mainline in 6b080c4e815ceba3c08ffa980c858595c07e786a,
> but do not backport the full refactor.

Why not?

> Targeting branch lts linux-5.15.y.

Why just this one?  Why not also 5.10.y and 5.4.y?

> AMD IOMMU driver supports power of 2 KB page size, it can be 4K, 8K,
> 16K, etc. So when VFIO driver ask AMD IOMMU driver to unmap a
> IOVA with a page_size 4K, it actually can unmap a page_size of
> 8K, depending on the page used during mapping. However, the iotlb
> gather function use the page_size as the range of unmap range,
> instead of the real unmapped page size r.
> 
> This miscalculation of iotlb flush range will make the unflushed
> IOTLB entry stale. It triggered hard-to-debug silent data corruption
> issue as DMA engine who used the stale IOTLB entry will DMA into
> unmapped memory region.
> 
> The upstream commit aims at changing API from map/unmap_page() to
> map/unmap_pages() and changed the gather range calculation along
> with it. It accidentally fixed this bug in the mainline since 6.1.
> For this backport, we don't backport the API change, only port the
> gather range calculation to fix the bug.
> 
> Cc: Nadav Amit <namit@vmware.com>
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Will Deacon <will@kernel.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Lu Baolu <baolu.lu@linux.intel.com>
> Cc: iommu@lists.linux-foundation.org
> Fixes: fc65d0acaf23179b94de399c204328fa259acb90

Please use the proper format as documented:

Fixes: fc65d0acaf23 ("iommu/amd: Selective flush on unmap")

thanks,

greg k-h

  reply	other threads:[~2025-10-02  5:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-01 21:19 [PATCH] commit 6b080c4e815ceba3c08ffa980c858595c07e786a upstream Zhichuang Sun
2025-10-02  5:16 ` Greg KH [this message]
2025-10-02 20:49   ` [PATCH v2] " Zhichuang Sun

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=2025100207-writing-judgingly-6b2a@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=namit@vmware.com \
    --cc=robin.murphy@arm.com \
    --cc=stable@vger.kernel.org \
    --cc=will@kernel.org \
    --cc=zhichuang@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