Re: [PATCH 10 of 20] ipath - support for userspace apps using coredriver

From: Hugh Dickins
Date: Thu Mar 16 2006 - 09:33:01 EST


On Thu, 16 Mar 2006, Nick Piggin wrote:
> >
> > How about the case where one wants to map pages from
> > dma_alloc_coherent() into userspace? It seems one should do
> > get_page() in .nopage, and then the driver can do dma_free_coherent()
> > when the vma is released.
>
> I think so, provided you set VM_IO on the vma. You need VM_IO to
> ensure that get_user_pages callers can't hijack your page's lifetime
> rules

Once __GFP_COMP is passed to the dma_alloc_coherent, as it needs to be
(unless going VM_PFNMAP), get_user_pages will be safe: no need for VM_IO.

Hugh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/