[openib-general] assumptions on page mapping (was High memory)

Christoph Hellwig hch at lst.de
Thu Dec 8 06:42:15 PST 2005


On Thu, Dec 08, 2005 at 09:17:15AM +0200, Or Gerlitz wrote:
> Roland Dreier wrote:
> >The right way to use the MR from get_dma_mr() is to use "bus
> >addresses" from the DMA mapping API.  For highmem, the right way to
> >get those addresses is with dma_map_sg() or dma_map_page().
> 
> Looking on the kernel x86_64 code, both dma_map_sg and dma_map_page seem 
> to assume that the page is already mapped, since they call 
> page_address(page).

x86_64 doesn't have highmem, so page_address(page) is valid on every
page.

> Specifically is it safe in a SCSI LLD (eg SRP and iSER which is among 
> other things such) to call dma_map_sg on a SG which comes with a SCSI 

yes, this is definitly safe.  

> command, so the SCSI Mid-Layer always makes sure the pages are mapped?

no, it doesn't.  in fact pages don't need to be mapped at all for dma
normally.



More information about the general mailing list