linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Fixes for dma-iommu swiotlb bounce buffers
@ 2021-08-11  2:42 David Stevens
  2021-08-11  2:42 ` [PATCH v3 1/5] dma-iommu: fix sync_sg with swiotlb David Stevens
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: David Stevens @ 2021-08-11  2:42 UTC (permalink / raw)
  To: Robin Murphy, Will Deacon
  Cc: Joerg Roedel, Lu Baolu, Tom Murphy, iommu, linux-kernel, David Stevens

From: David Stevens <stevensd@chromium.org>

This patch set includes various fixes for dma-iommu's swiotlb bounce
buffers for untrusted devices. There are three fixes for correctness
issues, one performance issue, and one general cleanup.

The min_align_mask issue was found when running fio on an untrusted nvme
device with bs=512. The other issues were found via code inspection, so
I don't have any specific use cases where things were not working, nor
any concrete performance numbers.

v2 -> v3:
 - Add new patch to address min_align_mask bug
 - Set SKIP_CPU_SYNC flag after syncing in map/unmap
 - Properly call arch_sync_dma_for_cpu in iommu_dma_sync_sg_for_cpu

v1 -> v2:
 - Split fixes into dedicated patches
 - Less invasive changes to fix arch_sync when mapping
 - Leave dev_is_untrusted check for strict iommu

David Stevens (5):
  dma-iommu: fix sync_sg with swiotlb
  dma-iommu: fix arch_sync_dma for map
  dma-iommu: add SKIP_CPU_SYNC after syncing
  dma-iommu: Check CONFIG_SWIOTLB more broadly
  dma-iommu: account for min_align_mask

 drivers/iommu/dma-iommu.c | 97 +++++++++++++++++++++------------------
 1 file changed, 53 insertions(+), 44 deletions(-)

-- 
2.32.0.605.g8dce9f2422-goog


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-08-12 10:38 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-11  2:42 [PATCH v3 0/5] Fixes for dma-iommu swiotlb bounce buffers David Stevens
2021-08-11  2:42 ` [PATCH v3 1/5] dma-iommu: fix sync_sg with swiotlb David Stevens
2021-08-11  5:57   ` Christoph Hellwig
2021-08-11 18:22     ` Robin Murphy
2021-08-11  2:42 ` [PATCH v3 2/5] dma-iommu: fix arch_sync_dma for map David Stevens
2021-08-11  6:01   ` Christoph Hellwig
2021-08-11 18:47   ` Robin Murphy
2021-08-12  9:21     ` David Stevens
2021-08-12 10:38       ` Robin Murphy
2021-08-11  2:42 ` [PATCH v3 3/5] dma-iommu: add SKIP_CPU_SYNC after syncing David Stevens
2021-08-11  6:07   ` Christoph Hellwig
2021-08-11 19:00   ` Robin Murphy
2021-08-11  2:42 ` [PATCH v3 4/5] dma-iommu: Check CONFIG_SWIOTLB more broadly David Stevens
2021-08-11 19:02   ` Robin Murphy
2021-08-11  2:42 ` [PATCH v3 5/5] dma-iommu: account for min_align_mask David Stevens
2021-08-11  9:26   ` Mi, Dapeng1
2021-08-11 19:12   ` Robin Murphy
2021-08-12  1:45     ` David Stevens
2021-08-12  9:57       ` Robin Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).