[PATCH 3/3] Adding device_dma_parameters->offset_preserve_mask to NVMe driver.
Christoph Hellwig
hch at lst.de
Thu Jan 28 13:18:04 EST 2021
On Thu, Jan 28, 2021 at 06:00:58PM +0000, Robin Murphy wrote:
> If it were possible for this to fail, you might leak the DMA mapping here.
> However if dev->dma_parms somehow disappeared since a dozen lines above
> then I think you've got far bigger problems anyway.
>
> That said, do you really need to keep toggling this back and forth all the
> time? Even if the device does make other mappings elsewhere that don't
> necessarily need the same strict alignment, would it be significantly
> harmful just to set it once at probe and leave it in place anyway?
Yes, we should kept it set all the time. While some NVMe devices have
the optional to use SGLs that do not have this limitation, I have
absolutely no sympathy for anyone running NVMe with swiotlb as that
means their system imposes an addressing limitation. We need to make
sure it does not corrupt data, but we're not going to make any effort
to optimize for such a degenerated setup.
More information about the Linux-nvme
mailing list