linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/7] Fixes for dma-iommu swiotlb bounce buffers
@ 2021-08-17  1:38 David Stevens
  2021-08-17  1:38 ` [PATCH v6 1/7] dma-iommu: fix sync_sg with swiotlb David Stevens
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: David Stevens @ 2021-08-17  1:38 UTC (permalink / raw)
  To: Robin Murphy, Christoph Hellwig
  Cc: Joerg Roedel, Will Deacon, 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 four fixes for correctness
issues, one for a performance issue, and one for 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.

v5 -> v6:
 - Remove unnecessary line break
 - Remove redundant config check

v4 -> v5:
 - Fix xen build error
 - Move _swiotlb refactor into its own patch

v3 -> v4:
 - Fold _swiotlb functions into _page functions
 - Add patch to align swiotlb buffer to iovad granule
 - Combine if checks in iommu_dma_sync_sg_* functions

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 (7):
  dma-iommu: fix sync_sg with swiotlb
  dma-iommu: fix arch_sync_dma for map
  dma-iommu: skip extra sync during unmap w/swiotlb
  dma-iommu: fold _swiotlb helpers into callers
  dma-iommu: Check CONFIG_SWIOTLB more broadly
  swiotlb: support aligned swiotlb buffers
  dma-iommu: account for min_align_mask

 drivers/iommu/dma-iommu.c | 191 +++++++++++++++++---------------------
 drivers/xen/swiotlb-xen.c |   2 +-
 include/linux/swiotlb.h   |   3 +-
 kernel/dma/swiotlb.c      |  11 ++-
 4 files changed, 96 insertions(+), 111 deletions(-)

-- 
2.33.0.rc1.237.g0d66db33f3-goog


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

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

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17  1:38 [PATCH v6 0/7] Fixes for dma-iommu swiotlb bounce buffers David Stevens
2021-08-17  1:38 ` [PATCH v6 1/7] dma-iommu: fix sync_sg with swiotlb David Stevens
2021-08-17  1:38 ` [PATCH v6 2/7] dma-iommu: fix arch_sync_dma for map David Stevens
2021-08-19  8:59   ` Robin Murphy
2021-08-17  1:38 ` [PATCH v6 3/7] dma-iommu: skip extra sync during unmap w/swiotlb David Stevens
2021-08-19  8:59   ` Robin Murphy
2021-08-17  1:38 ` [PATCH v6 4/7] dma-iommu: fold _swiotlb helpers into callers David Stevens
2021-08-19  9:00   ` Robin Murphy
2021-08-17  1:38 ` [PATCH v6 5/7] dma-iommu: Check CONFIG_SWIOTLB more broadly David Stevens
2021-08-17  1:38 ` [PATCH v6 6/7] swiotlb: support aligned swiotlb buffers David Stevens
2021-08-17  1:38 ` [PATCH v6 7/7] dma-iommu: account for min_align_mask David Stevens
2021-08-19  9:03   ` Robin Murphy
2021-08-19 10:05     ` David Stevens

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).