From: Jianxiong Gao <jxgao@google.com>
To: stable@vger.kernel.org, hch@lst.de, marcorr@google.com,
sashal@kernel.org
Cc: Jianxiong Gao <jxgao@google.com>
Subject: [PATCH v2 5.10 0/9] preserve DMA offsets when using swiotlb
Date: Thu, 29 Apr 2021 17:33:06 +0000 [thread overview]
Message-ID: <20210429173315.1252465-1-jxgao@google.com> (raw)
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.10.33
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 | 259 ++++++++++++++++++++----------------
5 files changed, 164 insertions(+), 114 deletions(-)
--
2.31.1.498.g6c1eba8ee3d-goog
next reply other threads:[~2021-04-29 17:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-29 17:33 Jianxiong Gao [this message]
2021-04-29 17:33 ` [PATCH v2 5.10 1/9] driver core: add a min_align_mask field to struct device_dma_parameters Jianxiong Gao
2021-04-29 17:33 ` [PATCH v2 5.10 2/9] swiotlb: add a IO_TLB_SIZE define Jianxiong Gao
2021-04-29 17:33 ` [PATCH v2 5.10 3/9] swiotlb: factor out an io_tlb_offset helper Jianxiong Gao
2021-04-29 17:33 ` [PATCH v2 5.10 4/9] swiotlb: factor out a nr_slots helper Jianxiong Gao
2021-04-29 17:33 ` [PATCH v2 5.10 5/9] swiotlb: clean up swiotlb_tbl_unmap_single Jianxiong Gao
2021-04-29 17:33 ` [PATCH v2 5.10 6/9] swiotlb: refactor swiotlb_tbl_map_single Jianxiong Gao
2021-04-29 17:33 ` [PATCH v2 5.10 7/9] swiotlb: don't modify orig_addr in swiotlb_tbl_sync_single Jianxiong Gao
2021-04-29 17:33 ` [PATCH v2 5.10 8/9] swiotlb: respect min_align_mask Jianxiong Gao
2021-04-29 17:33 ` [PATCH v2 5.10 9/9] nvme-pci: set min_align_mask Jianxiong Gao
2021-05-04 20:22 ` [PATCH v2 5.10 0/9] preserve DMA offsets when using swiotlb Marc Orr
2021-05-05 5:08 ` Christoph Hellwig
2021-05-05 7:23 ` Greg KH
2021-05-05 7:44 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210429173315.1252465-1-jxgao@google.com \
--to=jxgao@google.com \
--cc=hch@lst.de \
--cc=marcorr@google.com \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).