Re: problem with implementing mmap

From: Muli Ben-Yehuda (mulix_at_nonexisting.hamakor.org.il)
Date: Sun 30 Jan 2005 - 16:50:55 IST


On Sun, Jan 30, 2005 at 12:48:27PM +0200, Ilan Finci wrote:

> Then I've implemented the mmap function, using "remap_page_range",
> everything seems to be working fine (I've checked all returned codes to
> be sure, both in the driver, and in the user space application.

remap_page_range has some peculiarities. In particular, are you
setting the pages you are mapping to PageReserved first?

See this discussion: http://lwn.net/Articles/28746/ (which also
recommends using a nopage VM op rather than remap_page_range).

> Calling mmap from the user application returns an address, but trying to
> access this address, yields an error message:
>
> do_wp_page: bogus page at address 30027024 (page 0xc23358e0)
> VM: killing process testSram

Are your pages appearing in mem_map? the error implies that they
aren't.

The best generic advice I can give you is to find some code someone
else already wrote (that works...) that does the same thing or
something close to it. In this case, that would be a driver that maps
memory that is not accessible as part of normal system ram - maybe
graphics memory?

Cheers,
Muli

-- 
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/

=================================================================
To unsubscribe, send mail to linux-il-request_at_linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request_at_linux.org.il




This archive was generated by hypermail 2.1.7 : Sun 30 Jan 2005 - 17:00:15 IST