diff --git a/patches.suse/iommu-dma-Trace-bounce-buffer-usage-when-mapping-buf.patch b/patches.suse/iommu-dma-Trace-bounce-buffer-usage-when-mapping-buf.patch new file mode 100644 index 0000000..3dcb73f --- /dev/null +++ b/patches.suse/iommu-dma-Trace-bounce-buffer-usage-when-mapping-buf.patch @@ -0,0 +1,56 @@ +From a63c357b9fd56ad5fe64616f5b22835252c6a76a Mon Sep 17 00:00:00 2001 +From: "Isaac J. Manjarres" +Date: Fri, 8 Dec 2023 15:41:40 -0800 +Subject: [PATCH] iommu/dma: Trace bounce buffer usage when mapping buffers +Git-commit: a63c357b9fd56ad5fe64616f5b22835252c6a76a +Patch-mainline: v6.8-rc1 +References: git-fixes + +When commit 82612d66d51d ("iommu: Allow the dma-iommu api to +use bounce buffers") was introduced, it did not add the logic +for tracing the bounce buffer usage from iommu_dma_map_page(). + +All of the users of swiotlb_tbl_map_single() trace their bounce +buffer usage, except iommu_dma_map_page(). This makes it difficult +to track SWIOTLB usage from that function. Thus, trace bounce buffer +usage from iommu_dma_map_page(). + +Fixes: 82612d66d51d ("iommu: Allow the dma-iommu api to use bounce buffers") +Cc: stable@vger.kernel.org # v5.15+ +Cc: Tom Murphy +Cc: Lu Baolu +Cc: Saravana Kannan +Signed-off-by: Isaac J. Manjarres +Link: https://lore.kernel.org/r/20231208234141.2356157-1-isaacmanjarres@google.com +Signed-off-by: Joerg Roedel +Acked-by: Vasant Karasulli +--- + drivers/iommu/dma-iommu.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c +index 85163a83df2f..037fcf826407 100644 +--- a/drivers/iommu/dma-iommu.c ++++ b/drivers/iommu/dma-iommu.c +@@ -29,6 +29,9 @@ + #include + #include + #include ++#ifndef __GENKSYMS__ ++#include ++#endif + + struct iommu_dma_msi_page { + struct list_head list; +@@ -1156,6 +1157,8 @@ static dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page, + return DMA_MAPPING_ERROR; + } + ++ trace_swiotlb_bounced(dev, phys, size); ++ + aligned_size = iova_align(iovad, size); + phys = swiotlb_tbl_map_single(dev, phys, size, aligned_size, + iova_mask(iovad), dir, attrs); +-- +2.34.1 + diff --git a/series.conf b/series.conf index 8a3e4ec..2c4809d 100644 --- a/series.conf +++ b/series.conf @@ -45263,6 +45263,7 @@ patches.suse/s390-vfio-ap-always-filter-entire-AP-matrix.patch patches.suse/s390-vfio-ap-loop-over-the-shadow-APCB-when-filtering-guest-s-AP-configuration.patch patches.suse/s390-vfio-ap-let-on_scan_complete-callback-filter-matrix-and-update-guest-s-APCB.patch + patches.suse/iommu-dma-Trace-bounce-buffer-usage-when-mapping-buf.patch patches.suse/hisi_acc_vfio_pci-Update-migration-data-pointer-correctly-on-saving-resume.patch patches.suse/dma-debug-fix-kernel-doc-warnings.patch patches.suse/pwm-Fix-out-of-bounds-access-in-of_pwm_single_xlate.patch