Christoph Hellwig wrote:
dma_map_page/dma_map_sg map from page frames to bus addresses.  There
is no need for the pages to mapped into kernel virtual memory at all.
E.g. the simple non-iommu implementation of dma_map_page on i386 does
the following:

static inline dma_addr_t
dma_map_page(struct device *dev, struct page *page, unsigned long offset,
                size_t size, enum dma_data_direction direction)
{
        BUG_ON(direction == DMA_NONE);
        return page_to_phys(page) + offset;
}

it doesn't involve kernel virtual addresses at all, just a struct page
and it's physical address.  For more complex schemes the physical
address needs to be translated to a bus address, but there's not
requirement for the page to be mapped into kva.  For example direct I/O
on filesystems or block devices will send down pages not mapped into KVA
to the scsi subsystem.

thanks a lot for taking the time and putting this detailed explanation, now i understand it much better.


Or.

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to