All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/3] SWIOTLB: Preserve swiotlb map offset when needed.
@ 2021-02-01 18:30 ` Jianxiong Gao
  0 siblings, 0 replies; 46+ messages in thread
From: Jianxiong Gao @ 2021-02-01 18:30 UTC (permalink / raw)
  To: jxgao, erdemaktas, marcorr, hch, m.szyprowski, robin.murphy,
	gregkh, saravanak, heikki.krogerus, rafael.j.wysocki,
	andriy.shevchenko, dan.j.williams, bgolaszewski, jroedel, iommu,
	konrad.wilk, kbusch, axboe, sagi, linux-nvme, linux-kernel

NVMe driver and other applications may depend on the data offset
to operate correctly. Currently when unaligned data is mapped via
SWIOTLB, the data is mapped as slab aligned with the SWIOTLB. This
patch adds an option to make sure the mapped data preserves its
offset of the orginal addrss.

Without the patch when creating xfs formatted disk on NVMe backends,
with swiotlb=force in kernel boot option, creates the following error:
meta-data=/dev/nvme2n1   isize=512    agcount=4, agsize=131072 blks
         =               sectsz=512   attr=2, projid32bit=1
         =               crc=1        finobt=1, sparse=0, rmapbt=0, refl
ink=0
data     =               bsize=4096   blocks=524288, imaxpct=25
         =               sunit=0      swidth=0 blks
naming   =version 2      bsize=4096   ascii-ci=0 ftype=1
log      =internal log   bsize=4096   blocks=2560, version=2
         =               sectsz=512   sunit=0 blks, lazy-count=1
realtime =none           extsz=4096   blocks=0, rtextents=0
mkfs.xfs: pwrite failed: Input/output error

Jianxiong Gao (3):
  Adding page_offset_mask to device_dma_parameters
  Add swiotlb offset preserving mapping when
    dma_dma_parameters->page_offset_mask is non zero.
  Adding device_dma_parameters->offset_preserve_mask to NVMe driver.

 drivers/nvme/host/pci.c     |  4 ++++
 include/linux/device.h      |  1 +
 include/linux/dma-mapping.h | 17 +++++++++++++++++
 kernel/dma/swiotlb.c        | 16 +++++++++++++++-
 4 files changed, 37 insertions(+), 1 deletion(-)

-- 
2.27.0


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

end of thread, other threads:[~2021-02-03 16:49 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 18:30 [PATCH V2 0/3] SWIOTLB: Preserve swiotlb map offset when needed Jianxiong Gao
2021-02-01 18:30 ` Jianxiong Gao via iommu
2021-02-01 18:30 ` Jianxiong Gao
2021-02-01 18:30 ` [PATCH V2 1/3] Adding page_offset_mask to device_dma_parameters Jianxiong Gao
2021-02-01 18:30   ` Jianxiong Gao via iommu
2021-02-01 18:30   ` Jianxiong Gao
2021-02-01 18:30 ` [PATCH V2 2/3] Add swiotlb offset preserving mapping when dma_dma_parameters->page_offset_mask is non zero Jianxiong Gao
2021-02-01 18:30   ` Jianxiong Gao via iommu
2021-02-01 18:30   ` Jianxiong Gao
2021-02-01 18:30 ` [PATCH V2 3/3] Adding device_dma_parameters->offset_preserve_mask to NVMe driver Jianxiong Gao
2021-02-01 18:30   ` Jianxiong Gao via iommu
2021-02-01 18:30   ` Jianxiong Gao
2021-02-01 18:55   ` Andy Shevchenko
2021-02-01 18:55     ` Andy Shevchenko
2021-02-01 18:55     ` Andy Shevchenko
2021-02-01 19:35     ` Jianxiong Gao
2021-02-01 19:35       ` Jianxiong Gao via iommu
2021-02-01 19:35       ` Jianxiong Gao
2021-02-01 20:57   ` Keith Busch
2021-02-01 20:57     ` Keith Busch
2021-02-01 20:57     ` Keith Busch
2021-02-01 21:16     ` Jianxiong Gao via iommu
2021-02-01 21:22       ` Jianxiong Gao
2021-02-01 21:22         ` Jianxiong Gao via iommu
2021-02-01 21:22         ` Jianxiong Gao
2021-02-01 23:59         ` Chaitanya Kulkarni
2021-02-01 23:59           ` Chaitanya Kulkarni
2021-02-01 23:59           ` Chaitanya Kulkarni
2021-02-02  0:25         ` Jianxiong Gao
2021-02-02  0:25           ` Jianxiong Gao via iommu
2021-02-02  0:25           ` Jianxiong Gao
2021-02-02 11:21           ` Andy Shevchenko
2021-02-02 11:21             ` Andy Shevchenko
2021-02-02 11:21             ` Andy Shevchenko
2021-02-02 12:07             ` Robin Murphy
2021-02-02 12:07               ` Robin Murphy
2021-02-02 12:07               ` Robin Murphy
2021-02-03 13:37         ` Christoph Hellwig
2021-02-03 13:37           ` Christoph Hellwig
2021-02-03 13:37           ` Christoph Hellwig
2021-02-03 16:47           ` Jianxiong Gao
2021-02-03 16:47             ` Jianxiong Gao via iommu
2021-02-03 16:47             ` Jianxiong Gao
2021-02-02 11:53 ` [PATCH V2 0/3] SWIOTLB: Preserve swiotlb map offset when needed Greg KH
2021-02-02 11:53   ` Greg KH
2021-02-02 11:53   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.