[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231108073048.GA5277@lst.de>
Date: Wed, 8 Nov 2023 08:30:48 +0100
From: Christoph Hellwig <hch@....de>
To: Halil Pasic <pasic@...ux.ibm.com>
Cc: Christoph Hellwig <hch@....de>,
Petr Tesařík <petr@...arici.cz>,
Niklas Schnelle <schnelle@...ux.ibm.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>,
Petr Tesarik <petr.tesarik1@...wei-partners.com>,
Ross Lagerwall <ross.lagerwall@...rix.com>,
linux-pci <linux-pci@...r.kernel.org>,
linux-kernel@...r.kernel.org, iommu@...ts.linux.dev,
Matthew Rosato <mjrosato@...ux.ibm.com>,
Jianxiong Gao <jxgao@...gle.com>
Subject: Re: Memory corruption with CONFIG_SWIOTLB_DYNAMIC=y
On Tue, Nov 07, 2023 at 06:24:37PM +0100, Halil Pasic wrote:
> Thanks Christoph! So for NVMe in certain contexts the low
> bits of addresses get discarded, but in other contexts the high bits
> of addresses get discarded and the low bits need to remain the same
> after the bounce (and that's why we need commits 36950f2da1ea ("driver
> core: add a min_align_mask) and 1f221a0d0dbf ("swiotlb: respect
> min_align_mask").
Nothing really gets discarded. NVMe basicaly requires all pages
(where the page is a device page, currently hard coded to 4k in
Linux) except for the first to not have an offset. This is what
the driver sets the virt boundary to in Linux. When bounce buffering
thus all segments (except possibly the first) need to keep their
alignment.
Powered by blists - more mailing lists