Source-Changes-HG archive

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

[src/rmind-uvmplock]: src/sys - Drop vmmap and its reserved page on hp700, sp...



details:   https://anonhg.NetBSD.org/src/rev/dfc7b31db4c8
branches:  rmind-uvmplock
changeset: 753053:dfc7b31db4c8
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sun Apr 25 21:08:41 2010 +0000

description:
- Drop vmmap and its reserved page on hp700, sparc and x86.
- mm_init: use UVM_KMF_WAITVA when allocating a VA.

diffstat:

 sys/arch/hp700/hp700/machdep.c |  15 ++-------------
 sys/arch/shark/ofw/ofrom.c     |   8 +++-----
 sys/arch/sparc/sparc/pmap.c    |   7 ++-----
 sys/arch/x86/x86/pmap.c        |  11 ++---------
 sys/dev/mm.c                   |   7 ++++---
 5 files changed, 13 insertions(+), 35 deletions(-)

diffs (196 lines):

diff -r 6d2bff85776f -r dfc7b31db4c8 sys/arch/hp700/hp700/machdep.c
--- a/sys/arch/hp700/hp700/machdep.c    Sun Apr 25 20:20:57 2010 +0000
+++ b/sys/arch/hp700/hp700/machdep.c    Sun Apr 25 21:08:41 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.79.2.3 2010/04/25 19:39:00 rmind Exp $   */
+/*     $NetBSD: machdep.c,v 1.79.2.4 2010/04/25 21:08:41 rmind Exp $   */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.79.2.3 2010/04/25 19:39:00 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.79.2.4 2010/04/25 21:08:41 rmind Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -245,9 +245,6 @@
 struct extent *hp700_io_extent;
 static long hp700_io_extent_store[EXTENT_FIXED_STORAGE_SIZE(64) / sizeof(long)];
 
-/* Virtual page frame for /dev/mem (see mem.c) */
-vaddr_t vmmap;
-
 /* Our exported CPU info; we can have only one. */
 struct cpu_info cpu_info_store = {
 #ifdef MULTIPROCESSOR
@@ -875,14 +872,6 @@
 #endif
        format_bytes(pbuf[0], sizeof(pbuf[0]), ptoa(uvmexp.free));
        printf("avail mem = %s\n", pbuf[0]);
-
-       /*
-        * Allocate a virtual page (for use by /dev/mem)
-        * This page is handed to pmap_enter() therefore
-        * it has to be in the normal kernel VA range.
-        */
-       vmmap = uvm_km_alloc(kernel_map, PAGE_SIZE, 0,
-           UVM_KMF_VAONLY | UVM_KMF_WAITVA);
 }
 
 /*
diff -r 6d2bff85776f -r dfc7b31db4c8 sys/arch/shark/ofw/ofrom.c
--- a/sys/arch/shark/ofw/ofrom.c        Sun Apr 25 20:20:57 2010 +0000
+++ b/sys/arch/shark/ofw/ofrom.c        Sun Apr 25 21:08:41 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofrom.c,v 1.20 2009/03/14 21:04:16 dsl Exp $   */
+/*     $NetBSD: ofrom.c,v 1.20.4.1 2010/04/25 21:08:41 rmind Exp $     */
 
 /*
  * Copyright 1998
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofrom.c,v 1.20 2009/03/14 21:04:16 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofrom.c,v 1.20.4.1 2010/04/25 21:08:41 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -138,9 +138,7 @@
        if (!sc || !sc->enabled)
                return (ENXIO);                 /* XXX PANIC */
 
-       /* lock against other uses of shared vmmap */
        mutex_enter(&memlock);
