Re: memory mapping of vmalloc

From: Hugh Dickins
Date: Tue Mar 01 2005 - 12:20:58 EST


On Tue, 1 Mar 2005, Prakash Bhurke wrote:
> I am trying to map a vmalloc kernel buffer to user
> space using remap_page_range(). In my module, this
> function returns success if we call mmap() from user
> space, but i can not access content of vmalloc buffer
> from user space. Pointer returned by mmap() syscall
> seems pointing to other memory page which contains
> zeros. I am using linux 2.6.10 kernel on Pentium 4
> system.

Look for "rvmalloc" in various drivers in the kernel source tree:
you must SetPageReserved before remap_pfn_range (or remap_page_range)
agrees to map the page, and ClearPageReserved before freeing after.

Hugh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/