Skip to content

preserve DMA offsets when using swiotlb

Jianxiong Gao stable 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 3/39 patches 7 repliesIn review
  2. v2 posting 2/39 patches 4 repliesSuperseded
  3. v2 posting 1/38 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v18 patches10 repliesSuperseded

Changes in v2 from the cover letter

Rebased patches to 5.4.115
Updated patch description to correct format.

Patches in v2 posting 3/3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9driver core: add a min_align_mask field to struct device_dma_parametersinclude/linux/device.h include/linux/dma-mapping.h+17 -00 replies
2/9swiotlb: add a IO_TLB_SIZE defineinclude/linux/swiotlb.h kernel/dma/swiotlb.c+7 -60 replies
3/9swiotlb: factor out an io_tlb_offset helperkernel/dma/swiotlb.c+13 -70 replies
4/9swiotlb: factor out a nr_slots helperkernel/dma/swiotlb.c+9 -40 replies
5/9swiotlb: clean up swiotlb_tbl_unmap_singlekernel/dma/swiotlb.c+21 -200 replies
6/9swiotlb: refactor swiotlb_tbl_map_singlekernel/dma/swiotlb.c+92 -930 replies
7/9swiotlb: don't modify orig_addr in swiotlb_tbl_sync_singlekernel/dma/swiotlb.c+0 -10 replies
8/9swiotlb: respect min_align_maskkernel/dma/swiotlb.c+32 -100 replies
9/9nvme-pci: set min_align_maskdrivers/nvme/host/pci.c+1 -00 replies

Reviews trailers per patch

8 of 9 patches have a Reviewed-by or Acked-by.

PatchGreg Kroah-HartmanJianxiong Gao
1/9A-b
2/9A-b T-b
3/9A-b T-b
4/9A-b T-b
5/9A-b T-b
6/9A-b T-b
7/9A-b T-b
8/9A-b T-b
9/9T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH 5.4 v2 0/9] preserve DMA offsets when using swiotlb

We observed several NVMe failures when running with SWIOTLB. The root cause of the issue is that when data is mapped via SWIOTLB, the address offset is not preserved. Several device drivers including the NVMe driver relies on this offset to function correctly.

Even though we discovered the error when running using AMD SEV, we have reproduced the same error in Rhel 8 without SEV. By adding swiotlb=force option to the boot command line parameter, NVMe funcionality is impacted. For example formatting a disk into xfs format returns an error.

----
Changes in v2:
Rebased patches to 5.4.115
Updated patch description to correct format.

Jianxiong Gao (9):
driver core: add a min_align_mask field to struct
device_dma_parameters
swiotlb: add a IO_TLB_SIZE define
swiotlb: factor out an io_tlb_offset helper
swiotlb: factor out a nr_slots helper
swiotlb: clean up swiotlb_tbl_unmap_single
swiotlb: refactor swiotlb_tbl_map_single
swiotlb: don't modify orig_addr in swiotlb_tbl_sync_single
swiotlb: respect min_align_mask
nvme-pci: set min_align_mask

 drivers/nvme/host/pci.c     |   1 +
 include/linux/device.h      |   1 +
 include/linux/dma-mapping.h |  16 +++
 include/linux/swiotlb.h     |   1 +
 kernel/dma/swiotlb.c        | 269 ++++++++++++++++++++----------------
 5 files changed, 169 insertions(+), 119 deletions(-)
Signature · 1 line
2.31.1.751.gd2f1c929bd-goog