lkml.org 
[lkml]   [2000]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: DMA to user space
On Thu, Mar 16, 2000 at 11:48:17AM -0500, John Wilson wrote:
>
> Anyway as I said in my original message, I've already got the driver
> more or less working (well, readl() seems to be returning what should be
> "impossible" values some of the time) by using a driver-owned buffer which
> the user job mmaps into a window. But I consider that a kludge. I'm a big
> fan of doing what I actually *mean* whenever possible, rather than living
> with some twisted hack that happens to work *most* of the time, so I'd prefer
> to simulate the effect of doing DMA into the user's buffer, by *really* doing
> DMA into the user's buffer!
>

That is a perfectly reasonable way to approach the problem. IMO, the
alternative is a hack: for each page in the user space buffer, you need
to fault it into RAM, or more likely, fault it into existence. Then you
need to lock it into RAM and reserve each page. For the vmalloc'd
solution, you just need to reserve each page.

It also isn't riddled with potential security holes. Imagine DMA'ing
into the C library.





dave...






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

\
 
 \ /
  Last update: 2005-03-22 13:57    [from the cache]
©2003-2011 Jasper Spaans