lkml.org 
[lkml]   [2000]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Proposal for kernel change


On Mon, 24 Jan 2000, Alan Cox wrote:

> > > read and write sometimes lock and DMA from user pages in new driver toys
> > > using Stephen's rawio and kiovec stuff. You would need to be careful how
> > > you arranged it to avoid shooting yourself in the foot on future optimisations
> >
> > Ouch... And what happens if we do write() _not_ from user page? I can't
> > think of a place that would write to character device from kernel space,
> > but...
>
> I can't at the moment but it would be bad to preclude it.

Precisely. So leaving all this stuff to clever driver is not enough to be
safe - for copy_*_user() set_fs() trick happens to work, but it will not
save us for anything that plays games with wiring pages down and doing
DMA... Notice that it all boils down to the right choice of 'bring me the
data' function (copy_from_user/copying from iovec/bringing the page
in-core to DMAable place and wiring it/doing nothing/etc.), but there are
two places that contribute to the choice - type of source (user vs. kernel
and plain vs. iovec) and nature of driver (copy vs. DMA). And those places
know nothing about each other...


-
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:56    [W:0.054 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site