Re: [PATCH 10 of 20] ipath - support for userspace apps using coredriver

From: Linus Torvalds
Date: Wed Mar 15 2006 - 21:27:04 EST




On Wed, 15 Mar 2006, Bryan O'Sullivan wrote:
>
> I don't know what to to protect chip memory that I'm mapping into
> userspace.
>
> I think I shouldn't be calling SetPageReserved at all, but I don't know
> what I should be doing instead. Naively using get_page instead just
> gets me a big crash.

You should just use "remap_pfn_range()", and new kernels will just
automatically DTRT.

For true chip memory (ie no RAM), even old kernels don't want any
SetPageReserved() games, since there are no actual real real RAM pages for
them - in fact, you shouldn't have any "struct page" to mark reserved -
but if you allocate regular RAM you might want to mark such pages
reserved.

(The current VM no longer needs it or even cares, but that is needed for
older kernels).

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