Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

[patch 06/18] remap_file_pages protection support: support..

 
   Linux (Home) -> Kernel RSS
Next:  [patch 03/18] remap_file_pages protection support..  
Author Message
blaisorblade

External


Since: Jul 07, 2005
Posts: 105



(Msg. 1) Posted: Fri Aug 26, 2005 7:20 pm
Post subject: [patch 06/18] remap_file_pages protection support: support private vma for MAP_POPULATE
Archived from groups: linux>kernel (more info?)

From: Ingo Molnar <mingo.TakeThisOut@elte.hu>

Fix MAP_POPULATE | MAP_PRIVATE. We don't need the VMA to be shared if we don't
rearrange pages around. And it's trivial to do.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade.TakeThisOut@yahoo.it>
---

linux-2.6.git-paolo/mm/fremap.c | 7 ++++---
linux-2.6.git-paolo/mm/mmap.c | 4 ++++
2 files changed, 8 insertions(+), 3 deletions(-)

diff -puN mm/fremap.c~rfp-private-vma-2 mm/fremap.c
--- linux-2.6.git/mm/fremap.c~rfp-private-vma-2 2005-08-24 20:57:13.000000000 +0200
+++ linux-2.6.git-paolo/mm/fremap.c 2005-08-24 20:57:13.000000000 +0200
@@ -221,9 +221,6 @@ retry:
if (!vma)
goto out_unlock;

- if (!(vma->vm_flags & VM_SHARED))
- goto out_unlock;
-
if (!vma->vm_ops || !vma->vm_ops->populate || end <= start || start <
vma->vm_start || end > vma->vm_end)
goto out_unlock;
@@ -246,6 +243,8 @@ retry:
/* Must set VM_NONLINEAR before any pages are populated. */
if (pgoff != linear_page_index(vma, start) &&
!(vma->vm_flags & VM_NONLINEAR)) {
+ if (!(vma->vm_flags & VM_SHARED))
+ goto out_unlock;
if (!has_write_lock) {
up_read(&mm->mmap_sem);
down_write(&mm->mmap_sem);
@@ -264,6 +263,8 @@ retry:

if (pgprot_val(pgprot) != pgprot_val(vma->vm_page_prot) &&
!(vma->vm_flags & VM_NONUNIFORM)) {
+ if (!(vma->vm_flags & VM_SHARED))
+ goto out_unlock;
if (!has_write_lock) {
up_read(&mm->mmap_sem);
down_write(&mm->mmap_sem);
diff -puN mm/mmap.c~rfp-private-vma-2 mm/mmap.c
--- linux-2.6.git/mm/mmap.c~rfp-private-vma-2 2005-08-24 20:57:13.000000000 +0200
+++ linux-2.6.git-paolo/mm/mmap.c 2005-08-24 20:57:13.000000000 +0200
@@ -1124,6 +1124,10 @@ out:
}
if (flags & MAP_POPULATE) {
up_write(&mm->mmap_sem);
+ /*
+ * remap_file_pages() works even if the mapping is private,
+ * in the linearly-mapped case:
+ */
sys_remap_file_pages(addr, len, 0,
pgoff, flags & MAP_NONBLOCK);
down_write(&mm->mmap_sem);
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.TakeThisOut@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Display posts from previous:   
Related Topics:
[patch 18/39] remap_file_pages protection support: add VM_.. - From: Ingo Molnar <mingo@elte.hu> Since with remap_file_pages w/prot we may put PROT_NONE on a single PTE rather than a VMA, we must handle that inside handle_mm_fault. This value must be handled in the arch-specific fault handlers, and this chan...

[patch 34/39] remap_file_pages protection support: restric.. - From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Yet to test. Currently we install a PTE when one is missing irrispective of the fault type, and if the access type is prohibited we'll get another fault and kill the process only then. W...

[patch 32/39] remap_file_pages protection support: fix i38.. - From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Actually, with the current model, we should get a failure with VMA's mapped with only PROT_WRITE (even if I wasn't able to verify that in UML, which has similar code). To test! Signed-...

[patch 34/39] remap_file_pages protection support: restric.. - From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Yet to test. Currently we install a PTE when one is missing irrispective of the fault type, and if the access type is prohibited we'll get another fault and kill the process only then. W...

[patch 02/18] remap_file_pages protection support: handle .. - From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Handle the possible existance of VM_NONUNIFORM vmas, without actually creating them. * Replace old uses of pgoff_to_pte with pgoff_prot_to_pte. * Introduce the flag, use it to read perm...
       Linux (Home) -> Kernel All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
  Linux Forums
 Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact