On Tue, 2007-01-16 at 00:21 -0500, David Moore wrote:
> On Mon, 2007-01-15 at 16:43 -0500, Kristian Høgsberg wrote:
> > On 1/15/07, Arjan van de Ven <[email protected]> wrote:
> > > again the best way is for you to provide an mmap method... you can then
> > > fill in the pages and keep that in some sort of array; this is for
> > > example also what the DRI/DRM layer does for textures etc...
> >
> > That sounds a lot like what I have now (mmap method, array of pages)
> > so I'll just stick with that.
>
> It sounds like the distinction Arjan is getting at is that the buffer
> should exist in the process's virtual address space instead of the
> kernel's virtual address space so that we have plenty of space available
> to us.
exactly! and either way the user would need that space allocated ANYWAY.
>
> Thus, we should use get_user_pages() instead of vmalloc(). I think
> get_user_pages() will also automatically pin the memory.
actually if you provide the mmap method yourself you're not going to
need get_user_pages(), because it's kernel allocated memory already!
> And we'll also
> need to call get_user_pages() from a custom mmap() handler so that we
> know what process virtual address to assign to the region.
see above; it's one or the other. Personally I'd think the mmap method
is simpler, because there's less conditions to consider (again, the
malicious user passing you memory that is mmap'd PCI MMIO space is a
"fun" example, but there's a lot more cafes which are... funky)
Greetings,
Arjan van de Ven
--
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]