Re: vremap and memcpy_to_fs in 2.2.x?

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Thu, 8 Apr 1999 01:52:36 +0200


Alan Cox wrote:
> > I have a device driver (which I did not write) which looks up pte
> > translations so it can access user space memory directly. The
> > assumption than the memory is locked is safe.
>
> Is it also copy on write correctly, locked correctly and other things
> though ?

Let's just assume so shall we :)

> Page table walking seems to be portable. It should be. Mapping userspace
> that way is playing with fire though. The bttv driver does the same page
> table stuff but on kernel mapped space and its mmap() operation maps a kernel
> buffer into the application

That's not what the first case in this snippet of bttv.c does. Looks to
me like it will grab frames directly into whatever is mapped in user
space, if user space requests it. Isn't this used to grab directly to a
mapped framebuffer?

if ((unsigned long)v.base&1)
btv->win.vidadr=(unsigned long)(PAGE_OFFSET|uvirt_to_bus((unsigned long)v.base));
else
btv->win.vidadr=(unsigned long)v.base;

-- Jamie

-
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/