[PATCH 4/4] nvme-pci: unmap MMIO pages with appropriate interface

Leon Romanovsky leon at kernel.org
Tue Oct 14 23:44:11 PDT 2025


On Wed, Oct 15, 2025 at 06:20:53AM +0200, Christoph Hellwig wrote:
> On Mon, Oct 13, 2025 at 06:34:12PM +0300, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro at nvidia.com>
> > 
> > Block layer maps MMIO memory through dma_map_phys() interface
> > with help of DMA_ATTR_MMIO attribute. There is a need to unmap
> > that memory with the appropriate unmap function, something which
> > wasn't possible before adding new REQ attribute to block layer in
> > previous patch.
> 
> This should go into the same patch that switches to dma_map_phys.

I don't think so, dma_map_phys() patch [1] doesn't change any behavior
and dma_map_page() is equal to dma_map_phys(... , attr = 0),

> Unless I'm missing something it also misses passing the flag for
> the metadata mapping.

Yes, I didn't realize that same request can have both metadata and data
payloads.

> 
> Btw, where is all this going?  Are you trying to remove the auto
> detection of P2P in the low-level dma mapping routines?  If so that
> should probably go into at very least the cover lttter, but probably also
> the commit logs.

It is an outcome of multiple things:
1. We missed setting of IOMMU_MMIO flag in dma-iommu.c flow for p2p pages
and for that we need some external indication as memory type is already
known to the callers.
2. Robin expressed concerns about overloading DMA_ATTR_SKIP_CPU_SYNC.

[1] https://lore.kernel.org/all/a40705f38a9f3c757f30228b9b848ce0a87cbcdd.1760369219.git.leon@kernel.org/
[2] https://lore.kernel.org/all/751e7ece-8640-4653-b308-96da6731b8e7@arm.com/



More information about the Linux-nvme mailing list