linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Blaisorblade <blaisorblade@yahoo.it>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Jeff Dike <jdike@addtoit.com>,
	user-mode-linux-devel@lists.sourceforge.net,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	Hugh Dickins <hugh@veritas.com>,
	Val Henson <val.henson@intel.com>
Subject: [PATCH RFP-V4 00/13] remap_file_pages protection support - 4th attempt
Date: Sat, 26 Aug 2006 19:33:35 +0200	[thread overview]
Message-ID: <200608261933.36574.blaisorblade@yahoo.it> (raw)

[-- Attachment #1: Type: text/plain, Size: 2723 bytes --]

Again, about 4 month since last time (for lack of time) I'm sending for final 
review and for inclusion into -mm protection support for remap_file_pages (in 
short "RFP prot support"), i.e. setting per-pte protections (beyond file 
offset) through this syscall.

Since last release, I've changed the PTE bits encoding I've used to avoid 
adding overhead in pte_present() - I don't remember complaints other than this 
one. UML support should follow in a short time.

Below there is the commentary I included last time, with some updates.
I've also attached the program I use for unit testing of the patch.

The patches themselves will only go to akpm, LKML and linux-mm, to avoid an 
invasion of your mailboxes :-)

After this batch of patches has been merged, I will be able to start further 
work basing on those - optimizations, restructuring and such, but the 
functionality is already present; since I had little time I decided to work 
on the basic set first, to avoid too many ports to newer releases.

== Notes ==

Arch-specific bits are provided for i386, x86_64 and UML, and for some other 
archs I have patches I will send, based on the ones which were in -mm when 
Ingo sent the first version of this work.

You shouldn't worry for the number of patches, most of them are very little.
I've last tested them in UML, i386 x86-64 against 2.6.18-rc3/rc4 (where 
_tested_ means compile, boot and unit-tested).

== How it works ==

Protections are set in the page tables when the page is loaded, are saved into 
the PTE when the page is swapped out and restored when the page is faulted 
back in.

Additionally, we modify the fault handler since the VMA protections aren't 
valid for PTE with modified protections.

Finally, we must also provide, for each arch, macros to store also the 
protections into the PTE; to make the kernel compile for any arch, I've added 
since last time dummy default macros to keep the same functionality.

== What is this for ==

The first idea is to use this for UML - it must create a lot of single page 
mappings, and managing them through separate VMAs is slow (in last discussion 
Ingo Molnar provided impressive numbers about this).

With a little additional change (to allow limited usage on MAP_PRIVATE 
readonly VMAs) it will be possible to use this also for shared objects guard 
pages on x86_64; guard pages for thread stacks can also be easily addressed; 
handling read/write private vmas (which was in Ulrich's wish list) was also 
maybe possible but there are limitations for that so I've left that totally 
apart.
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade
http://www.user-mode-linux.org/~blaisorblade

[-- Attachment #2: fremap-test-complete.c.bz2 --]
[-- Type: application/x-bzip2, Size: 5510 bytes --]

             reply	other threads:[~2006-08-26 17:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-26 17:33 Blaisorblade [this message]
2006-08-26 17:37 ` [PATCH RFP-V4 03/13] RFP prot support: add needed macros Paolo 'Blaisorblade' Giarrusso, Paolo 'Blaisorblade' Giarrusso
2006-08-26 17:42 ` [PATCH RFP-V4 01/13] RFP: new bitmask_trans in <linux/bitops.h> Paolo 'Blaisorblade' Giarrusso, Paolo 'Blaisorblade' Giarrusso
2006-08-26 17:42 ` [PATCH RFP-V4 02/13] Fix comment about remap_file_pages Paolo 'Blaisorblade' Giarrusso, Paolo 'Blaisorblade' Giarrusso
2006-08-26 17:42 ` [PATCH RFP-V4 03/13] RFP prot support: add needed macros Paolo 'Blaisorblade' Giarrusso, Paolo 'Blaisorblade' Giarrusso
2006-08-26 17:42 ` [PATCH RFP-V4 04/13] RFP prot support: handle MANYPROTS VMAs Paolo 'Blaisorblade' Giarrusso, Paolo 'Blaisorblade' Giarrusso
2006-08-26 17:42 ` [PATCH RFP-V4 05/13] RFP prot support: disallow mprotect() on manyprots mappings Paolo 'Blaisorblade' Giarrusso, Paolo 'Blaisorblade' Giarrusso
2006-08-26 17:42 ` [PATCH RFP-V4 06/13] RFP prot support: cleanup syscall checks Paolo 'Blaisorblade' Giarrusso, Paolo 'Blaisorblade' Giarrusso
2006-08-26 17:42 ` [PATCH RFP-V4 07/13] RFP prot support: enhance syscall interface Paolo 'Blaisorblade' Giarrusso, Ingo Molnar, Paolo 'Blaisorblade' Giarrusso
2006-08-26 17:42 ` [PATCH RFP-V4 08/13] RFP prot support: support private vma for MAP_POPULATE Paolo 'Blaisorblade' Giarrusso, Ingo Molnar
2006-08-26 17:42 ` [PATCH RFP-V4 09/13] RFP prot support: use FAULT_SIGSEGV for protection checking Paolo 'Blaisorblade' Giarrusso, Paolo 'Blaisorblade' Giarrusso, Ingo Molnar
2006-08-26 17:42 ` [PATCH RFP-V4 10/13] RFP prot support: fix race condition with concurrent faults on same address space Paolo 'Blaisorblade' Giarrusso, Paolo 'Blaisorblade' Giarrusso
2006-08-26 17:42 ` [PATCH RFP-V4 11/13] RFP prot support: fix get_user_pages() on VM_MANYPROTS vmas Paolo 'Blaisorblade' Giarrusso, Paolo 'Blaisorblade' Giarrusso
2006-08-26 17:42 ` [PATCH RFP-V4 12/13] RFP prot support: also set VM_NONLINEAR on nonuniform VMAs Paolo 'Blaisorblade' Giarrusso, Paolo 'Blaisorblade' Giarrusso
2006-08-26 17:42 ` [PATCH RFP-V4 13/13] RFP prot support: uml, i386, x64 bits Paolo 'Blaisorblade' Giarrusso, Paolo 'Blaisorblade' Giarrusso, Ingo Molnar
2006-08-28 20:49 ` [PATCH RFP-V4 00/13] remap_file_pages protection support - 4th attempt Andrew Morton
2006-08-29  8:22   ` Paolo Giarrusso

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=200608261933.36574.blaisorblade@yahoo.it \
    --to=blaisorblade@yahoo.it \
    --cc=akpm@osdl.org \
    --cc=hugh@veritas.com \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=nickpiggin@yahoo.com.au \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=val.henson@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox