Proposal for kernel change
Alexander Viro
viro en math.psu.edu
Lun Ene 24 23:22:38 CST 2000
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 en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Más información sobre la lista de distribución Ayuda