[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210813073839.1562438-1-stevensd@google.com>
Date: Fri, 13 Aug 2021 16:38:33 +0900
From: David Stevens <stevensd@...omium.org>
To: Robin Murphy <robin.murphy@....com>, Christoph Hellwig <hch@....de>
Cc: Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Lu Baolu <baolu.lu@...ux.intel.com>,
Tom Murphy <murphyt7@....ie>, iommu@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org, David Stevens <stevensd@...omium.org>
Subject: [PATCH v4 0/6] Fixes for dma-iommu swiotlb bounce buffers
From: David Stevens <stevensd@...omium.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.
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 (6):
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: Check CONFIG_SWIOTLB more broadly
swiotlb: support aligned swiotlb buffers
dma-iommu: account for min_align_mask
drivers/iommu/dma-iommu.c | 193 +++++++++++++++++---------------------
include/linux/swiotlb.h | 3 +-
kernel/dma/swiotlb.c | 11 ++-
3 files changed, 97 insertions(+), 110 deletions(-)
--
2.33.0.rc1.237.g0d66db33f3-goog
Powered by blists - more mailing lists