linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFP-V4 00/13] remap_file_pages protection support - 4th attempt
@ 2006-08-26 17:33 Blaisorblade
  2006-08-26 17:37 ` [PATCH RFP-V4 03/13] RFP prot support: add needed macros Paolo 'Blaisorblade' Giarrusso, Paolo 'Blaisorblade' Giarrusso
                   ` (14 more replies)
  0 siblings, 15 replies; 17+ messages in thread
From: Blaisorblade @ 2006-08-26 17:33 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, LKML, Ingo Molnar, Jeff Dike, user-mode-linux-devel,
	Nick Piggin, Hugh Dickins, Val Henson

[-- 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 --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2006-08-29  8:22 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-26 17:33 [PATCH RFP-V4 00/13] remap_file_pages protection support - 4th attempt Blaisorblade
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox