Re: [Q] How to set a page's protection from kernel land?

David S. Miller (davem@dm.cobaltmicro.com)
Tue, 18 Aug 1998 05:22:44 -0700


Date: Tue, 18 Aug 1998 13:51:02 +0200
From: Inaky Perez Gonzalez <inaky@peloncho.fis.ucm.es>

I've been some hours trying to guess how to do this:

unsigned long pages;
pages = __get_free_pages (1, GFP_KERNEL);
mprotect (pages, 2*PAGE_SIZE, PROT_NONE);

Simply, you can't. Or at best, it'll be difficult, especially because
the kernel maps the bulk of it's address space using large 4MB (or
larger on some architectures) page mappings, also many ports have
special optimizations for the kernel pages or the kernel pages have
not page tables at all and the translation is hard coded in the TLB
miss handlers for high performance.

Later,
David S. Miller
davem@dm.cobaltmicro.com

-
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.altern.org/andrebalsa/doc/lkml-faq.html