-
        while (uio->uio_resid > 0 && error == 0) {
                iov = uio->uio_iov;
                if (iov->iov_len == 0) {
@@ -159,6 +157,7 @@
                if (uio->uio_offset >= sc->size)
                        break;
 
+               /* XXX: Use unamanged mapping. */
                v = sc->base + uio->uio_offset;
                pmap_enter(pmap_kernel(), (vaddr_t)memhook,
                    trunc_page(v), uio->uio_rw == UIO_READ ?
@@ -171,7 +170,6 @@
                    (vaddr_t)memhook + PAGE_SIZE);
                pmap_update(pmap_kernel());
        }
-
        mutex_exit(&memlock);
 
        return (error);
diff -r 6d2bff85776f -r dfc7b31db4c8 sys/arch/sparc/sparc/pmap.c
--- a/sys/arch/sparc/sparc/pmap.c       Sun Apr 25 20:20:57 2010 +0000
+++ b/sys/arch/sparc/sparc/pmap.c       Sun Apr 25 21:08:41 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.339 2009/12/20 03:48:30 mrg Exp $ */
+/*     $NetBSD: pmap.c,v 1.339.4.1 2010/04/25 21:08:42 rmind Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.339 2009/12/20 03:48:30 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.339.4.1 2010/04/25 21:08:42 rmind Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -349,7 +349,6 @@
 void   ctx_alloc(struct pmap *);
 void   ctx_free(struct pmap *);
 
-void * vmmap;                  /* one reserved MI vpage for /dev/mem */
 /*void *       vdumppages;     -* 32KB worth of reserved dump pages */
 
 smeg_t         tregion;        /* [4/3mmu] Region for temporary mappings */
@@ -3214,7 +3213,6 @@
        i = p;
        cpuinfo.vpage[0] = (void *)p, p += NBPG;
        cpuinfo.vpage[1] = (void *)p, p += NBPG;
-       vmmap = (void *)p, p += NBPG;
        p = (vaddr_t)reserve_dumppages((void *)p);
 
        virtual_avail = p;
@@ -3726,7 +3724,6 @@
        q = p;
        cpuinfo.vpage[0] = (void *)p, p += NBPG;
        cpuinfo.vpage[1] = (void *)p, p += NBPG;
-       vmmap = (void *)p, p += NBPG;
        p = (vaddr_t)reserve_dumppages((void *)p);
 
        /* Find PTE locations of vpage[] to optimize zero_fill() et.al. */
diff -r 6d2bff85776f -r dfc7b31db4c8 sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c   Sun Apr 25 20:20:57 2010 +0000
+++ b/sys/arch/x86/x86/pmap.c   Sun Apr 25 21:08:41 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.105.2.2 2010/04/25 15:47:52 rmind Exp $     */
+/*     $NetBSD: pmap.c,v 1.105.2.3 2010/04/25 21:08:43 rmind Exp $     */
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -149,7 +149,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.105.2.2 2010/04/25 15:47:52 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.105.2.3 2010/04/25 21:08:43 rmind Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -545,8 +545,6 @@
 };
 #endif /* PAE */
 
-void *vmmap; /* XXX: used by mem.c... it should really uvm_map_reserve it */
-
 extern vaddr_t idt_vaddr;                      /* we allocate IDT early */
 extern paddr_t idt_paddr;
 
@@ -1465,11 +1463,6 @@
         */
        pte = (void *)0xdeadbeef;
 
-       /* XXX: vmmap used by mem.c... should be uvm_map_reserve */
-       /* XXXfvdl PTEs not needed here */
-       vmmap = (char *)virtual_avail;                  /* don't need pte */
-       virtual_avail += PAGE_SIZE; pte++;
-
 #ifdef XEN
 #ifdef __x86_64__
        /*
diff -r 6d2bff85776f -r dfc7b31db4c8 sys/dev/mm.c
--- a/sys/dev/mm.c      Sun Apr 25 20:20:57 2010 +0000
+++ b/sys/dev/mm.c      Sun Apr 25 21:08:41 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mm.c,v 1.13.16.2 2010/04/25 15:27:35 rmind Exp $       */
+/*     $NetBSD: mm.c,v 1.13.16.3 2010/04/25 21:08:45 rmind Exp $       */
 
 /*-
  * Copyright (c) 2002, 2008, 2010 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mm.c,v 1.13.16.2 2010/04/25 15:27:35 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mm.c,v 1.13.16.3 2010/04/25 21:08:45 rmind Exp $");
 
 #include "opt_compat_netbsd.h"
 
@@ -94,7 +94,8 @@
 
 #ifndef __HAVE_MM_MD_PREFER_VA
        /* KVA for mappings during I/O. */
-       dev_mem_addr = uvm_km_alloc(kernel_map, PAGE_SIZE, 0, UVM_KMF_VAONLY);
+       dev_mem_addr = uvm_km_alloc(kernel_map, PAGE_SIZE, 0,
+           UVM_KMF_VAONLY|UVM_KMF_WAITVA);
        KASSERT(dev_mem_addr != 0);
 #endif
 }



Home | Main Index | Thread Index | Old Index