From: Wink Saville <wink@saville.com>
To: linux-kernel@vger.kernel.org
Subject: How-to change a pages pte
Date: Wed, 25 Oct 2006 23:58:39 -0700 [thread overview]
Message-ID: <45405C9F.60105@saville.com> (raw)
Hello,
I've created a simple device driver that maps a single page of kernel memory into user space using the technique described in chapter 15 (pg 431) of Linux Device Drivers 3rd edition. But I've simplified it further, I map only one page at driver initialization time with a call to get_zeroed_page. When vm_open is called I set vm_flags & vm_page_prot to the values I want and when vm_nopage is called I use virt_to_page to return a struct page*. This seems to working fine on my Intel Core 2 Duo running a x86_64 kernel I've built.
My question is how can I change the protection bits (pte) of the kernel's view of the page returned by get_zeroed_page?
In looking at the kernel sources, the code in mm/mprotect.c such as, change_protection, is the closest to what I think I want, but it works with vm_area_struct's not page_struct's.
Regards,
Wink Saville
reply other threads:[~2006-10-26 6:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45405C9F.60105@saville.com \
--to=wink@saville.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.