lkml.org 
[lkml]   [2005]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[patch 07/18] remap_file_pages protection support: safety net for lazy arches
From
Date

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Since proper support requires that the arch at the very least handles
VM_FAULT_SIGSEGV, as in next patch (otherwise the arch may BUG), and things
are even more complex (see next patches), and it's triggerable only with
VM_NONUNIFORM vma's, simply refuse creating them if the arch doesn't declare
itself ready.

This is a very temporary hack, so I've clearly marked it as such. And, with
current rythms, I've given about 6 months for arches to get ready. Reducing
this time is perfectly ok for me.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---
linux-2.6.git-paolo/Documentation/feature-removal-schedule.txt | 12 ++++++++++
linux-2.6.git-paolo/include/asm-i386/pgtable.h | 3 ++
linux-2.6.git-paolo/include/asm-um/pgtable.h | 3 ++
linux-2.6.git-paolo/mm/fremap.c | 5 ++++
4 files changed, 23 insertions(+)
diff -puN mm/fremap.c~rfp-safety-net-for-archs mm/fremap.c
--- linux-2.6.git/mm/fremap.c~rfp-safety-net-for-archs 2005-08-24 20:57:18.000000000 +0200
+++ linux-2.6.git-paolo/mm/fremap.c 2005-08-24 20:57:18.000000000 +0200
@@ -188,6 +188,11 @@ asmlinkage long sys_remap_file_pages(uns
int has_write_lock = 0;
pgprot_t pgprot;

+ /* Hack for not-updated archs, KILLME after 2.6.16! */
+#ifndef __ARCH_SUPPORTS_VM_NONUNIFORM
+ if (flags & MAP_NOINHERIT)
+ goto out;
+#endif
if (prot && !(flags & MAP_NOINHERIT))
goto out;
/*
diff -puN include/asm-i386/pgtable.h~rfp-safety-net-for-archs include/asm-i386/pgtable.h
--- linux-2.6.git/include/asm-i386/pgtable.h~rfp-safety-net-for-archs 2005-08-24 20:57:18.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-i386/pgtable.h 2005-08-24 20:57:18.000000000 +0200
@@ -419,4 +419,7 @@ extern void noexec_setup(const char *str
#define __HAVE_ARCH_PTE_SAME
#include <asm-generic/pgtable.h>

+/* Hack for not-updated archs, KILLME after 2.6.16! */
+#define __ARCH_SUPPORTS_VM_NONUNIFORM
+
#endif /* _I386_PGTABLE_H */
diff -puN include/asm-um/pgtable.h~rfp-safety-net-for-archs include/asm-um/pgtable.h
--- linux-2.6.git/include/asm-um/pgtable.h~rfp-safety-net-for-archs 2005-08-24 20:57:18.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-um/pgtable.h 2005-08-24 20:57:18.000000000 +0200
@@ -359,6 +359,9 @@ static inline pte_t pte_modify(pte_t pte

#include <asm-generic/pgtable-nopud.h>

+/* Hack for not-updated archs, KILLME after 2.6.16! */
+#define __ARCH_SUPPORTS_VM_NONUNIFORM
+
#endif
#endif

diff -puN Documentation/feature-removal-schedule.txt~rfp-safety-net-for-archs Documentation/feature-removal-schedule.txt
--- linux-2.6.git/Documentation/feature-removal-schedule.txt~rfp-safety-net-for-archs 2005-08-24 20:57:18.000000000 +0200
+++ linux-2.6.git-paolo/Documentation/feature-removal-schedule.txt 2005-08-24 20:57:18.000000000 +0200
@@ -135,3 +135,15 @@ Why: With the 16-bit PCMCIA subsystem no
pcmciautils package available at
http://kernel.org/pub/linux/utils/kernel/pcmcia/
Who: Dominik Brodowski <linux@brodo.de>
+
+---------------------------
+
+What: __ARCH_SUPPORTS_VM_NONUNIFORM
+When: December 2005
+Files: mm/fremap.c, include/asm-*/pgtable.h
+Why: It's just there to allow arches to update their page fault handlers to
+ support VM_FAULT_SIGSEGV, for remap_file_pages protection support.
+ Since they may BUG if this support is not added, the syscall code
+ refuses this new operation mode unless the arch declares itself as
+ "VM_FAULT_SIGSEGV-aware" with this macro.
+Who: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-08-26 19:04    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site