lkml.org 
[lkml]   [1999]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectBug (?) when implementing a vm_ops->nopage() method
Date
From

In Linux version 2.2.5-15, when I implement the vm_ops->nopage()
method in order to allow my device driver to do an mmap() to share a
large buffer between the driver and user space, I found that returning
a physical page address does not work.

As I understand from reading Rubini's Linux Device Drivers and from
talking to various kernel hackers, the intended sematics of nopage()
is that it should return the physical page address that it wants the
user's virtual page to get mapped to.

Instead, nopage() must return a virtual address (for example, by
returning "phys_to_virt(page)" instead of "page") for things to work
correctly.

It looks to me like do_no_page() in mm/memory.c uses mk_pte() when it
should be using mk_pte_phys()?

By the way, is there any documentation for the sematics of functions
like nopage() and other interfaces for people trying to write drivers
and such, or is the only way to learn this stuff by looking at other
people's code as well as the code I'm interfacing with (like
do_no_page). It seems like the Linux kernel could really use an
interface description for all the functions kernel programmers call or
implement in their device drivers and whatnot...

Thanks,
Brett

PS If anyone knows of existing (working) driver code that uses
vm_ops->nopage() to implement mmap() I would appreciate a pointer to
it!

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