Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Revert MAP_NOSYSCALLS patch.



details:   https://anonhg.NetBSD.org/src/rev/d0e294d53b14
branches:  trunk
changeset: 772477:d0e294d53b14
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Thu Jan 05 15:19:52 2012 +0000

description:
Revert MAP_NOSYSCALLS patch.

diffstat:

 lib/libc/sys/mmap.2  |   5 +--
 sys/sys/mman.h       |  10 +------
 sys/sys/proc.h       |   3 +-
 sys/uvm/uvm_extern.h |   7 +----
 sys/uvm/uvm_map.c    |  72 +--------------------------------------------------
 sys/uvm/uvm_mmap.c   |  23 +---------------
 6 files changed, 8 insertions(+), 112 deletions(-)

diffs (225 lines):

diff -r 92701df26d9d -r d0e294d53b14 lib/libc/sys/mmap.2
--- a/lib/libc/sys/mmap.2       Thu Jan 05 13:26:51 2012 +0000
+++ b/lib/libc/sys/mmap.2       Thu Jan 05 15:19:52 2012 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: mmap.2,v 1.46 2011/12/20 16:43:14 wiz Exp $
+.\"    $NetBSD: mmap.2,v 1.47 2012/01/05 15:19:52 reinoud Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -180,9 +180,6 @@
 will be seen.
 .It Dv MAP_SHARED
 Modifications are shared.
-.It Dv MAP_NOSYSCALLS
-No system calls are to be allowed from within this mapped region.
-They instead generate an illegal instruction signal.
 .El
 .Pp
 The
diff -r 92701df26d9d -r d0e294d53b14 sys/sys/mman.h
--- a/sys/sys/mman.h    Thu Jan 05 13:26:51 2012 +0000
+++ b/sys/sys/mman.h    Thu Jan 05 15:19:52 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mman.h,v 1.43 2011/12/20 15:39:35 reinoud Exp $        */
+/*     $NetBSD: mman.h,v 1.44 2012/01/05 15:19:52 reinoud Exp $        */
 
 /*-
  * Copyright (c) 1982, 1986, 1993
@@ -98,14 +98,6 @@
 #define        MAP_STACK       0x2000  /* allocated from memory, swap space (stack) */
 
 /*
- * Map attributes 0x00010000 till 0x00ff0000
- */
-#define MAP_ATTR(n)            ((n) << MAP_ATTRIB_SHIFT)
-#define MAP_ATTRIB_SHIFT       16
-#define MAP_ATTRIB_MASK                MAP_ATTR(0xff)
-#define MAP_NOSYSCALLS         MAP_ATTR(0x01) /* no syscalls allowed */
-
-/*
  * Alignment (expressed in log2).  Must be >= log2(PAGE_SIZE) and
  * < # bits in a pointer (26 (acorn26), 32 or 64).
  */
diff -r 92701df26d9d -r d0e294d53b14 sys/sys/proc.h
--- a/sys/sys/proc.h    Thu Jan 05 13:26:51 2012 +0000
+++ b/sys/sys/proc.h    Thu Jan 05 15:19:52 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.312 2011/12/20 15:39:35 reinoud Exp $       */
+/*     $NetBSD: proc.h,v 1.313 2012/01/05 15:19:53 reinoud Exp $       */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -353,7 +353,6 @@
 #define        PK_NOCLDWAIT    0x00020000 /* No zombies if child dies */
 #define        PK_32           0x00040000 /* 32-bit process (used on 64-bit kernels) */
 #define        PK_CLDSIGIGN    0x00080000 /* Process is ignoring SIGCHLD */
-#define PK_CHKNOSYSCALL 0x00100000 /* Process needs NOSYSCALL checking */
 #define        PK_MARKER       0x80000000 /* Is a dummy marker process */
 
 /*
diff -r 92701df26d9d -r d0e294d53b14 sys/uvm/uvm_extern.h
--- a/sys/uvm/uvm_extern.h      Thu Jan 05 13:26:51 2012 +0000
+++ b/sys/uvm/uvm_extern.h      Thu Jan 05 15:19:52 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_extern.h,v 1.178 2011/12/22 13:12:50 reinoud Exp $ */
+/*     $NetBSD: uvm_extern.h,v 1.179 2012/01/05 15:19:53 reinoud Exp $ */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -680,11 +680,6 @@
 
 void                   uvm_whatis(uintptr_t, void (*)(const char *, ...));
 
-void                   uvm_map_setattr(struct vm_map *, vaddr_t,
-                           vaddr_t, uint32_t);
-bool                   uvm_map_checkattr(struct vm_map *, vaddr_t,
-                           vaddr_t, uint32_t);
-
 /* uvm_meter.c */
 int                    uvm_sysctl(int *, u_int, void *, size_t *,
                            void *, size_t, struct proc *);
diff -r 92701df26d9d -r d0e294d53b14 sys/uvm/uvm_map.c
--- a/sys/uvm/uvm_map.c Thu Jan 05 13:26:51 2012 +0000
+++ b/sys/uvm/uvm_map.c Thu Jan 05 15:19:52 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_map.c,v 1.309 2011/12/22 13:12:50 reinoud Exp $    */
+/*     $NetBSD: uvm_map.c,v 1.310 2012/01/05 15:19:53 reinoud Exp $    */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.309 2011/12/22 13:12:50 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.310 2012/01/05 15:19:53 reinoud Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -1672,7 +1672,6 @@
                new_entry->protection = prot;
                new_entry->max_protection = maxprot;
                new_entry->inheritance = inherit;
-               new_entry->map_attrib = 0;              /* XXX could be passed too */
                new_entry->wired_count = 0;
                new_entry->advice = advice;
                if (flags & UVM_FLAG_OVERLAY) {
@@ -4122,73 +4121,6 @@
 }
 
 /*
- * uvm_map_setattr: set uvm-external mapping attributes in map
- *
- * => map must be read or write locked by caller.
- */
-
-void
-uvm_map_setattr(struct vm_map *map, vaddr_t start, vaddr_t end,
-    uint32_t map_attrib)
-{
-       struct vm_map_entry *entry;
-       struct vm_map_entry *tmp_entry;
-
-       /* safety */
-       if (!uvm_map_lookup_entry(map, start, &tmp_entry))
-               return;
-       entry = tmp_entry;
-       while (start < end) {
-               /* set attributes associated with entry */
-               entry->map_attrib = map_attrib;
-
-               /* empty one */
-               if (entry == &map->header)
-                       return;
-
-               start = entry->end;
-               entry = entry->next;
-       }
-}
-
-/*
- * uvm_map_checkattr: check attribute bits in map
- *
- * => check if attribute is present in the region.
- * => map must be read or write locked by caller.
- */
-
-bool
-uvm_map_checkattr(struct vm_map *map, vaddr_t start, vaddr_t end,
-    uint32_t map_attrib)
-{
-       struct vm_map_entry *entry;
-       struct vm_map_entry *tmp_entry;
-
-       if (!uvm_map_lookup_entry(map, start, &tmp_entry))
-               return (false);
-
-       entry = tmp_entry;
-       while (start < end) {
-               if (entry == &map->header)
-                       return (false);
-
-               /*
-                * check attribute associated with entry
-                */
-
-               if ((entry->map_attrib & map_attrib) == map_attrib) {
-                       return (true);
-               }
-
-               start = entry->end;
-               entry = entry->next;
-       }
-       return (false);
-}
-
-
-/*
  * uvmspace_alloc: allocate a vmspace structure.
  *
  * - structure includes vm_map and pmap
diff -r 92701df26d9d -r d0e294d53b14 sys/uvm/uvm_mmap.c
--- a/sys/uvm/uvm_mmap.c        Thu Jan 05 13:26:51 2012 +0000
+++ b/sys/uvm/uvm_mmap.c        Thu Jan 05 15:19:52 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_mmap.c,v 1.142 2011/12/22 13:12:50 reinoud Exp $   */
+/*     $NetBSD: uvm_mmap.c,v 1.143 2012/01/05 15:19:53 reinoud Exp $   */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.142 2011/12/22 13:12:50 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.143 2012/01/05 15:19:53 reinoud Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_pax.h"
@@ -547,25 +547,6 @@
                /* remember to add offset */
                *retval = (register_t)(addr + pageoff);
 
-       /*
-        * Support for map attributes; XXX preferably given as an
-        * extra parameter to uvm_map or merged with uvmflag.
-        * Implemented now as setting parameters after the mapping.
-        */
-       if (error == 0) {
-               if (flags & MAP_ATTRIB_MASK) {
-                       uvm_map_setattr(&p->p_vmspace->vm_map,
-                                       addr, addr + size,
-                                       flags & MAP_ATTRIB_MASK);
-               }
-               /* record if we need optimization for system call checking */
-               if ((flags & MAP_NOSYSCALLS) &&
-                               ((p->p_flag & PK_CHKNOSYSCALL) == 0)) {
-                       mutex_enter(p->p_lock);
-                       p->p_flag |= PK_CHKNOSYSCALL;
-                       mutex_exit(p->p_lock);
-               }
-       }
        if (fp != NULL)
                fd_putfile(fd);
 



Home | Main Index | Thread Index | Old Index