Hi Joerg,
[Cc'ing stable@vger.kernel.org per Nadav's suggestion]
This bug fix seems to have gotten the necessary reviews (AMD and previous commit author). Is it eligible to be applied?
Thanks, Jon
On Wed, Apr 26, 2023 at 1:32 PM Jon Pan-Doh pandoh@google.com wrote:
When running on an AMD vIOMMU, we observed multiple invalidations (of decreasing power of 2 aligned sizes) when unmapping a single page.
Domain flush takes gather bounds (end-start) as size param. However, gather->end is defined as the last inclusive address (start + size - 1). This leads to an off by 1 error.
With this patch, verified that 1 invalidation occurs when unmapping a single page.
Fixes: a270be1b3fdf ("iommu/amd: Use only natural aligned flushes in a VM") Signed-off-by: Jon Pan-Doh pandoh@google.com Tested-by: Sudheer Dantuluri dantuluris@google.com Suggested-by: Gary Zibrat gzibrat@google.com
drivers/iommu/amd/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 5a505ba5467e..da45b1ab042d 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2378,7 +2378,7 @@ static void amd_iommu_iotlb_sync(struct iommu_domain *domain, unsigned long flags;
spin_lock_irqsave(&dom->lock, flags);
domain_flush_pages(dom, gather->start, gather->end - gather->start, 1);
domain_flush_pages(dom, gather->start, gather->end - gather->start + 1, 1); amd_iommu_domain_flush_complete(dom); spin_unlock_irqrestore(&dom->lock, flags);
}
2.40.0.634.g4ca3ef3211-goog
On Tue, May 16, 2023 at 01:59:16PM -0700, Jon Pan-Doh wrote:
Hi Joerg,
[Cc'ing stable@vger.kernel.org per Nadav's suggestion]
<formletter>
This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.
</formletter>
linux-stable-mirror@lists.linaro.org