mbox series

[5.4,0/8] preserve DMA offsets when using swiotlb

Message ID 20210405205109.1700468-1-jxgao@google.com
Headers show
Series preserve DMA offsets when using swiotlb | expand

Message

Jianxiong Gao April 5, 2021, 8:51 p.m. UTC
Hi all,

This series of backports fixes the SWIOTLB library to maintain the
page offset when mapping a DMA address. The bug that motivated this
patch series manifested when running a 5.4 kernel as a SEV guest with
an NVMe device. However, any device that infers information from the
page offset and is accessed through the SWIOTLB will benefit from this
bug fix.

Jianxiong Gao (7):
  driver core: add a min_align_mask field to struct
    device_dma_parameters
  swiotlb: add a 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
  nvme-pci: set min_align_mask

Linus Torvalds (1):
  Linux 5.4

 Makefile                    |   2 +-
 drivers/nvme/host/pci.c     |   1 +
 include/linux/device.h      |   1 +
 include/linux/dma-mapping.h |  16 +++
 include/linux/swiotlb.h     |   3 +-
 kernel/dma/swiotlb.c        | 262 ++++++++++++++++++++----------------
 6 files changed, 165 insertions(+), 120 deletions(-)

Comments

Sasha Levin April 6, 2021, 4:10 p.m. UTC | #1
On Mon, Apr 05, 2021 at 08:51:01PM +0000, Jianxiong Gao wrote:
>Hi all,

>

>This series of backports fixes the SWIOTLB library to maintain the

>page offset when mapping a DMA address. The bug that motivated this

>patch series manifested when running a 5.4 kernel as a SEV guest with

>an NVMe device. However, any device that infers information from the

>page offset and is accessed through the SWIOTLB will benefit from this

>bug fix.

>

>Jianxiong Gao (7):

>  driver core: add a min_align_mask field to struct

>    device_dma_parameters

>  swiotlb: add a 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

>  nvme-pci: set min_align_mask

>

>Linus Torvalds (1):

>  Linux 5.4


This is clearly wrong :)

This series also doesn't apply cleanly, what did you use as a base?

Also, why are the sign-offs on individual patches different between your
patches and upstream?

-- 
Thanks,
Sasha