head 1.9; access; symbols; locks cherry:1.9; strict; comment @# @; 1.9 date 2016.12.13.12.56.39; author cherry; state Exp; branches; next 1.8; 1.8 date 2016.11.20.11.11.46; author cherry; state Exp; branches; next 1.7; 1.7 date 2016.11.20.11.08.57; author cherry; state Exp; branches; next 1.6; 1.6 date 2016.11.17.15.45.02; author cherry; state Exp; branches; next 1.5; 1.5 date 2016.11.13.11.23.05; author cherry; state Exp; branches; next 1.4; 1.4 date 2016.10.30.17.28.09; author cherry; state Exp; branches; next 1.3; 1.3 date 2016.10.28.08.32.31; author cherry; state Exp; branches; next 1.2; 1.2 date 2016.10.28.08.27.28; author cherry; state Exp; branches; next 1.1; 1.1 date 2016.10.20.14.29.34; author cherry; state Exp; branches; next ; desc @Initial version for fox review @ 1.9 log @s/physmem/physseg// remove rump testing and dependency for tests @ text @Index: sys/arch/acorn26/acorn26/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/acorn26/acorn26/pmap.c,v retrieving revision 1.36 diff -p -u -r1.36 pmap.c --- sys/arch/acorn26/acorn26/pmap.c 11 May 2012 15:39:17 -0000 1.36 +++ sys/arch/acorn26/acorn26/pmap.c 13 Dec 2016 12:42:54 -0000 @@@@ -293,19 +293,26 @@@@ pmap_bootstrap(int npages, paddr_t zp_ph vaddr_t pmap_steal_memory(vsize_t size, vaddr_t *vstartp, vaddr_t *vendp) { - int i; vaddr_t addr; + uvm_physseg_t bank; + UVMHIST_FUNC("pmap_steal_memory"); UVMHIST_CALLED(pmaphist); addr = 0; size = round_page(size); - for (i = 0; i < vm_nphysseg; i++) { - if (VM_PHYSMEM_PTR(i)->avail_start < VM_PHYSMEM_PTR(i)->avail_end) { + for (bank = uvm_physseg_get_first(); + uvm_physseg_valid(bank); + bank = uvm_physseg_get_next(bank)) { + if (uvm_physseg_get_avail_start(bank) < uvm_physseg_get_avail_end(bank)) { + paddr_t avail_start = uvm_physseg_get_avail_start(bank); + addr = (vaddr_t) ((char*)MEMC_PHYS_BASE + - ptoa(VM_PHYSMEM_PTR(i)->avail_start)); - VM_PHYSMEM_PTR(i)->avail_start++; + ptoa(avail_start)); + avail_start++; + uvm_physseg_set_avail_start(avail_start); + break; } } Index: sys/arch/acorn26/acorn26/start.c =================================================================== RCS file: /cvsroot/src/sys/arch/acorn26/acorn26/start.c,v retrieving revision 1.20 diff -p -u -r1.20 start.c --- sys/arch/acorn26/acorn26/start.c 18 Aug 2013 16:08:42 -0000 1.20 +++ sys/arch/acorn26/acorn26/start.c 13 Dec 2016 12:42:54 -0000 @@@@ -53,6 +53,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: start.c,v 1. #include #include +#include #include "arcvideo.h" #include "ioc.h" @@@@ -126,6 +127,7 @@@@ start(struct bootconfig *initbootconfig) physmem = bootconfig.npages; uvmexp.pagesize = bootconfig.nbpp; uvm_setpagesize(); + uvm_physseg_init(); /* Any others? */ Index: sys/arch/acorn32/acorn32/rpc_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/acorn32/acorn32/rpc_machdep.c,v retrieving revision 1.90 diff -p -u -r1.90 rpc_machdep.c --- sys/arch/acorn32/acorn32/rpc_machdep.c 25 Oct 2014 10:58:12 -0000 1.90 +++ sys/arch/acorn32/acorn32/rpc_machdep.c 13 Dec 2016 12:42:54 -0000 @@@@ -925,6 +925,8 @@@@ initarm(void *cookie) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); + for (loop = 0; loop < bootconfig.dramblocks; loop++) { paddr_t start = (paddr_t)bootconfig.dram[loop].address; paddr_t end = start + (bootconfig.dram[loop].pages * PAGE_SIZE); Index: sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c,v retrieving revision 1.28 diff -p -u -r1.28 eb7500atx_machdep.c --- sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c 25 Oct 2014 10:58:12 -0000 1.28 +++ sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c 13 Dec 2016 12:42:55 -0000 @@@@ -82,6 +82,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: eb7500atx_ma #include #include +#include #include #include @@@@ -863,6 +864,8 @@@@ initarm(void *cookie) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); + for (loop = 0; loop < bootconfig.dramblocks; loop++) { paddr_t start = (paddr_t)bootconfig.dram[loop].address; paddr_t end = start + (bootconfig.dram[loop].pages * PAGE_SIZE); Index: sys/arch/alpha/alpha/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/alpha/alpha/machdep.c,v retrieving revision 1.347 diff -p -u -r1.347 machdep.c --- sys/arch/alpha/alpha/machdep.c 13 Oct 2016 16:18:20 -0000 1.347 +++ sys/arch/alpha/alpha/machdep.c 13 Dec 2016 12:42:55 -0000 @@@@ -104,6 +104,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #include #include @@@@ -227,7 +228,6 @@@@ alpha_init(u_long pfn, u_long ptb, u_lon struct mddt *mddtp; struct mddt_cluster *memc; int i, mddtweird; - struct vm_physseg *vps; struct pcb *pcb0; vaddr_t kernstart, kernend, v; paddr_t kernstartpfn, kernendpfn, pfn0, pfn1; @@@@ -373,7 +373,8 @@@@ nobootinfo: ALPHA_PGBYTES); uvmexp.pagesize = hwrpb->rpb_page_size; uvm_setpagesize(); - + uvm_physseg_init(); + /* * Find out what hardware we're on, and do basic initialization. */ @@@@ -611,23 +612,24 @@@@ nobootinfo: * Initialize error message buffer (at end of core). */ { + paddr_t end; vsize_t sz = (vsize_t)round_page(MSGBUFSIZE); vsize_t reqsz = sz; + uvm_physseg_t bank; - vps = VM_PHYSMEM_PTR(vm_nphysseg - 1); + bank = uvm_physseg_get_last(); /* shrink so that it'll fit in the last segment */ - if ((vps->avail_end - vps->avail_start) < atop(sz)) - sz = ptoa(vps->avail_end - vps->avail_start); + if (uvm_physseg_get_avail_end(bank) - uvm_physseg_get_avail_start(bank) < atop(sz)) + sz = ptoa(uvm_physseg_get_avail_end(bank) - uvm_physseg_get_avail_start(bank)); - vps->end -= atop(sz); - vps->avail_end -= atop(sz); - msgbufaddr = (void *) ALPHA_PHYS_TO_K0SEG(ptoa(vps->end)); - initmsgbuf(msgbufaddr, sz); + end = uvm_physseg_get_end(bank); + end -= atop(sz); - /* Remove the last segment if it now has no pages. */ - if (vps->start == vps->end) - vm_nphysseg--; + uvm_physseg_unplug(end, atop(sz)); + msgbufaddr = (void *) ALPHA_PHYS_TO_K0SEG(ptoa(end)); + + initmsgbuf(msgbufaddr, sz); /* warn if the message buffer had to be shrunk */ if (sz != reqsz) Index: sys/arch/alpha/alpha/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/alpha/alpha/pmap.c,v retrieving revision 1.260 diff -p -u -r1.260 pmap.c --- sys/arch/alpha/alpha/pmap.c 5 Nov 2015 06:26:15 -0000 1.260 +++ sys/arch/alpha/alpha/pmap.c 13 Dec 2016 12:42:55 -0000 @@@@ -784,8 +784,8 @@@@ pmap_bootstrap(paddr_t ptaddr, u_int max * the fact that BSEARCH sorts the vm_physmem[] array * for us. */ - avail_start = ptoa(VM_PHYSMEM_PTR(0)->start); - avail_end = ptoa(VM_PHYSMEM_PTR(vm_nphysseg - 1)->end); + avail_start = ptoa(uvm_physseg_get_avail_start(uvm_physseg_get_first())); + avail_end = ptoa(uvm_physseg_get_avail_end(uvm_physseg_get_last())); virtual_end = VM_MIN_KERNEL_ADDRESS + lev3mapsize * PAGE_SIZE; #if 0 @@@@ -1007,10 +1007,12 @@@@ pmap_virtual_space(vaddr_t *vstartp, vad vaddr_t pmap_steal_memory(vsize_t size, vaddr_t *vstartp, vaddr_t *vendp) { - int bank, npgs, x; + int npgs; vaddr_t va; - paddr_t pa; + paddr_t pa; + uvm_physseg_t bank; + size = round_page(size); npgs = atop(size); @@@@ -1018,50 +1020,36 @@@@ pmap_steal_memory(vsize_t size, vaddr_t printf("PSM: size 0x%lx (npgs 0x%x)\n", size, npgs); #endif - for (bank = 0; bank < vm_nphysseg; bank++) { + for (bank = uvm_physseg_get_first(); + uvm_physseg_valid(bank); + bank = uvm_physseg_get_next(bank)) { if (uvm.page_init_done == true) panic("pmap_steal_memory: called _after_ bootstrap"); #if 0 - printf(" bank %d: avail_start 0x%lx, start 0x%lx, " - "avail_end 0x%lx\n", bank, VM_PHYSMEM_PTR(bank)->avail_start, + printf(" bank %d: avail_start 0x%"PRIxPADDR", start 0x%"PRIxPADDR", " + "avail_end 0x%"PRIxPADDR"\n", bank, VM_PHYSMEM_PTR(bank)->avail_start, VM_PHYSMEM_PTR(bank)->start, VM_PHYSMEM_PTR(bank)->avail_end); #endif - if (VM_PHYSMEM_PTR(bank)->avail_start != VM_PHYSMEM_PTR(bank)->start || - VM_PHYSMEM_PTR(bank)->avail_start >= VM_PHYSMEM_PTR(bank)->avail_end) + if (uvm_physseg_get_avail_start(bank) != uvm_physseg_get_start(bank) || + uvm_physseg_get_avail_start(bank) >= uvm_physseg_get_avail_end(bank)) continue; #if 0 - printf(" avail_end - avail_start = 0x%lx\n", + printf(" avail_end - avail_start = 0x%"PRIxPADDR"\n", VM_PHYSMEM_PTR(bank)->avail_end - VM_PHYSMEM_PTR(bank)->avail_start); #endif - if ((VM_PHYSMEM_PTR(bank)->avail_end - VM_PHYSMEM_PTR(bank)->avail_start) + if (uvm_physseg_get_avail_end(bank) - uvm_physseg_get_avail_start(bank) < npgs) continue; /* * There are enough pages here; steal them! */ - pa = ptoa(VM_PHYSMEM_PTR(bank)->avail_start); - VM_PHYSMEM_PTR(bank)->avail_start += npgs; - VM_PHYSMEM_PTR(bank)->start += npgs; - - /* - * Have we used up this segment? - */ - if (VM_PHYSMEM_PTR(bank)->avail_start == VM_PHYSMEM_PTR(bank)->end) { - if (vm_nphysseg == 1) - panic("pmap_steal_memory: out of memory!"); - - /* Remove this segment from the list. */ - vm_nphysseg--; - for (x = bank; x < vm_nphysseg; x++) { - /* structure copy */ - VM_PHYSMEM_PTR_SWAP(x, x + 1); - } - } + pa = ptoa(uvm_physseg_get_start(bank)); + uvm_physseg_unplug(atop(pa), npgs); va = ALPHA_PHYS_TO_K0SEG(pa); memset((void *)va, 0, size); Index: sys/arch/amd64/amd64/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/amd64/amd64/machdep.c,v retrieving revision 1.237 diff -p -u -r1.237 machdep.c --- sys/arch/amd64/amd64/machdep.c 12 Dec 2016 02:51:24 -0000 1.237 +++ sys/arch/amd64/amd64/machdep.c 13 Dec 2016 12:42:56 -0000 @@@@ -787,6 +787,7 @@@@ sparse_dump_mark(void) paddr_t p, pstart, pend; struct vm_page *pg; int i; + uvm_physseg_t upm; /* * Mark all memory pages, then unmark pages that are uninteresting. @@@@ -803,10 +804,25 @@@@ sparse_dump_mark(void) setbit(sparse_dump_physmap, p); } } - for (i = 0; i < vm_nphysseg; i++) { - struct vm_physseg *seg = VM_PHYSMEM_PTR(i); + for (upm = uvm_physseg_get_first(); + uvm_physseg_valid(upm); + upm = uvm_physseg_get_next(upm)) { + paddr_t pfn; - for (pg = seg->pgs; pg < seg->lastpg; pg++) { + if (uvm_physseg_valid(upm) == false) + break; + + const paddr_t startpfn = uvm_physseg_get_start(upm); + const paddr_t endpfn = uvm_physseg_get_end(upm); + + KASSERT(startpfn != -1 && endpfn != -1); + + /* + * We assume that seg->start to seg->end are + * uvm_page_physload()ed + */ + for (pfn = startpfn; pfn <= endpfn; pfn++) { + pg = PHYS_TO_VM_PAGE(ptoa(pfn)); if (pg->uanon || (pg->pqflags & PQ_FREE) || (pg->uobject && pg->uobject->pgops)) { p = VM_PAGE_TO_PHYS(pg) / PAGE_SIZE; @@@@ -1448,57 +1464,30 @@@@ extern vector *IDTVEC(exceptions)[]; static void init_x86_64_msgbuf(void) { - /* Message buffer is located at end of core. */ - struct vm_physseg *vps; - psize_t sz = round_page(MSGBUFSIZE); - psize_t reqsz = sz; - int x; - - search_again: - vps = NULL; - - for (x = 0; x < vm_nphysseg; x++) { - vps = VM_PHYSMEM_PTR(x); - if (ctob(vps->avail_end) == avail_end) - break; - } - if (x == vm_nphysseg) - panic("init_x86_64: can't find end of memory"); + /* Message buffer is located at end of core. */ + psize_t reqsz = round_page(MSGBUFSIZE); + psize_t sz = 0; - /* Shrink so it'll fit in the last segment. */ - if ((vps->avail_end - vps->avail_start) < atop(sz)) - sz = ctob(vps->avail_end - vps->avail_start); - - vps->avail_end -= atop(sz); - vps->end -= atop(sz); - msgbuf_p_seg[msgbuf_p_cnt].sz = sz; - msgbuf_p_seg[msgbuf_p_cnt++].paddr = ctob(vps->avail_end); - - /* Remove the last segment if it now has no pages. */ - if (vps->start == vps->end) { - for (vm_nphysseg--; x < vm_nphysseg; x++) - VM_PHYSMEM_PTR_SWAP(x, x + 1); - } - - /* Now find where the new avail_end is. */ - for (avail_end = 0, x = 0; x < vm_nphysseg; x++) - if (VM_PHYSMEM_PTR(x)->avail_end > avail_end) - avail_end = VM_PHYSMEM_PTR(x)->avail_end; - avail_end = ctob(avail_end); + for (sz = 0; sz < reqsz; sz += PAGE_SIZE) { + paddr_t stolenpa; - if (sz == reqsz) - return; + if (!uvm_page_physget(&stolenpa)) + break; - reqsz -= sz; - if (msgbuf_p_cnt == VM_PHYSSEG_MAX) { - /* No more segments available, bail out. */ - printf("WARNING: MSGBUFSIZE (%zu) too large, using %zu.\n", - (size_t)MSGBUFSIZE, (size_t)(MSGBUFSIZE - reqsz)); - return; + if (stolenpa == (msgbuf_p_seg[msgbuf_p_cnt].paddr + + PAGE_SIZE)) { + /* contiguous: append it to current buf alloc */ + msgbuf_p_seg[msgbuf_p_cnt].sz += PAGE_SIZE; + } else { + /* non-contiguous: start a new msgbuf seg */ + msgbuf_p_seg[msgbuf_p_cnt].sz = PAGE_SIZE; + msgbuf_p_seg[msgbuf_p_cnt++].paddr = stolenpa; + } } - sz = reqsz; - goto search_again; + if (sz != reqsz) + printf("%s: could only allocate %ld bytes of requested %ld bytes\n", + __func__, sz, reqsz); } static void @@@@ -1578,7 +1567,8 @@@@ init_x86_64(paddr_t first_avail) * Initialize PAGE_SIZE-dependent variables. */ uvm_setpagesize(); - + uvm_physseg_init(); + uvmexp.ncolors = 2; #ifndef XEN Index: sys/arch/amd64/conf/GENERIC =================================================================== RCS file: /cvsroot/src/sys/arch/amd64/conf/GENERIC,v retrieving revision 1.446 diff -p -u -r1.446 GENERIC --- sys/arch/amd64/conf/GENERIC 10 Dec 2016 23:03:23 -0000 1.446 +++ sys/arch/amd64/conf/GENERIC 13 Dec 2016 12:42:57 -0000 @@@@ -50,6 +50,7 @@@@ maxusers 64 # estimated number of users # and can deal with holes in the memory layout. #options PHYSMEM_MAX_SIZE=64 # max size of physical memory (in MB) #options PHYSMEM_MAX_ADDR=2048 # don't use memory above this (in MB) +options UVM_HOTPLUG # Experimental uvm_hotplug(9) api. # Standard system options Index: sys/arch/amiga/amiga/pmap_bootstrap.c =================================================================== RCS file: /cvsroot/src/sys/arch/amiga/amiga/pmap_bootstrap.c,v retrieving revision 1.9 diff -p -u -r1.9 pmap_bootstrap.c --- sys/arch/amiga/amiga/pmap_bootstrap.c 6 Dec 2009 06:41:29 -0000 1.9 +++ sys/arch/amiga/amiga/pmap_bootstrap.c 13 Dec 2016 12:42:57 -0000 @@@@ -73,6 +73,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap_bootstr #include #include +#include #include #include @@@@ -126,7 +127,8 @@@@ pmap_bootstrap(paddr_t firstaddr, paddr_ uvmexp.pagesize = NBPG; uvm_setpagesize(); - + uvm_physseg_init(); + /* * May want to check if first segment is Zorro-II? */ Index: sys/arch/arc/arc/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/arc/arc/machdep.c,v retrieving revision 1.129 diff -p -u -r1.129 machdep.c --- sys/arch/arc/arc/machdep.c 30 Jun 2015 02:39:03 -0000 1.129 +++ sys/arch/arc/arc/machdep.c 13 Dec 2016 12:42:59 -0000 @@@@ -63,6 +63,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include #include +#include #include #include #include @@@@ -310,7 +311,8 @@@@ mach_init(int argc, char *argv[], u_int * Set the VM page size. */ uvm_setpagesize(); - + uvm_physseg_init(); + /* make sure that we don't call BIOS console from now on */ cn_tab = NULL; Index: sys/arch/arm/arm32/arm32_boot.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm32/arm32_boot.c,v retrieving revision 1.17 diff -p -u -r1.17 arm32_boot.c --- sys/arch/arm/arm32/arm32_boot.c 8 Mar 2016 08:01:23 -0000 1.17 +++ sys/arch/arm/arm32/arm32_boot.c 13 Dec 2016 12:43:00 -0000 @@@@ -137,6 +137,7 @@@@ __KERNEL_RCSID(1, "$NetBSD: arm32_boot.c #include #include +#include #include #include @@@@ -232,7 +233,8 @@@@ initarm_common(vaddr_t kvm_base, vsize_t printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ - + uvm_physseg_init(); + #ifdef VERBOSE_INIT_ARM printf("pmap_physload "); #endif Index: sys/arch/arm/arm32/bus_dma.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm32/bus_dma.c,v retrieving revision 1.96 diff -p -u -r1.96 bus_dma.c --- sys/arch/arm/arm32/bus_dma.c 5 Nov 2016 14:26:23 -0000 1.96 +++ sys/arch/arm/arm32/bus_dma.c 13 Dec 2016 12:43:02 -0000 @@@@ -1365,11 +1365,11 @@@@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma * The page can only be direct mapped if was allocated out * of the arm poolpage vm freelist. */ - int lcv = vm_physseg_find(atop(pa), NULL); - KASSERT(lcv != -1); + uvm_physseg_t upm = uvm_physseg_find(atop(pa), NULL); + KASSERT(uvm_physseg_valid(upm)); if (direct_mapable) { direct_mapable = - (arm_poolpage_vmfreelist == VM_PHYSMEM_PTR(lcv)->free_list); + (arm_poolpage_vmfreelist == uvm_physseg_get_free_list(upm)); } #endif Index: sys/arch/arm/at91/at91bus.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/at91/at91bus.c,v retrieving revision 1.18 diff -p -u -r1.18 at91bus.c --- sys/arch/arm/at91/at91bus.c 13 Sep 2014 18:08:38 -0000 1.18 +++ sys/arch/arm/at91/at91bus.c 13 Dec 2016 12:43:03 -0000 @@@@ -58,6 +58,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: at91bus.c,v #include #include +#include #include @@@@ -512,6 +513,7 @@@@ at91bus_setup(BootConfig *mem) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/atari/atari/pmap_bootstrap.c =================================================================== RCS file: /cvsroot/src/sys/arch/atari/atari/pmap_bootstrap.c,v retrieving revision 1.7 diff -p -u -r1.7 pmap_bootstrap.c --- sys/arch/atari/atari/pmap_bootstrap.c 13 Apr 2010 09:49:54 -0000 1.7 +++ sys/arch/atari/atari/pmap_bootstrap.c 13 Dec 2016 12:43:05 -0000 @@@@ -71,6 +71,7 @@@@ #include #include +#include #include #include @@@@ -109,7 +110,8 @@@@ pmap_bootstrap(vaddr_t vstart) */ uvmexp.pagesize = NBPG; uvm_setpagesize(); - + uvm_physseg_init(); + /* * Setup physical address ranges */ Index: sys/arch/cesfic/cesfic/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/cesfic/cesfic/machdep.c,v retrieving revision 1.66 diff -p -u -r1.66 machdep.c --- sys/arch/cesfic/cesfic/machdep.c 5 Nov 2015 03:48:51 -0000 1.66 +++ sys/arch/cesfic/cesfic/machdep.c 13 Dec 2016 12:43:08 -0000 @@@@ -88,6 +88,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #define MAXMEM 64*1024 /* XXX - from cmap.h */ #include +#include #include #include @@@@ -111,7 +112,7 @@@@ struct vm_map *phys_map = NULL; * Declare these as initialized data so we can patch them. */ /*int maxmem;*/ /* max memory per process */ -extern int physmem; /* max supported memory, changes to actual */ +extern psize_t physmem; /* max supported memory, changes to actual */ extern u_int lowram; @@@@ -146,6 +147,7 @@@@ void fic_init(void) * Tell the VM system about available physical memory. The * fic uses one segment. */ + uvm_physseg_init(); uvm_page_physload(atop(avail_start), atop(avail_end), atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT); Index: sys/arch/cobalt/cobalt/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/cobalt/cobalt/machdep.c,v retrieving revision 1.118 diff -p -u -r1.118 machdep.c --- sys/arch/cobalt/cobalt/machdep.c 27 Jul 2016 11:13:14 -0000 1.118 +++ sys/arch/cobalt/cobalt/machdep.c 13 Dec 2016 12:43:08 -0000 @@@@ -70,6 +70,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #include @@@@ -253,7 +254,8 @@@@ mach_init(int32_t memsize32, u_int bim, printf("%s: magic=%#x bip=%p\n", bi_msg, bim, bip); uvm_setpagesize(); - + uvm_physseg_init(); + /* * The boot command is passed in the top 512 bytes, * so don't clobber that. Index: sys/arch/dreamcast/dreamcast/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/dreamcast/dreamcast/machdep.c,v retrieving revision 1.45 diff -p -u -r1.45 machdep.c --- sys/arch/dreamcast/dreamcast/machdep.c 24 Mar 2014 20:06:31 -0000 1.45 +++ sys/arch/dreamcast/dreamcast/machdep.c 13 Dec 2016 12:43:10 -0000 @@@@ -103,6 +103,8 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include +#include + #include "ksyms.h" /* the following is used externally (sysctl_hw) */ @@@@ -130,6 +132,7 @@@@ dreamcast_startup(void) /* Load memory to UVM */ physmem = atop(IOM_RAM_SIZE); kernend = atop(round_page(SH3_P1SEG_TO_PHYS(end))); + uvm_physseg_init(); uvm_page_physload( kernend, atop(IOM_RAM_BEGIN + IOM_RAM_SIZE), kernend, atop(IOM_RAM_BEGIN + IOM_RAM_SIZE), Index: sys/arch/emips/emips/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/emips/emips/machdep.c,v retrieving revision 1.11 diff -p -u -r1.11 machdep.c --- sys/arch/emips/emips/machdep.c 11 Jun 2015 08:22:08 -0000 1.11 +++ sys/arch/emips/emips/machdep.c 13 Dec 2016 12:43:10 -0000 @@@@ -59,6 +59,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #include Index: sys/arch/epoc32/epoc32/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/epoc32/epoc32/machdep.c,v retrieving revision 1.4 diff -p -u -r1.4 machdep.c --- sys/arch/epoc32/epoc32/machdep.c 13 Sep 2014 18:08:40 -0000 1.4 +++ sys/arch/epoc32/epoc32/machdep.c 13 Dec 2016 12:43:11 -0000 @@@@ -49,6 +49,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #include #include @@@@ -441,6 +442,7 @@@@ initarm(void *arg) /* Load memory into UVM. */ uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload( atop(_end_physical), atop(physical_end), atop(_end_physical), atop(physical_end), Index: sys/arch/evbarm/adi_brh/brh_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/adi_brh/brh_machdep.c,v retrieving revision 1.43 diff -p -u -r1.43 brh_machdep.c --- sys/arch/evbarm/adi_brh/brh_machdep.c 13 Sep 2014 18:08:38 -0000 1.43 +++ sys/arch/evbarm/adi_brh/brh_machdep.c 13 Dec 2016 12:43:12 -0000 @@@@ -92,6 +92,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: brh_machdep. #include #include +#include #include @@@@ -758,6 +759,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/armadillo/armadillo9_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/armadillo/armadillo9_machdep.c,v retrieving revision 1.28 diff -p -u -r1.28 armadillo9_machdep.c --- sys/arch/evbarm/armadillo/armadillo9_machdep.c 13 Sep 2014 18:08:38 -0000 1.28 +++ sys/arch/evbarm/armadillo/armadillo9_machdep.c 13 Dec 2016 12:43:14 -0000 @@@@ -133,6 +133,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: armadillo9_m #include #include +#include #include @@@@ -814,6 +815,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c,v retrieving revision 1.29 diff -p -u -r1.29 g42xxeb_machdep.c --- sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c 13 Sep 2014 18:08:38 -0000 1.29 +++ sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c 13 Dec 2016 12:43:14 -0000 @@@@ -128,6 +128,7 @@@@ #include #include +#include #include #include @@@@ -829,6 +830,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/gemini/gemini_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/gemini/gemini_machdep.c,v retrieving revision 1.22 diff -p -u -r1.22 gemini_machdep.c --- sys/arch/evbarm/gemini/gemini_machdep.c 18 Aug 2013 15:58:20 -0000 1.22 +++ sys/arch/evbarm/gemini/gemini_machdep.c 13 Dec 2016 12:43:15 -0000 @@@@ -156,6 +156,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: gemini_machd #include #include +#include #include #include @@@@ -708,7 +709,8 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ - + uvm_physseg_init(); + #if (GEMINI_RAM_RESV_PBASE != 0) uvm_page_physload(atop(physical_freestart), atop(GEMINI_RAM_RESV_PBASE), atop(physical_freestart), atop(GEMINI_RAM_RESV_PBASE), Index: sys/arch/evbarm/hdl_g/hdlg_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/hdl_g/hdlg_machdep.c,v retrieving revision 1.22 diff -p -u -r1.22 hdlg_machdep.c --- sys/arch/evbarm/hdl_g/hdlg_machdep.c 13 Sep 2014 18:08:39 -0000 1.22 +++ sys/arch/evbarm/hdl_g/hdlg_machdep.c 13 Dec 2016 12:43:15 -0000 @@@@ -93,6 +93,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: hdlg_machdep #include #include +#include #include @@@@ -596,6 +597,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/imx31/imx31lk_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/imx31/imx31lk_machdep.c,v retrieving revision 1.18 diff -p -u -r1.18 imx31lk_machdep.c --- sys/arch/evbarm/imx31/imx31lk_machdep.c 13 Sep 2014 18:08:39 -0000 1.18 +++ sys/arch/evbarm/imx31/imx31lk_machdep.c 13 Dec 2016 12:43:16 -0000 @@@@ -133,6 +133,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: imx31lk_mach #include #include +#include #include #include @@@@ -693,6 +694,7 @@@@ printf("%s: textsize %#lx, totalsize %#l /* Load memory into UVM. */ printf("page "); uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/iq80310/iq80310_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/iq80310/iq80310_machdep.c,v retrieving revision 1.85 diff -p -u -r1.85 iq80310_machdep.c --- sys/arch/evbarm/iq80310/iq80310_machdep.c 13 Sep 2014 18:08:39 -0000 1.85 +++ sys/arch/evbarm/iq80310/iq80310_machdep.c 13 Dec 2016 12:43:17 -0000 @@@@ -92,6 +92,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: iq80310_mach #include #include +#include #include @@@@ -718,6 +719,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/iq80321/iq80321_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/iq80321/iq80321_machdep.c,v retrieving revision 1.55 diff -p -u -r1.55 iq80321_machdep.c --- sys/arch/evbarm/iq80321/iq80321_machdep.c 13 Sep 2014 18:08:39 -0000 1.55 +++ sys/arch/evbarm/iq80321/iq80321_machdep.c 13 Dec 2016 12:43:18 -0000 @@@@ -93,6 +93,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: iq80321_mach #include #include +#include #include @@@@ -743,6 +744,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/ixdp425/ixdp425_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/ixdp425/ixdp425_machdep.c,v retrieving revision 1.36 diff -p -u -r1.36 ixdp425_machdep.c --- sys/arch/evbarm/ixdp425/ixdp425_machdep.c 5 Mar 2015 08:09:44 -0000 1.36 +++ sys/arch/evbarm/ixdp425/ixdp425_machdep.c 13 Dec 2016 12:43:18 -0000 @@@@ -84,6 +84,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: ixdp425_mach #include #include +#include #include @@@@ -710,6 +711,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/ixm1200/ixm1200_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/ixm1200/ixm1200_machdep.c,v retrieving revision 1.56 diff -p -u -r1.56 ixm1200_machdep.c --- sys/arch/evbarm/ixm1200/ixm1200_machdep.c 13 Sep 2014 18:08:39 -0000 1.56 +++ sys/arch/evbarm/ixm1200/ixm1200_machdep.c 13 Dec 2016 12:43:18 -0000 @@@@ -81,6 +81,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: ixm1200_mach #include #include +#include #include @@@@ -677,6 +678,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/lubbock/lubbock_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/lubbock/lubbock_machdep.c,v retrieving revision 1.33 diff -p -u -r1.33 lubbock_machdep.c --- sys/arch/evbarm/lubbock/lubbock_machdep.c 13 Sep 2014 18:08:39 -0000 1.33 +++ sys/arch/evbarm/lubbock/lubbock_machdep.c 13 Dec 2016 12:43:19 -0000 @@@@ -900,6 +900,7 @@@@ initarm(void *arg) /* Load memory into UVM. */ printf("page "); uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/mini2440/mini2440_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/mini2440/mini2440_machdep.c,v retrieving revision 1.9 diff -p -u -r1.9 mini2440_machdep.c --- sys/arch/evbarm/mini2440/mini2440_machdep.c 13 Sep 2014 18:08:39 -0000 1.9 +++ sys/arch/evbarm/mini2440/mini2440_machdep.c 13 Dec 2016 12:43:19 -0000 @@@@ -155,6 +155,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: mini2440_mac #include #include +#include #include #include @@@@ -887,6 +888,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c,v retrieving revision 1.20 diff -p -u -r1.20 npwr_fc_machdep.c --- sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c 13 Sep 2014 18:08:39 -0000 1.20 +++ sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c 13 Dec 2016 12:43:20 -0000 @@@@ -91,6 +91,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: npwr_fc_mach #include #include +#include #include @@@@ -713,6 +714,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/nslu2/nslu2_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/nslu2/nslu2_machdep.c,v retrieving revision 1.26 diff -p -u -r1.26 nslu2_machdep.c --- sys/arch/evbarm/nslu2/nslu2_machdep.c 5 Mar 2015 08:09:44 -0000 1.26 +++ sys/arch/evbarm/nslu2/nslu2_machdep.c 13 Dec 2016 12:43:20 -0000 @@@@ -114,6 +114,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: nslu2_machde #include #include +#include #include @@@@ -778,6 +779,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/osk5912/osk5912_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/osk5912/osk5912_machdep.c,v retrieving revision 1.15 diff -p -u -r1.15 osk5912_machdep.c --- sys/arch/evbarm/osk5912/osk5912_machdep.c 18 Aug 2013 15:58:21 -0000 1.15 +++ sys/arch/evbarm/osk5912/osk5912_machdep.c 13 Dec 2016 12:43:20 -0000 @@@@ -122,6 +122,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: osk5912_mach #include #include +#include #include #include @@@@ -448,6 +449,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c,v retrieving revision 1.35 diff -p -u -r1.35 smdk2410_machdep.c --- sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c 13 Sep 2014 18:08:39 -0000 1.35 +++ sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c 13 Dec 2016 12:43:21 -0000 @@@@ -127,6 +127,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: smdk2410_mac #include #include +#include #include #include @@@@ -845,6 +846,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c,v retrieving revision 1.42 diff -p -u -r1.42 smdk2800_machdep.c --- sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c 13 Sep 2014 18:08:39 -0000 1.42 +++ sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c 13 Dec 2016 12:43:21 -0000 @@@@ -129,6 +129,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: smdk2800_mac #include #include +#include #include #include @@@@ -762,6 +763,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c,v retrieving revision 1.16 diff -p -u -r1.16 sdp24xx_machdep.c --- sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c 18 Aug 2013 15:58:21 -0000 1.16 +++ sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c 13 Dec 2016 12:43:22 -0000 @@@@ -149,6 +149,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: sdp24xx_mach #include #include +#include #include #include @@@@ -542,6 +543,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/tsarm/tsarm_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/tsarm/tsarm_machdep.c,v retrieving revision 1.23 diff -p -u -r1.23 tsarm_machdep.c --- sys/arch/evbarm/tsarm/tsarm_machdep.c 13 Sep 2014 18:08:39 -0000 1.23 +++ sys/arch/evbarm/tsarm/tsarm_machdep.c 13 Dec 2016 12:43:23 -0000 @@@@ -93,6 +93,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: tsarm_machde #include #include +#include #include @@@@ -727,6 +728,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbarm/viper/viper_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/viper/viper_machdep.c,v retrieving revision 1.24 diff -p -u -r1.24 viper_machdep.c --- sys/arch/evbarm/viper/viper_machdep.c 13 Sep 2014 18:08:39 -0000 1.24 +++ sys/arch/evbarm/viper/viper_machdep.c 13 Dec 2016 12:43:23 -0000 @@@@ -135,6 +135,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: viper_machde #include #include +#include #include #include @@@@ -747,6 +748,7 @@@@ initarm(void *arg) /* Load memory into UVM. */ printf("page "); uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/evbsh3/evbsh3/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbsh3/evbsh3/machdep.c,v retrieving revision 1.75 diff -p -u -r1.75 machdep.c --- sys/arch/evbsh3/evbsh3/machdep.c 19 Jun 2014 13:20:13 -0000 1.75 +++ sys/arch/evbsh3/evbsh3/machdep.c 13 Dec 2016 12:43:24 -0000 @@@@ -85,6 +85,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #include @@@@ -303,6 +304,7 @@@@ initSH3(void *pc) /* XXX return address /* Load memory to UVM */ kernend = atop(round_page(SH3_P1SEG_TO_PHYS(end))); physmem = atop(IOM_RAM_SIZE); + uvm_physseg_init(); uvm_page_physload( kernend, atop(IOM_RAM_BEGIN + IOM_RAM_SIZE), kernend, atop(IOM_RAM_BEGIN + IOM_RAM_SIZE), Index: sys/arch/ews4800mips/ews4800mips/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/ews4800mips/ews4800mips/machdep.c,v retrieving revision 1.26 diff -p -u -r1.26 machdep.c --- sys/arch/ews4800mips/ews4800mips/machdep.c 24 Mar 2014 20:06:32 -0000 1.26 +++ sys/arch/ews4800mips/ews4800mips/machdep.c 13 Dec 2016 12:43:24 -0000 @@@@ -44,6 +44,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #include #include @@@@ -111,7 +112,8 @@@@ mach_init(int argc, char *argv[], struct option(argc, argv, bi); uvm_setpagesize(); - + uvm_physseg_init(); + /* Fill mem_clusters and mem_cluster_cnt */ (*platform.mem_init)(kernel_text, (bi && bi->bi_nsym) ? (void *)bi->bi_esym : end); Index: sys/arch/hp300/hp300/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/hp300/hp300/machdep.c,v retrieving revision 1.229 diff -p -u -r1.229 machdep.c --- sys/arch/hp300/hp300/machdep.c 20 Apr 2014 04:12:54 -0000 1.229 +++ sys/arch/hp300/hp300/machdep.c 13 Dec 2016 12:43:25 -0000 @@@@ -100,6 +100,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #define MAXMEM 64*1024 /* XXX - from cmap.h */ #include +#include #include @@@@ -197,6 +198,7 @@@@ hp300_init(void) * Tell the VM system about available physical memory. The * hp300 only has one segment. */ + uvm_physseg_init(); uvm_page_physload(atop(avail_start), atop(avail_end), atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT); Index: sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c,v retrieving revision 1.22 diff -p -u -r1.22 pxa2x0_hpc_machdep.c --- sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c 13 Sep 2014 18:09:50 -0000 1.22 +++ sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c 13 Dec 2016 12:43:27 -0000 @@@@ -72,6 +72,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pxa2x0_hpc_m #endif #include +#include #include #include @@@@ -609,6 +610,7 @@@@ init_pxa2x0(int argc, char **argv, struc /* Load memory into UVM. */ uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); for (loop = 0; loop < bootconfig.dramblocks; loop++) { paddr_t dblk_start = (paddr_t)bootconfig.dram[loop].address; paddr_t dblk_end = dblk_start Index: sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c,v retrieving revision 1.10 diff -p -u -r1.10 sa11x0_hpc_machdep.c --- sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c 13 Sep 2014 18:09:50 -0000 1.10 +++ sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c 13 Dec 2016 12:43:27 -0000 @@@@ -75,6 +75,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: sa11x0_hpc_m #endif #include +#include #include #include @@@@ -538,6 +539,7 @@@@ init_sa11x0(int argc, char **argv, struc /* Load memory into UVM. */ uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); for (loop = 0; loop < bootconfig.dramblocks; loop++) { paddr_t dblk_start = (paddr_t)bootconfig.dram[loop].address; paddr_t dblk_end = dblk_start Index: sys/arch/hpcsh/hpcsh/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/hpcsh/hpcsh/machdep.c,v retrieving revision 1.77 diff -p -u -r1.77 machdep.c --- sys/arch/hpcsh/hpcsh/machdep.c 24 Mar 2014 20:06:32 -0000 1.77 +++ sys/arch/hpcsh/hpcsh/machdep.c 13 Dec 2016 12:43:29 -0000 @@@@ -56,6 +56,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #include /* mfs_initminiroot() */ @@@@ -281,6 +282,7 @@@@ machine_startup(int argc, char *argv[], #endif /* Find memory cluster. and load to UVM */ + uvm_physseg_init(); physmem = mem_cluster_init(SH3_P1SEG_TO_PHYS(kernend)); _DPRINTF("total memory = %dMbyte\n", (int)(sh3_ptob(physmem) >> 20)); mem_cluster_load(); Index: sys/arch/hppa/hppa/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/hppa/hppa/pmap.c,v retrieving revision 1.99 diff -p -u -r1.99 pmap.c --- sys/arch/hppa/hppa/pmap.c 8 Aug 2014 07:30:51 -0000 1.99 +++ sys/arch/hppa/hppa/pmap.c 13 Dec 2016 12:43:32 -0000 @@@@ -76,6 +76,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.9 #include #include +#include #include #include @@@@ -676,7 +677,8 @@@@ pmap_bootstrap(vaddr_t vstart) DPRINTF(PDB_FOLLOW|PDB_INIT, ("%s(0x%lx)\n", __func__, vstart)); uvm_setpagesize(); - + uvm_physseg_init(); + hppa_prot[UVM_PROT_NONE] = TLB_AR_NA; hppa_prot[UVM_PROT_READ] = TLB_AR_R; hppa_prot[UVM_PROT_WRITE] = TLB_AR_RW; Index: sys/arch/ia64/ia64/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/ia64/ia64/machdep.c,v retrieving revision 1.35 diff -p -u -r1.35 machdep.c --- sys/arch/ia64/ia64/machdep.c 14 Mar 2014 17:45:37 -0000 1.35 +++ sys/arch/ia64/ia64/machdep.c 13 Dec 2016 12:43:33 -0000 @@@@ -115,6 +115,7 @@@@ #include #include +#include #include #include @@@@ -175,18 +176,19 @@@@ cpu_startup(void) * Display any holes after the first chunk of extended memory. */ if (bootverbose) { - int lcv, sizetmp; - + int sizetmp, vm_nphysseg; + uvm_physseg_t upm; + printf("Physical memory chunk(s):\n"); - for (lcv = 0; - lcv < vm_nphysseg || VM_PHYSMEM_PTR(lcv)->avail_end != 0; - lcv++) { - sizetmp = VM_PHYSMEM_PTR(lcv)->avail_end - - VM_PHYSMEM_PTR(lcv)->avail_start; + for (vm_nphysseg = 0, upm = uvm_physseg_get_first(); + uvm_physseg_valid(upm); + vm_nphysseg++, upm = uvm_physseg_get_next(upm)) { + sizetmp = uvm_physseg_get_avail_end(upm) - + uvm_physseg_get_avail_start(upm); printf("0x%016lx - 0x%016lx, %ld bytes (%d pages)\n", - ptoa(VM_PHYSMEM_PTR(lcv)->avail_start), - ptoa(VM_PHYSMEM_PTR(lcv)->avail_end) - 1, + ptoa(uvm_physseg_get_avail_start(upm)), + ptoa(uvm_physseg_get_avail_end(upm)) - 1, ptoa(sizetmp), sizetmp); } printf("Total number of segments: vm_nphysseg = %d \n", @@@@ -466,7 +468,8 @@@@ ia64_init(void) uvmexp.pagesize = PAGE_SIZE; uvm_setpagesize(); - + uvm_physseg_init(); + /* * Find out how much memory is available, by looking at Index: sys/arch/ia64/ia64/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/ia64/ia64/pmap.c,v retrieving revision 1.32 diff -p -u -r1.32 pmap.c --- sys/arch/ia64/ia64/pmap.c 10 Mar 2014 13:47:45 -0000 1.32 +++ sys/arch/ia64/ia64/pmap.c 13 Dec 2016 12:43:34 -0000 @@@@ -94,6 +94,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.3 #include #include +#include #include #include @@@@ -316,47 +317,33 @@@@ pmap_steal_vhpt_memory(vsize_t); vaddr_t pmap_steal_memory(vsize_t size, vaddr_t *vstartp, vaddr_t *vendp) { - int lcv, npgs, x; + int npgs; + uvm_physseg_t upm; vaddr_t va; paddr_t pa; size = round_page(size); npgs = atop(size); - for (lcv = 0; lcv < vm_nphysseg; lcv++) { + for (upm = uvm_physseg_get_first(); + uvm_physseg_valid(upm); + upm = uvm_physseg_get_next(upm)) { if (uvm.page_init_done == true) panic("pmap_steal_memory: called _after_ bootstrap"); - if (VM_PHYSMEM_PTR(lcv)->avail_start != VM_PHYSMEM_PTR(lcv)->start || - VM_PHYSMEM_PTR(lcv)->avail_start >= VM_PHYSMEM_PTR(lcv)->avail_end) + if (uvm_physseg_get_avail_start(upm) != uvm_physseg_get_start(upm) || + uvm_physseg_get_avail_start(upm) >= uvm_physseg_get_avail_end(upm)) continue; - if ((VM_PHYSMEM_PTR(lcv)->avail_end - VM_PHYSMEM_PTR(lcv)->avail_start) + if ((uvm_physseg_get_avail_end(upm) - uvm_physseg_get_avail_start(upm)) < npgs) continue; /* * There are enough pages here; steal them! */ - pa = ptoa(VM_PHYSMEM_PTR(lcv)->avail_start); - VM_PHYSMEM_PTR(lcv)->avail_start += npgs; - VM_PHYSMEM_PTR(lcv)->start += npgs; - - /* - * Have we used up this segment? - */ - if (VM_PHYSMEM_PTR(lcv)->avail_start == - VM_PHYSMEM_PTR(lcv)->end) { - if (vm_nphysseg == 1) - panic("pmap_steal_memory: out of memory!"); - - /* Remove this segment from the list. */ - vm_nphysseg--; - for (x = lcv; x < vm_nphysseg; x++) { - /* structure copy */ - VM_PHYSMEM_PTR_SWAP(x, x + 1); - } - } + pa = ptoa(uvm_physseg_get_start(bank)); + uvm_physseg_unplug(atop(pa), npgs); va = IA64_PHYS_TO_RR7(pa); memset((void *)va, 0, size); @@@@ -380,31 +367,34 @@@@ pmap_steal_memory(vsize_t size, vaddr_t static vaddr_t pmap_steal_vhpt_memory(vsize_t size) { - int lcv, npgs, x; + int npgs; + uvm_physseg_t upm; vaddr_t va; - paddr_t pa; + paddr_t tmppa, pa = 0; paddr_t vhpt_start = 0, start1, start2, end1, end2; size = round_page(size); npgs = atop(size); - for (lcv = 0; lcv < vm_nphysseg; lcv++) { + for (upm = uvm_physseg_get_first(); + uvm_physseg_valid(upm); + upm = uvm_physseg_get_next(upm)) { if (uvm.page_init_done == true) panic("pmap_vhpt_steal_memory: called _after_ bootstrap"); - if (VM_PHYSMEM_PTR(lcv)->avail_start != VM_PHYSMEM_PTR(lcv)->start || /* XXX: ??? */ - VM_PHYSMEM_PTR(lcv)->avail_start >= VM_PHYSMEM_PTR(lcv)->avail_end) + if (uvm_physseg_get_avail_start(upm) != uvm_physseg_get_start(upm) || /* XXX: ??? */ + uvm_physseg_get_avail_start(upm) >= uvm_physseg_get_avail_end(upm)) continue; /* Break off a VHPT sized, aligned chunk off this segment. */ - start1 = VM_PHYSMEM_PTR(lcv)->avail_start; + start1 = uvm_physseg_get_avail_start(upm); /* Align requested start address on requested size boundary */ end1 = vhpt_start = roundup(start1, npgs); start2 = vhpt_start + npgs; - end2 = VM_PHYSMEM_PTR(lcv)->avail_end; + end2 = uvm_physseg_get_avail_end(upm); /* Case 1: Doesn't fit. skip this segment */ @@@@ -423,7 +413,7 @@@@ pmap_steal_vhpt_memory(vsize_t size) */ if (start1 == end1 && start2 == end2 && - vm_nphysseg == 1) { + uvm_physseg_get_first() == uvm_physseg_get_last() /* single segment */) { #ifdef DEBUG printf("pmap_vhpt_steal_memory: out of memory!"); #endif @@@@ -431,11 +421,13 @@@@ pmap_steal_vhpt_memory(vsize_t size) } /* Remove this segment from the list. */ - vm_nphysseg--; - for (x = lcv; x < vm_nphysseg; x++) - /* structure copy */ - VM_PHYSMEM_PTR_SWAP(x, x + 1); - + if (uvm_physseg_unplug(uvm_physseg_get_start(upm), + uvm_physseg_get_end(upm) - uvm_physseg_get_start(upm)) == false) { + panic("%s: uvm_physseg_unplug(%"PRIxPADDR", %"PRIxPADDR") failed\n", + __func__, uvm_physseg_get_start(upm), + uvm_physseg_get_end(upm) - uvm_physseg_get_start(upm)); + } + /* Case 2: Perfect fit - skip segment reload. */ if (start1 == end1 && start2 == end2) break; Index: sys/arch/iyonix/iyonix/iyonix_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/iyonix/iyonix/iyonix_machdep.c,v retrieving revision 1.24 diff -p -u -r1.24 iyonix_machdep.c --- sys/arch/iyonix/iyonix/iyonix_machdep.c 13 Sep 2014 18:08:39 -0000 1.24 +++ sys/arch/iyonix/iyonix/iyonix_machdep.c 13 Dec 2016 12:43:34 -0000 @@@@ -93,6 +93,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: iyonix_machd #include #include +#include #include @@@@ -781,6 +782,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); Index: sys/arch/landisk/landisk/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/landisk/landisk/machdep.c,v retrieving revision 1.18 diff -p -u -r1.18 machdep.c --- sys/arch/landisk/landisk/machdep.c 22 Nov 2015 18:44:25 -0000 1.18 +++ sys/arch/landisk/landisk/machdep.c 13 Dec 2016 12:43:35 -0000 @@@@ -89,6 +89,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #include /* mfs_initminiroot() */ #include @@@@ -218,6 +219,7 @@@@ landisk_startup(int howto, void *bi) /* Load memory to UVM */ physmem = atop(IOM_RAM_SIZE); kernend = atop(round_page(SH3_P1SEG_TO_PHYS(kernend))); + uvm_physseg_init(); uvm_page_physload( physmem, atop(IOM_RAM_BEGIN + IOM_RAM_SIZE), kernend, atop(IOM_RAM_BEGIN + IOM_RAM_SIZE), Index: sys/arch/luna68k/luna68k/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/luna68k/luna68k/machdep.c,v retrieving revision 1.99 diff -p -u -r1.99 machdep.c --- sys/arch/luna68k/luna68k/machdep.c 21 Aug 2015 10:48:06 -0000 1.99 +++ sys/arch/luna68k/luna68k/machdep.c 13 Dec 2016 12:43:37 -0000 @@@@ -73,6 +73,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #include @@@@ -175,6 +176,7 @@@@ luna68k_init(void) * Tell the VM system about available physical memory. The * luna68k only has one segment. */ + uvm_physseg_init(); uvm_page_physload(atop(avail_start), atop(avail_end), atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT); Index: sys/arch/luna68k/luna68k/pmap_bootstrap.c =================================================================== RCS file: /cvsroot/src/sys/arch/luna68k/luna68k/pmap_bootstrap.c,v retrieving revision 1.36 diff -p -u -r1.36 pmap_bootstrap.c --- sys/arch/luna68k/luna68k/pmap_bootstrap.c 26 Jan 2013 15:46:24 -0000 1.36 +++ sys/arch/luna68k/luna68k/pmap_bootstrap.c 13 Dec 2016 12:43:37 -0000 @@@@ -51,7 +51,8 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap_bootstr extern char *etext; -extern int maxmem, physmem; +extern int maxmem; +extern psize_t physmem; extern paddr_t avail_start, avail_end; /* Index: sys/arch/m68k/m68k/pmap_motorola.c =================================================================== RCS file: /cvsroot/src/sys/arch/m68k/m68k/pmap_motorola.c,v retrieving revision 1.67 diff -p -u -r1.67 pmap_motorola.c --- sys/arch/m68k/m68k/pmap_motorola.c 25 Oct 2013 20:51:14 -0000 1.67 +++ sys/arch/m68k/m68k/pmap_motorola.c 13 Dec 2016 12:43:40 -0000 @@@@ -133,6 +133,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap_motorol #include #include +#include #include @@@@ -295,10 +296,11 @@@@ struct pool pmap_pv_pool; /* memory pool static inline struct pv_header * pa_to_pvh(paddr_t pa) { - int bank, pg = 0; /* XXX gcc4 -Wuninitialized */ - - bank = vm_physseg_find(atop((pa)), &pg); - return &VM_PHYSMEM_PTR(bank)->pmseg.pvheader[pg]; + uvm_physseg_t bank = 0; /* XXX gcc4 -Wuninitialized */ + psize_t pg = 0; + + bank = uvm_physseg_find(atop((pa)), &pg); + return &uvm_physseg_get_pmseg(bank)->pvheader[pg]; } /* @@@@ -412,7 +414,7 @@@@ pmap_init(void) struct pv_header *pvh; int rv; int npages; - int bank; + uvm_physseg_t bank; PMAP_DPRINTF(PDB_FOLLOW, ("pmap_init()\n")); @@@@ -434,8 +436,10 @@@@ pmap_init(void) * Allocate memory for random pmap data structures. Includes the * initial segment table, pv_head_table and pmap_attributes. */ - for (page_cnt = 0, bank = 0; bank < vm_nphysseg; bank++) - page_cnt += VM_PHYSMEM_PTR(bank)->end - VM_PHYSMEM_PTR(bank)->start; + for (page_cnt = 0, bank = uvm_physseg_get_first(); + uvm_physseg_valid(bank); + bank = uvm_physseg_get_next(bank)) + page_cnt += uvm_physseg_get_end(bank) - uvm_physseg_get_start(bank); s = M68K_STSIZE; /* Segtabzero */ s += page_cnt * sizeof(struct pv_header); /* pv table */ s = round_page(s); @@@@ -461,9 +465,11 @@@@ pmap_init(void) * assign them to the memory segments. */ pvh = pv_table; - for (bank = 0; bank < vm_nphysseg; bank++) { - npages = VM_PHYSMEM_PTR(bank)->end - VM_PHYSMEM_PTR(bank)->start; - VM_PHYSMEM_PTR(bank)->pmseg.pvheader = pvh; + for (bank = uvm_physseg_get_first(); + uvm_physseg_valid(bank); + bank = uvm_physseg_get_next(bank)) { + npages = uvm_physseg_get_end(bank) - uvm_physseg_get_start(bank); + uvm_physseg_get_pmseg(bank)->pvheader = pvh; pvh += npages; } @@@@ -1704,17 +1710,20 @@@@ pmap_collect1(pmap_t pmap, paddr_t start static void pmap_collect(void) { - int bank, s; - + int s; + uvm_physseg_t bank; + /* * XXX This is very bogus. We should handle kernel PT * XXX pages much differently. */ s = splvm(); - for (bank = 0; bank < vm_nphysseg; bank++) { - pmap_collect1(pmap_kernel(), ptoa(VM_PHYSMEM_PTR(bank)->start), - ptoa(VM_PHYSMEM_PTR(bank)->end)); + for (bank = uvm_physseg_get_first(); + uvm_physseg_valid(bank); + bank = uvm_physseg_get_next(bank)) { + pmap_collect1(pmap_kernel(), ptoa(uvm_physseg_get_start(bank)), + ptoa(uvm_physseg_get_end(bank))); } splx(s); } Index: sys/arch/mac68k/mac68k/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/mac68k/mac68k/machdep.c,v retrieving revision 1.349 diff -p -u -r1.349 machdep.c --- sys/arch/mac68k/mac68k/machdep.c 30 Aug 2015 01:46:03 -0000 1.349 +++ sys/arch/mac68k/mac68k/machdep.c 13 Dec 2016 12:43:42 -0000 @@@@ -136,6 +136,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #define MAXMEM 64*1024 /* XXX - from cmap.h */ #include +#include #include @@@@ -253,6 +254,7 @@@@ mac68k_init(void) * Notice that we don't need to worry about avail_end here * since it's equal to high[numranges-1]. */ + uvm_physseg_init(); for (i = 0; i < numranges; i++) { if (low[i] <= avail_start && avail_start < high[i]) uvm_page_physload(atop(avail_start), atop(high[i]), Index: sys/arch/mips/include/pmap.h =================================================================== RCS file: /cvsroot/src/sys/arch/mips/include/pmap.h,v retrieving revision 1.68 diff -p -u -r1.68 pmap.h --- sys/arch/mips/include/pmap.h 11 Jul 2016 16:15:35 -0000 1.68 +++ sys/arch/mips/include/pmap.h 13 Dec 2016 12:43:42 -0000 @@@@ -116,7 +116,7 @@@@ typedef uint32_t pt_entry_t; #define PMAP_SEGTAB_ALIGN __aligned(sizeof(void *)*NSEGPG) __section(".data1") #endif -struct vm_physseg; +#include void pmap_md_init(void); void pmap_md_icache_sync_all(void); @@@@ -125,7 +125,7 @@@@ void pmap_md_page_syncicache(struct vm_p bool pmap_md_vca_add(struct vm_page *, vaddr_t, pt_entry_t *); void pmap_md_vca_clean(struct vm_page *, int); void pmap_md_vca_remove(struct vm_page *, vaddr_t, bool, bool); -bool pmap_md_ok_to_steal_p(const struct vm_physseg *, size_t); +bool pmap_md_ok_to_steal_p(const uvm_physseg_t, size_t); bool pmap_md_tlb_check_entry(void *, vaddr_t, tlb_asid_t, pt_entry_t); static inline bool Index: sys/arch/mips/mips/mips_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/mips/mips/mips_machdep.c,v retrieving revision 1.274 diff -p -u -r1.274 mips_machdep.c --- sys/arch/mips/mips/mips_machdep.c 30 Jul 2016 05:55:34 -0000 1.274 +++ sys/arch/mips/mips/mips_machdep.c 13 Dec 2016 12:43:43 -0000 @@@@ -145,6 +145,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: mips_machdep #endif #include +#include #include #include @@@@ -2008,38 +2009,34 @@@@ mips_init_msgbuf(void) { vsize_t sz = (vsize_t)round_page(MSGBUFSIZE); vsize_t reqsz = sz; - u_int bank = vm_nphysseg - 1; - struct vm_physseg *vps = VM_PHYSMEM_PTR(bank); + uvm_physseg_t bank = uvm_physseg_get_last(); #ifndef _LP64 /* * Fist the physical segment that can be mapped to KSEG0 */ - for (; vps >= vm_physmem; vps--, bank--) { - if (vps->avail_start + atop(sz) <= atop(MIPS_PHYS_MASK)) + for (; uvm_physseg_valid(bank); bank = uvm_physseg_get_prev(bank)) { + if (uvm_physseg_get_avail_start(bank) + atop(sz) <= atop(MIPS_PHYS_MASK)) break; } #endif + paddr_t start = uvm_physseg_get_start(bank); + paddr_t end = uvm_physseg_get_end(bank); + /* shrink so that it'll fit in the last segment */ - if ((vps->avail_end - vps->avail_start) < atop(sz)) - sz = ptoa(vps->avail_end - vps->avail_start); + if ((end - start) < atop(sz)) + sz = ptoa(end - start); - vps->end -= atop(sz); - vps->avail_end -= atop(sz); + end -= atop(sz); + uvm_physseg_unplug(end, atop(sz)); + #ifdef _LP64 - msgbufaddr = (void *) MIPS_PHYS_TO_XKPHYS_CACHED(ptoa(vps->end)); + msgbufaddr = (void *) MIPS_PHYS_TO_XKPHYS_CACHED(end); #else - msgbufaddr = (void *) MIPS_PHYS_TO_KSEG0(ptoa(vps->end)); + msgbufaddr = (void *) MIPS_PHYS_TO_KSEG0(end); #endif initmsgbuf(msgbufaddr, sz); - /* Remove the [last] segment if it now has no pages. */ - if (vps->start == vps->end) { - for (vm_nphysseg--; bank < vm_nphysseg - 1; bank++) { - VM_PHYSMEM_PTR_SWAP(bank, bank + 1); - } - } - /* warn if the message buffer had to be shrunk */ if (sz != reqsz) printf("WARNING: %"PRIdVSIZE" bytes not available for msgbuf " Index: sys/arch/mips/mips/pmap_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/mips/mips/pmap_machdep.c,v retrieving revision 1.11 diff -p -u -r1.11 pmap_machdep.c --- sys/arch/mips/mips/pmap_machdep.c 5 Sep 2016 06:59:25 -0000 1.11 +++ sys/arch/mips/mips/pmap_machdep.c 13 Dec 2016 12:43:43 -0000 @@@@ -133,6 +133,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap_machdep #endif #include +#include #include #include @@@@ -306,12 +307,12 @@@@ pmap_md_vca_page_wbinv(struct vm_page *p } bool -pmap_md_ok_to_steal_p(const struct vm_physseg *seg, size_t npgs) +pmap_md_ok_to_steal_p(const uvm_physseg_t bank, size_t npgs) { #ifndef _LP64 - if (seg->avail_start + npgs >= atop(MIPS_PHYS_MASK + 1)) { - aprint_debug("%s: seg %zu: not enough in KSEG0 for %zu pages\n", - __func__, seg - VM_PHYSMEM_PTR(0), npgs); + if (uvm_physseg_get_avail_start(bank) + npgs >= atop(MIPS_PHYS_MASK + 1)) { + aprint_debug("%s: seg not enough in KSEG0 for %zu pages\n", + __func__, npgs); return false; } #endif @@@@ -393,8 +394,8 @@@@ pmap_bootstrap(void) * for us. Must do this before uvm_pageboot_alloc() * can be called. */ - pmap_limits.avail_start = ptoa(VM_PHYSMEM_PTR(0)->start); - pmap_limits.avail_end = ptoa(VM_PHYSMEM_PTR(vm_nphysseg - 1)->end); + pmap_limits.avail_start = ptoa(uvm_physseg_get_start(uvm_physseg_get_first())); + pmap_limits.avail_end = ptoa(uvm_physseg_get_end(uvm_physseg_get_last())); pmap_limits.virtual_end = pmap_limits.virtual_start + (vaddr_t)sysmap_size * NBPG; #ifndef _LP64 Index: sys/arch/mipsco/mipsco/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/mipsco/mipsco/machdep.c,v retrieving revision 1.79 diff -p -u -r1.79 machdep.c --- sys/arch/mipsco/mipsco/machdep.c 26 Jun 2015 22:55:40 -0000 1.79 +++ sys/arch/mipsco/mipsco/machdep.c 13 Dec 2016 12:43:43 -0000 @@@@ -65,6 +65,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #include /* mfs_initminiroot() */ @@@@ -215,7 +216,8 @@@@ mach_init(int argc, char *argv[], char * * Set the VM page size. */ uvm_setpagesize(); - + uvm_physseg_init(); + /* Find out how much memory is available. */ physmem = memsize_scan(kernend); Index: sys/arch/mmeye/mmeye/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/mmeye/mmeye/machdep.c,v retrieving revision 1.57 diff -p -u -r1.57 machdep.c --- sys/arch/mmeye/mmeye/machdep.c 8 Nov 2013 02:24:53 -0000 1.57 +++ sys/arch/mmeye/mmeye/machdep.c 13 Dec 2016 12:43:43 -0000 @@@@ -85,6 +85,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #include #include @@@@ -304,6 +305,7 @@@@ initSH3(void *pc, u_int bim, int32_t bip /* Load memory to UVM */ physmem = atop(IOM_RAM_SIZE); kernend = atop(round_page(SH3_P1SEG_TO_PHYS(kernend))); + uvm_physseg_init(); uvm_page_physload( kernend, atop(IOM_RAM_BEGIN + IOM_RAM_SIZE), kernend, atop(IOM_RAM_BEGIN + IOM_RAM_SIZE), Index: sys/arch/mvme68k/mvme68k/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/mvme68k/mvme68k/machdep.c,v retrieving revision 1.154 diff -p -u -r1.154 machdep.c --- sys/arch/mvme68k/mvme68k/machdep.c 31 May 2016 03:25:46 -0000 1.154 +++ sys/arch/mvme68k/mvme68k/machdep.c 13 Dec 2016 12:43:44 -0000 @@@@ -80,6 +80,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #endif #include +#include #include @@@@ -218,6 +219,7 @@@@ mvme68k_init(void) /* * Tell the VM system about available physical memory. */ + uvm_physseg_init(); for (i = 0; i < mem_cluster_cnt; i++) { if (phys_seg_list[i].ps_start == phys_seg_list[i].ps_end) { /* Index: sys/arch/netwinder/netwinder/netwinder_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/netwinder/netwinder/netwinder_machdep.c,v retrieving revision 1.83 diff -p -u -r1.83 netwinder_machdep.c --- sys/arch/netwinder/netwinder/netwinder_machdep.c 13 Sep 2014 18:08:39 -0000 1.83 +++ sys/arch/netwinder/netwinder/netwinder_machdep.c 13 Dec 2016 12:43:46 -0000 @@@@ -69,6 +69,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: netwinder_ma #include #include +#include #include @@@@ -477,7 +478,7 @@@@ initarm(void *arg) physmem = (physical_end - physical_start) / PAGE_SIZE; /* Tell the user about the memory */ - printf("physmemory: %d pages at 0x%08lx -> 0x%08lx\n", physmem, + printf("physmemory: %"PRIxPSIZE" pages at 0x%08lx -> 0x%08lx\n", physmem, physical_start, physical_end - 1); /* @@@@ -739,7 +740,7 @@@@ initarm(void *arg) /* Load memory into UVM. */ printf("page "); uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ - + uvm_physseg_init(); /* XXX Always one RAM block -- nuke the loop. */ for (loop = 0; loop < bootconfig.dramblocks; loop++) { paddr_t start = (paddr_t)bootconfig.dram[loop].address; Index: sys/arch/news68k/news68k/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/news68k/news68k/machdep.c,v retrieving revision 1.101 diff -p -u -r1.101 machdep.c --- sys/arch/news68k/news68k/machdep.c 24 Mar 2014 19:54:28 -0000 1.101 +++ sys/arch/news68k/news68k/machdep.c 13 Dec 2016 12:43:47 -0000 @@@@ -89,6 +89,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #define MAXMEM 64*1024 /* XXX - from cmap.h */ #include +#include #include @@@@ -164,6 +165,7 @@@@ news68k_init(void) * Tell the VM system about available physical memory. The * news68k only has one segment. */ + uvm_physseg_init(); uvm_page_physload(atop(avail_start), atop(avail_end), atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT); Index: sys/arch/newsmips/newsmips/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/newsmips/newsmips/machdep.c,v retrieving revision 1.118 diff -p -u -r1.118 machdep.c --- sys/arch/newsmips/newsmips/machdep.c 21 Jul 2016 19:49:59 -0000 1.118 +++ sys/arch/newsmips/newsmips/machdep.c 13 Dec 2016 12:43:47 -0000 @@@@ -72,6 +72,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #include /* mfs_initminiroot() */ @@@@ -244,7 +245,8 @@@@ mach_init(int x_boothowto, int x_bootdev * Set the VM page size. */ uvm_setpagesize(); - + uvm_physseg_init(); + boothowto = x_boothowto; bootdev = x_bootdev; physmem = btoc(x_maxmem); Index: sys/arch/next68k/next68k/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/next68k/next68k/machdep.c,v retrieving revision 1.111 diff -p -u -r1.111 machdep.c --- sys/arch/next68k/next68k/machdep.c 24 Mar 2014 20:01:03 -0000 1.111 +++ sys/arch/next68k/next68k/machdep.c 13 Dec 2016 12:43:47 -0000 @@@@ -77,6 +77,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #ifdef DDB #include @@@@ -181,6 +182,7 @@@@ next68k_init(void) /* * Tell the VM system about available physical memory. */ + uvm_physseg_init(); for (i = 0; i < mem_cluster_cnt; i++) { if (phys_seg_list[i].ps_start == phys_seg_list[i].ps_end) { /* Index: sys/arch/playstation2/playstation2/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/playstation2/playstation2/machdep.c,v retrieving revision 1.31 diff -p -u -r1.31 machdep.c --- sys/arch/playstation2/playstation2/machdep.c 30 Jun 2015 02:39:04 -0000 1.31 +++ sys/arch/playstation2/playstation2/machdep.c 13 Dec 2016 12:43:48 -0000 @@@@ -44,6 +44,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #ifdef DDB #include @@@@ -115,6 +116,8 @@@@ mach_init(void) bootinfo_dump(); #endif uvm_setpagesize(); + uvm_physseg_init(); + physmem = atop(PS2_MEMORY_SIZE); /* Index: sys/arch/powerpc/ibm4xx/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/powerpc/ibm4xx/pmap.c,v retrieving revision 1.72 diff -p -u -r1.72 pmap.c --- sys/arch/powerpc/ibm4xx/pmap.c 27 Jan 2012 19:48:39 -0000 1.72 +++ sys/arch/powerpc/ibm4xx/pmap.c 13 Dec 2016 12:43:49 -0000 @@@@ -79,6 +79,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.7 #include #include +#include #include #include @@@@ -199,7 +200,7 @@@@ pa_to_pv(paddr_t pa) { int bank, pg; - bank = vm_physseg_find(atop(pa), &pg); + bank = uvm_physseg_find(atop(pa), &pg); if (bank == -1) return NULL; return &VM_PHYSMEM_PTR(bank)->pmseg.pvent[pg]; @@@@ -210,7 +211,7 @@@@ pa_to_attr(paddr_t pa) { int bank, pg; - bank = vm_physseg_find(atop(pa), &pg); + bank = uvm_physseg_find(atop(pa), &pg); if (bank == -1) return NULL; return &VM_PHYSMEM_PTR(bank)->pmseg.attrs[pg]; @@@@ -295,7 +296,8 @@@@ pmap_bootstrap(u_int kernelstart, u_int */ uvmexp.pagesize = NBPG; uvm_setpagesize(); - + uvm_physseg_init(); + /* * Get memory. */ Index: sys/arch/powerpc/oea/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/powerpc/oea/pmap.c,v retrieving revision 1.93 diff -p -u -r1.93 pmap.c --- sys/arch/powerpc/oea/pmap.c 14 Feb 2016 18:07:49 -0000 1.93 +++ sys/arch/powerpc/oea/pmap.c 13 Dec 2016 12:43:54 -0000 @@@@ -81,6 +81,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.9 #include #include +#include #include #include @@@@ -2909,9 +2910,9 @@@@ pmap_steal_memory(vsize_t vsize, vaddr_t { vsize_t size; vaddr_t va; - paddr_t pa = 0; - int npgs, bank; - struct vm_physseg *ps; + paddr_t start, end, pa = 0; + int npgs, freelist; + uvm_physseg_t bank; if (uvm.page_init_done == true) panic("pmap_steal_memory: called _after_ bootstrap"); @@@@ -2926,11 +2927,18 @@@@ pmap_steal_memory(vsize_t vsize, vaddr_t * PA 0 will never be among those given to UVM so we can use it * to indicate we couldn't steal any memory. */ - for (bank = 0; bank < vm_nphysseg; bank++) { - ps = VM_PHYSMEM_PTR(bank); - if (ps->free_list == VM_FREELIST_FIRST256 && - ps->avail_end - ps->avail_start >= npgs) { - pa = ptoa(ps->avail_start); + + for (bank = uvm_physseg_get_first(); + uvm_physseg_valid(bank); + bank = uvm_physseg_get_next(bank)) { + + freelist = uvm_physseg_get_free_list(bank); + start = uvm_physseg_get_start(bank); + end = uvm_physseg_get_end(bank); + + if (freelist == VM_FREELIST_FIRST256 && + (end - start) >= npgs) { + pa = ptoa(start); break; } } @@@@ -2938,24 +2946,8 @@@@ pmap_steal_memory(vsize_t vsize, vaddr_t if (pa == 0) panic("pmap_steal_memory: no approriate memory to steal!"); - ps->avail_start += npgs; - ps->start += npgs; - - /* - * If we've used up all the pages in the segment, remove it and - * compact the list. - */ - if (ps->avail_start == ps->end) { - /* - * If this was the last one, then a very bad thing has occurred - */ - if (--vm_nphysseg == 0) - panic("pmap_steal_memory: out of memory!"); + uvm_physseg_unplug(start, npgs); - printf("pmap_steal_memory: consumed bank %d\n", bank); - for (; bank < vm_nphysseg; bank++, ps++) { - ps[0] = ps[1]; - } } va = (vaddr_t) pa; @@@@ -2964,9 +2956,10 @@@@ pmap_steal_memory(vsize_t vsize, vaddr_t #ifdef DEBUG if (pmapdebug && npgs > 1) { u_int cnt = 0; - for (bank = 0; bank < vm_nphysseg; bank++) { - ps = VM_PHYSMEM_PTR(bank); - cnt += ps->avail_end - ps->avail_start; + for (bank = uvm_physseg_get_first(); + uvm_physseg_valid(bank); + bank = uvm_physseg_get_next(bank)) { + cnt += uvm_physseg_get_avail_end(bank) - uvm_physseg_get_avail_start(bank); } printf("pmap_steal_memory: stole %u (total %u) pages (%u left)\n", npgs, pmap_pages_stolen, cnt); @@@@ -3446,15 +3439,18 @@@@ pmap_bootstrap(paddr_t kernelstart, padd #ifdef DEBUG if (pmapdebug & PMAPDEBUG_BOOT) { u_int cnt; - int bank; + uvm_physseg_t bank; char pbuf[9]; - for (cnt = 0, bank = 0; bank < vm_nphysseg; bank++) { - cnt += VM_PHYSMEM_PTR(bank)->avail_end - VM_PHYSMEM_PTR(bank)->avail_start; + for (cnt = 0, bank = uvm_physseg_get_first(); + uvm_physseg_valid(bank); + bank = uvm_physseg_get_next(bank)) { + cnt += uvm_physseg_get_avail_end(bank) - + uvm_physseg_get_avail_start(bank); printf("pmap_bootstrap: vm_physmem[%d]=%#" _PRIxpa "-%#" _PRIxpa "/%#" _PRIxpa "\n", bank, - ptoa(VM_PHYSMEM_PTR(bank)->avail_start), - ptoa(VM_PHYSMEM_PTR(bank)->avail_end), - ptoa(VM_PHYSMEM_PTR(bank)->avail_end - VM_PHYSMEM_PTR(bank)->avail_start)); + ptoa(uvm_physseg_get_avail_start(bank)), + ptoa(uvm_physseg_get_avail_end(bank)), + ptoa(uvm_physseg_get_avail_end(bank) - uvm_physseg_get_avail_start(bank))); } format_bytes(pbuf, sizeof(pbuf), ptoa((u_int64_t) cnt)); printf("pmap_bootstrap: UVM memory = %s (%u pages)\n", Index: sys/arch/powerpc/powerpc/bus_dma.c =================================================================== RCS file: /cvsroot/src/sys/arch/powerpc/powerpc/bus_dma.c,v retrieving revision 1.46 diff -p -u -r1.46 bus_dma.c --- sys/arch/powerpc/powerpc/bus_dma.c 1 Feb 2012 09:54:03 -0000 1.46 +++ sys/arch/powerpc/powerpc/bus_dma.c 13 Dec 2016 12:43:55 -0000 @@@@ -45,6 +45,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v #include #include +#include #ifdef PPC_BOOKE #define EIEIO __asm volatile("mbar\t0") @@@@ -544,13 +545,15 @@@@ int _bus_dmamem_alloc(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment, bus_size_t boundary, bus_dma_segment_t *segs, int nsegs, int *rsegs, int flags) { paddr_t start = 0xffffffff, end = 0; - int bank; + uvm_physseg_t bank; - for (bank = 0; bank < vm_nphysseg; bank++) { - if (start > ptoa(VM_PHYSMEM_PTR(bank)->avail_start)) - start = ptoa(VM_PHYSMEM_PTR(bank)->avail_start); - if (end < ptoa(VM_PHYSMEM_PTR(bank)->avail_end)) - end = ptoa(VM_PHYSMEM_PTR(bank)->avail_end); + for (bank = uvm_physseg_get_first(); + uvm_physseg_valid(bank); + bank = uvm_physseg_get_next(bank)) { + if (start > ptoa(uvm_physseg_get_avail_start(bank))) + start = ptoa(uvm_physseg_get_avail_start(bank)); + if (end < ptoa(uvm_physseg_get_avail_end(bank))) + end = ptoa(uvm_physseg_get_avail_end(bank)); } return _bus_dmamem_alloc_range(t, size, alignment, boundary, segs, Index: sys/arch/sh3/sh3/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/sh3/sh3/pmap.c,v retrieving revision 1.78 diff -p -u -r1.78 pmap.c --- sys/arch/sh3/sh3/pmap.c 3 Sep 2016 09:07:54 -0000 1.78 +++ sys/arch/sh3/sh3/pmap.c 13 Dec 2016 12:43:57 -0000 @@@@ -39,6 +39,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.7 #include /* XXX: for sock_loan_thresh */ #include +#include #include #include @@@@ -107,8 +108,8 @@@@ pmap_bootstrap(void) /* Steal msgbuf area */ initmsgbuf((void *)uvm_pageboot_alloc(MSGBUFSIZE), MSGBUFSIZE); - avail_start = ptoa(VM_PHYSMEM_PTR(0)->start); - avail_end = ptoa(VM_PHYSMEM_PTR(vm_nphysseg - 1)->end); + avail_start = ptoa(uvm_physseg_get_start(uvm_physseg_get_first())); + avail_end = ptoa(uvm_physseg_get_end(uvm_physseg_get_last())); __pmap_kve = VM_MIN_KERNEL_ADDRESS; pmap_kernel()->pm_refcnt = 1; @@@@ -126,39 +127,28 @@@@ pmap_bootstrap(void) vaddr_t pmap_steal_memory(vsize_t size, vaddr_t *vstart, vaddr_t *vend) { - struct vm_physseg *bank; - int i, j, npage; + int npage; paddr_t pa; vaddr_t va; + uvm_physseg_t bank; KDASSERT(!uvm.page_init_done); size = round_page(size); npage = atop(size); - bank = NULL; - for (i = 0; i < vm_nphysseg; i++) { - bank = VM_PHYSMEM_PTR(i); - if (npage <= bank->avail_end - bank->avail_start) + for (bank = uvm_physseg_get_first(); + uvm_physseg_valid(bank); + bank = uvm_physseg_get_next(bank)) { + if (npage <= uvm_physseg_get_end(bank) - uvm_physseg_get_start(bank)) break; } - KDASSERT(i != vm_nphysseg); - KDASSERT(bank != NULL); - /* Steal pages */ - pa = ptoa(bank->avail_start); - bank->avail_start += npage; - bank->start += npage; - - /* GC memory bank */ - if (bank->avail_start == bank->end) { - /* Remove this segment from the list. */ - vm_nphysseg--; - KDASSERT(vm_nphysseg > 0); - for (j = i; i < vm_nphysseg; j++) - VM_PHYSMEM_PTR_SWAP(j, j + 1); - } + KDASSERT(uvm_physseg_valid(bank)); + /* Steal pages */ + pa = ptoa(uvm_physseg_get_start(bank)); + uvm_physseg_unplug(start, npage); va = SH3_PHYS_TO_P1SEG(pa); memset((void *)va, 0, size); Index: sys/arch/sh3/sh3/vm_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/sh3/sh3/vm_machdep.c,v retrieving revision 1.76 diff -p -u -r1.76 vm_machdep.c --- sys/arch/sh3/sh3/vm_machdep.c 7 Nov 2013 21:45:04 -0000 1.76 +++ sys/arch/sh3/sh3/vm_machdep.c 13 Dec 2016 12:43:57 -0000 @@@@ -102,6 +102,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: vm_machdep.c #include #include +#include #include #include @@@@ -387,7 +388,7 @@@@ int mm_md_physacc(paddr_t pa, vm_prot_t prot) { - if (atop(pa) < vm_physmem[0].start || PHYS_TO_VM_PAGE(pa) != NULL) { + if (atop(pa) < uvm_physseg_get_start(uvm_physseg_get_first()) || PHYS_TO_VM_PAGE(pa) != NULL) { return 0; } return EFAULT; Index: sys/arch/shark/ofw/ofw.c =================================================================== RCS file: /cvsroot/src/sys/arch/shark/ofw/ofw.c,v retrieving revision 1.65 diff -p -u -r1.65 ofw.c --- sys/arch/shark/ofw/ofw.c 7 Jul 2016 06:55:38 -0000 1.65 +++ sys/arch/shark/ofw/ofw.c 13 Dec 2016 12:44:01 -0000 @@@@ -53,6 +53,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: ofw.c,v 1.65 #include #include +#include #include @@@@ -873,7 +874,8 @@@@ ofw_configmem(void) /* Load memory into UVM. */ uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ - + uvm_physseg_init(); + /* XXX Please kill this code dead. */ for (i = 0; i < bootconfig.dramblocks; i++) { paddr_t start = (paddr_t)bootconfig.dram[i].address; Index: sys/arch/sparc/sparc/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/sparc/sparc/pmap.c,v retrieving revision 1.360 diff -p -u -r1.360 pmap.c --- sys/arch/sparc/sparc/pmap.c 11 Dec 2015 19:47:52 -0000 1.360 +++ sys/arch/sparc/sparc/pmap.c 13 Dec 2016 12:44:06 -0000 @@@@ -77,6 +77,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.3 #include /* for MID_* */ #include +#include #include #include @@@@ -3036,7 +3037,8 @@@@ pmap_bootstrap(int nctx, int nregion, in uvmexp.pagesize = NBPG; uvm_setpagesize(); - + uvm_physseg_init(); + #if defined(SUN4) && (defined(SUN4C) || defined(SUN4M) || defined(SUN4D)) /* In this case NPTESG is a variable */ nptesg = (NBPSG >> pgshift); Index: sys/arch/sparc64/sparc64/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/sparc64/sparc64/pmap.c,v retrieving revision 1.304 diff -p -u -r1.304 pmap.c --- sys/arch/sparc64/sparc64/pmap.c 4 Nov 2016 05:41:01 -0000 1.304 +++ sys/arch/sparc64/sparc64/pmap.c 13 Dec 2016 12:44:10 -0000 @@@@ -52,6 +52,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.3 #include #include +#include #include #include @@@@ -779,7 +780,8 @@@@ pmap_bootstrap(u_long kernelstart, u_lon uvmexp.pagesize = NBPG; uvmexp.ncolors = pmap_calculate_colors(); uvm_setpagesize(); - + uvm_physseg_init(); + /* * Get hold or the message buffer. */ Index: sys/arch/sun2/sun2/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/sun2/sun2/pmap.c,v retrieving revision 1.47 diff -p -u -r1.47 pmap.c --- sys/arch/sun2/sun2/pmap.c 24 Mar 2014 18:50:31 -0000 1.47 +++ sys/arch/sun2/sun2/pmap.c 13 Dec 2016 12:44:12 -0000 @@@@ -97,6 +97,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.4 #include #include +#include #include #include @@@@ -1701,7 +1702,8 @@@@ pmap_bootstrap(vaddr_t nextva) uvmexp.pagesize = NBPG; uvm_setpagesize(); - + uvm_physseg_init(); + /* after setting up some structures */ pmap_common_init(kernel_pmap); Index: sys/arch/sun3/sun3/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/sun3/sun3/pmap.c,v retrieving revision 1.170 diff -p -u -r1.170 pmap.c --- sys/arch/sun3/sun3/pmap.c 7 Nov 2013 17:50:18 -0000 1.170 +++ sys/arch/sun3/sun3/pmap.c 13 Dec 2016 12:44:13 -0000 @@@@ -95,6 +95,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.1 #include #include +#include #include #include @@@@ -1731,7 +1732,8 @@@@ pmap_bootstrap(vaddr_t nextva) uvmexp.pagesize = PAGE_SIZE; uvm_setpagesize(); - + uvm_physseg_init(); + /* after setting up some structures */ pmap_common_init(kernel_pmap); Index: sys/arch/sun3/sun3x/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/sun3/sun3x/pmap.c,v retrieving revision 1.113 diff -p -u -r1.113 pmap.c --- sys/arch/sun3/sun3x/pmap.c 6 Sep 2013 17:43:19 -0000 1.113 +++ sys/arch/sun3/sun3x/pmap.c 13 Dec 2016 12:44:14 -0000 @@@@ -120,6 +120,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.1 #include #include +#include #include #include @@@@ -894,7 +895,8 @@@@ pmap_bootstrap(vaddr_t nextva) /* Notify the VM system of our page size. */ uvmexp.pagesize = PAGE_SIZE; uvm_setpagesize(); - + uvm_physseg_init(); + pmap_page_upload(); } Index: sys/arch/usermode/usermode/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/usermode/usermode/pmap.c,v retrieving revision 1.106 diff -p -u -r1.106 pmap.c --- sys/arch/usermode/usermode/pmap.c 7 Jul 2016 06:55:39 -0000 1.106 +++ sys/arch/usermode/usermode/pmap.c 13 Dec 2016 12:44:15 -0000 @@@@ -45,6 +45,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.1 #include #include +#include struct pv_entry { struct pv_entry *pv_next; @@@@ -409,6 +410,8 @@@@ pmap_bootstrap(void) } thunk_printf_debug("kernel pmap entries mem added to the kernel pmap\n"); + uvm_physseg_init(); + /* add file space to uvm's FREELIST */ uvm_page_physload(atop(0), atop(free_end), Index: sys/arch/vax/vax/ka650.c =================================================================== RCS file: /cvsroot/src/sys/arch/vax/vax/ka650.c,v retrieving revision 1.36 diff -p -u -r1.36 ka650.c --- sys/arch/vax/vax/ka650.c 14 Dec 2010 23:44:49 -0000 1.36 +++ sys/arch/vax/vax/ka650.c 13 Dec 2016 12:44:15 -0000 @@@@ -106,7 +106,7 @@@@ ka650_conf(void) ka650setcache(CACHEON); if (ctob(physmem) > ka650merr_ptr->merr_qbmbr) { - printf("physmem(0x%x) > qbmbr(0x%x)\n", + printf("physmem(%"PRIxPSIZE") > qbmbr(0x%x)\n", ctob(physmem), (int)ka650merr_ptr->merr_qbmbr); panic("qbus map unprotected"); } Index: sys/arch/vax/vax/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/vax/vax/pmap.c,v retrieving revision 1.182 diff -p -u -r1.182 pmap.c --- sys/arch/vax/vax/pmap.c 2 Feb 2012 18:59:44 -0000 1.182 +++ sys/arch/vax/vax/pmap.c 13 Dec 2016 12:44:15 -0000 @@@@ -51,6 +51,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.1 #include #include +#include #ifdef PMAPDEBUG #include @@@@ -446,6 +447,7 @@@@ pmap_bootstrap(void) /* * Now everything should be complete, start virtual memory. */ + uvm_physseg_init(); uvm_page_physload(avail_start >> PGSHIFT, avail_end >> PGSHIFT, avail_start >> PGSHIFT, avail_end >> PGSHIFT, VM_FREELIST_DEFAULT); @@@@ -475,7 +477,8 @@@@ pmap_steal_memory(vsize_t size, vaddr_t { vaddr_t v; int npgs; - + uvm_physseg_t bank; + PMDEBUG(("pmap_steal_memory: size 0x%lx start %p end %p\n", size, vstartp, vendp)); @@@@ -490,10 +493,10 @@@@ pmap_steal_memory(vsize_t size, vaddr_t /* * A vax only have one segment of memory. */ + bank = uvm_physseg_get_first(); - v = (VM_PHYSMEM_PTR(0)->avail_start << PGSHIFT) | KERNBASE; - VM_PHYSMEM_PTR(0)->avail_start += npgs; - VM_PHYSMEM_PTR(0)->start += npgs; + v = (uvm_physseg_get_start(bank) << PGSHIFT) | KERNBASE; + uvm_physseg_unplug(uvm_physseg_get_start(bank), npgs); memset((void *)v, 0, size); return v; } Index: sys/arch/x68k/x68k/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/x68k/x68k/machdep.c,v retrieving revision 1.194 diff -p -u -r1.194 machdep.c --- sys/arch/x68k/x68k/machdep.c 2 Dec 2016 12:43:07 -0000 1.194 +++ sys/arch/x68k/x68k/machdep.c 13 Dec 2016 12:44:15 -0000 @@@@ -102,6 +102,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #define MAXMEM 64*1024 /* XXX - from cmap.h */ #include +#include #include #include @@@@ -184,6 +185,8 @@@@ x68k_init(void) paddr_t msgbuf_pa; paddr_t s, e; + uvm_physseg_init(); + /* * Most m68k ports allocate msgbuf at the end of available memory * (i.e. just after avail_end), but on x68k we allocate msgbuf @@@@ -553,10 +556,7 @@@@ cpu_init_kcore_hdr(void) { cpu_kcore_hdr_t *h = &cpu_kcore_hdr; struct m68k_kcore_hdr *m = &h->un._m68k; - psize_t size; -#ifdef EXTENDED_MEMORY - int i, seg; -#endif + uvm_physseg_t i; memset(&cpu_kcore_hdr, 0, sizeof(cpu_kcore_hdr)); @@@@ -605,20 +605,25 @@@@ cpu_init_kcore_hdr(void) /* * X68k has multiple RAM segments on some models. */ - size = phys_basemem_seg.end - phys_basemem_seg.start; - m->ram_segs[0].start = phys_basemem_seg.start; - m->ram_segs[0].size = size; -#ifdef EXTENDED_MEMORY - seg = 1; - for (i = 0; i < EXTMEM_SEGS; i++) { - size = phys_extmem_seg[i].end - phys_extmem_seg[i].start; - if (size == 0) - continue; - m->ram_segs[seg].start = phys_extmem_seg[i].start; - m->ram_segs[seg].size = size; - seg++; + m->ram_segs[0].start = lowram; + m->ram_segs[0].size = mem_size - lowram; + + i = uvm_physseg_get_first(); + + for (uvm_physseg_get_next(i); uvm_physseg_valid(i); i = uvm_physseg_get_next(i)) { + if (uvm_physseg_valid(i) == false) + break; + + const paddr_t startpfn = uvm_physseg_get_start(i); + const paddr_t endpfn = uvm_physseg_get_end(i); + + KASSERT(startpfn != -1 && endpfn != -1); + + m->ram_segs[i].start = + ctob(startpfn); + m->ram_segs[i].size = + ctob(endpfn - startpfn); } -#endif } /* @@@@ -1249,11 +1254,14 @@@@ cpu_intr_p(void) int mm_md_physacc(paddr_t pa, vm_prot_t prot) { - int i; + uvm_physseg_t i; + + for (i = uvm_physseg_get_first(); uvm_physseg_valid(i); i = uvm_physseg_get_next(i)) { + if (uvm_physseg_valid(i) == false) + break; - for (i = 0; i < vm_nphysseg; i++) { - if (ctob(vm_physmem[i].start) <= pa && - pa < ctob(vm_physmem[i].end)) + if (ctob(uvm_physseg_get_start(i)) <= pa && + pa < ctob(uvm_physseg_get_end(i))) return 0; } return EFAULT; Index: sys/arch/x68k/x68k/pmap_bootstrap.c =================================================================== RCS file: /cvsroot/src/sys/arch/x68k/x68k/pmap_bootstrap.c,v retrieving revision 1.60 diff -p -u -r1.60 pmap_bootstrap.c --- sys/arch/x68k/x68k/pmap_bootstrap.c 27 Oct 2013 02:06:06 -0000 1.60 +++ sys/arch/x68k/x68k/pmap_bootstrap.c 13 Dec 2016 12:44:15 -0000 @@@@ -52,7 +52,8 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap_bootstr extern char *etext; -extern int maxmem, physmem; +extern int maxmem; +extern psize_t physmem; extern paddr_t avail_start, avail_end; /* Index: sys/arch/x86/x86/x86_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/x86/x86/x86_machdep.c,v retrieving revision 1.77 diff -p -u -r1.77 x86_machdep.c --- sys/arch/x86/x86/x86_machdep.c 25 Nov 2016 11:57:36 -0000 1.77 +++ sys/arch/x86/x86/x86_machdep.c 13 Dec 2016 12:44:16 -0000 @@@@ -67,6 +67,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: x86_machdep. #include #include +#include #include "acpica.h" #if NACPICA > 0 Index: sys/arch/xen/xen/balloon.c =================================================================== RCS file: /cvsroot/src/sys/arch/xen/xen/balloon.c,v retrieving revision 1.17 diff -p -u -r1.17 balloon.c --- sys/arch/xen/xen/balloon.c 7 Jul 2016 06:55:40 -0000 1.17 +++ sys/arch/xen/xen/balloon.c 13 Dec 2016 12:44:16 -0000 @@@@ -70,6 +70,10 @@@@ #define BALLOONDEBUG 0 +#if defined(_KERNEL_OPT) +#include "opt_uvm_hotplug.h" +#endif + #include __KERNEL_RCSID(0, "$NetBSD: balloon.c,v 1.17 2016/07/07 06:55:40 msaitoh Exp $"); @@@@ -93,6 +97,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: balloon.c,v #include #include +#include #include #include "locators.h" @@@@ -454,6 +459,7 @@@@ balloon_deflate(struct balloon_xenbus_so memset(mfn_list, 0, BALLOON_DELTA * sizeof(*mfn_list)); +#ifndef UVM_HOTPLUG /* * If the list is empty, we are deflating balloon beyond empty. This * is currently unsupported as this would require to dynamically add @@@@ -469,6 +475,7 @@@@ balloon_deflate(struct balloon_xenbus_so tpages, sc->balloon_num_page_entries); tpages = sc->balloon_num_page_entries; } +#endif /* reclaim pages from balloon */ set_xen_guest_handle(reservation.extent_start, mfn_list); @@@@ -491,19 +498,41 @@@@ balloon_deflate(struct balloon_xenbus_so /* plug pages back into memory through bpge entries */ for (rpages = 0; rpages < ret; rpages++) { - -#ifdef noyet +#ifdef UVM_HOTPLUG + extern paddr_t pmap_pa_end; + if (sc->balloon_num_page_entries == 0) { /*XXX: consolidate */ + /* "hot-plug": Stick it at the end of memory */ + pa = pmap_pa_end; + + /* P2M update */ + s = splvm(); + pmap_pa_end += PAGE_SIZE; /* XXX: TLB flush ?*/ + xpmap_ptom_map(pa, ptoa(mfn_list[rpages])); + xpq_queue_machphys_update(ptoa(mfn_list[rpages]), pa); + splx(s); + + if (uvm_physseg_plug(atop(pa), 1, NULL) == false) { + /* Undo P2M */ + s = splvm(); + xpmap_ptom_unmap(pa); + xpq_queue_machphys_update(ptoa(mfn_list[rpages]), 0); + pmap_pa_end -= PAGE_SIZE; /* XXX: TLB flush ?*/ + splx(s); + break; + } + continue; + } +#else if (sc->balloon_num_page_entries == 0) { /* * XXX This is the case where extra "hot-plug" - * mem w.r.t boot comes in + * mem w.r.t boot comes in */ device_printf(sc->sc_dev, "List empty. Cannot be collapsed further!\n"); break; } #endif - bpg_entry = SLIST_FIRST(&balloon_sc->balloon_page_entries); SLIST_REMOVE_HEAD(&balloon_sc->balloon_page_entries, entry); balloon_sc->balloon_num_page_entries--; Index: sys/arch/zaurus/zaurus/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/zaurus/zaurus/machdep.c,v retrieving revision 1.37 diff -p -u -r1.37 machdep.c --- sys/arch/zaurus/zaurus/machdep.c 7 Jul 2016 06:55:40 -0000 1.37 +++ sys/arch/zaurus/zaurus/machdep.c 13 Dec 2016 12:44:19 -0000 @@@@ -138,6 +138,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #include @@@@ -1091,6 +1092,7 @@@@ initarm(void *arg) printf("page "); #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ + uvm_physseg_init(); uvm_page_physload(atop(physical_freestart), atop(physical_freeend), atop(physical_freestart), atop(physical_freeend), VM_FREELIST_DEFAULT); @ 1.8 log @Remove leading untracked file mess in the diff @ text @d7 2 a8 2 +++ sys/arch/acorn26/acorn26/pmap.c 20 Nov 2016 07:18:10 -0000 @@@@ -293,19 +293,27 @@@@ pmap_bootstrap(int npages, paddr_t zp_ph d14 1 a14 1 + uvm_physmem_t bank; d23 5 a27 6 + for (bank = uvm_physmem_get_first(); + uvm_physmem_valid(bank); + bank = uvm_physmem_get_next(bank)) { + freelist = uvm_physmem_get_free_list(bank); + if (uvm_physmem_get_avail_start(bank) < uvm_physmem_get_avail_end(bank)) { + paddr_t avail_start = uvm_physmem_get_avail_start(bank); d35 1 a35 1 + uvm_physmem_set_avail_start(avail_start); d46 1 a46 1 +++ sys/arch/acorn26/acorn26/start.c 20 Nov 2016 07:18:10 -0000 d51 1 a51 1 +#include d59 1 a59 1 + uvm_physmem_init(); a62 15 Index: sys/arch/acorn26/vidc/arcvideo.c =================================================================== RCS file: /cvsroot/src/sys/arch/acorn26/vidc/arcvideo.c,v retrieving revision 1.17 diff -p -u -r1.17 arcvideo.c --- sys/arch/acorn26/vidc/arcvideo.c 11 May 2012 15:39:18 -0000 1.17 +++ sys/arch/acorn26/vidc/arcvideo.c 20 Nov 2016 07:18:11 -0000 @@@@ -47,6 +47,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: arcvideo.c,v #include #include +#include #include #include d69 1 a69 1 +++ sys/arch/acorn32/acorn32/rpc_machdep.c 20 Nov 2016 07:18:11 -0000 d74 1 a74 1 + uvm_physmem_init(); d85 10 a94 2 +++ sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c 20 Nov 2016 07:18:11 -0000 @@@@ -863,6 +863,8 @@@@ initarm(void *cookie) d98 1 a98 1 + uvm_physmem_init(); d106 4 a109 4 retrieving revision 1.346 diff -p -u -r1.346 machdep.c --- sys/arch/alpha/alpha/machdep.c 17 Oct 2014 18:14:42 -0000 1.346 +++ sys/arch/alpha/alpha/machdep.c 20 Nov 2016 07:18:12 -0000 d114 1 a114 1 +#include d131 1 a131 1 + uvm_physmem_init(); d143 1 a143 1 + uvm_physmem_t bank; d146 1 a146 1 + bank = uvm_physmem_get_last(); d151 2 a152 2 + if (uvm_physmem_get_avail_end(bank) - uvm_physmem_get_avail_start(bank) < atop(sz)) + sz = ptoa(uvm_physmem_get_avail_end(bank) - uvm_physmem_get_avail_start(bank)); d158 1 a158 1 + end = uvm_physmem_get_end(bank); d164 1 a164 1 + uvm_physmem_unplug(end, atop(sz)); d177 1 a177 1 +++ sys/arch/alpha/alpha/pmap.c 20 Nov 2016 07:18:13 -0000 d184 2 a185 2 + avail_start = ptoa(uvm_physmem_get_avail_start(uvm_physmem_get_first())); + avail_end = ptoa(uvm_physmem_get_avail_end(uvm_physmem_get_last())); d199 1 a199 1 + uvm_physmem_t bank; d209 3 a211 3 + for (bank = uvm_physmem_get_first(); + uvm_physmem_valid(bank); + bank = uvm_physmem_get_next(bank)) { d225 2 a226 2 + if (uvm_physmem_get_avail_start(bank) != uvm_physmem_get_start(bank) || + uvm_physmem_get_avail_start(bank) >= uvm_physmem_get_avail_end(bank)) d236 1 a236 1 + if (uvm_physmem_get_avail_end(bank) - uvm_physmem_get_avail_start(bank) d261 2 a262 2 + pa = ptoa(uvm_physmem_get_start(bank)); + uvm_physmem_unplug(atop(pa), npgs); d269 5 a273 5 retrieving revision 1.230 diff -p -u -r1.230 machdep.c --- sys/arch/amd64/amd64/machdep.c 27 Aug 2016 16:17:16 -0000 1.230 +++ sys/arch/amd64/amd64/machdep.c 20 Nov 2016 07:18:13 -0000 @@@@ -783,6 +783,7 @@@@ sparse_dump_mark(void) d277 1 a277 1 + uvm_physmem_t upm; d281 1 a281 1 @@@@ -799,10 +800,25 @@@@ sparse_dump_mark(void) d287 3 a289 3 + for (upm = uvm_physmem_get_first(); + uvm_physmem_valid(upm); + upm = uvm_physmem_get_next(upm)) { d293 1 a293 1 + if (uvm_physmem_valid(upm) == false) d296 2 a297 2 + const paddr_t startpfn = uvm_physmem_get_start(upm); + const paddr_t endpfn = uvm_physmem_get_end(upm); d310 1 a310 1 @@@@ -1444,57 +1460,30 @@@@ extern vector *IDTVEC(exceptions)[]; d387 1 a387 1 @@@@ -1571,7 +1560,8 @@@@ init_x86_64(paddr_t first_avail) d392 1 a392 1 + uvm_physmem_init(); a396 11 @@@@ -1827,7 +1817,9 @@@@ cpu_reset(void) * invalid and causing a fault. */ kpreempt_disable(); - pmap_changeprot_local(idt_vaddr, VM_PROT_READ|VM_PROT_WRITE); + pmap_changeprot_local(idt_vaddr, VM_PROT_READ|VM_PROT_WRITE); + pmap_changeprot_local(idt_vaddr + PAGE_SIZE, + VM_PROT_READ|VM_PROT_WRITE); memset((void *)idt, 0, NIDT * sizeof(idt[0])); kpreempt_enable(); breakpoint(); d400 4 a403 4 retrieving revision 1.437 diff -p -u -r1.437 GENERIC --- sys/arch/amd64/conf/GENERIC 7 Aug 2016 10:44:05 -0000 1.437 +++ sys/arch/amd64/conf/GENERIC 20 Nov 2016 07:18:15 -0000 a411 16 Index: sys/arch/amiga/amiga/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/amiga/amiga/machdep.c,v retrieving revision 1.246 diff -p -u -r1.246 machdep.c --- sys/arch/amiga/amiga/machdep.c 2 Apr 2016 08:16:54 -0000 1.246 +++ sys/arch/amiga/amiga/machdep.c 20 Nov 2016 07:18:15 -0000 @@@@ -141,7 +141,7 @@@@ paddr_t msgbufpa; int machineid; int maxmem; /* max memory per process */ -extern int physmem; /* max supported memory, changes to actual */ +extern psize_t physmem; /* max supported memory, changes to actual */ extern int freebufspace; extern u_int lowram; d418 10 a427 2 +++ sys/arch/amiga/amiga/pmap_bootstrap.c 20 Nov 2016 07:18:15 -0000 @@@@ -126,7 +126,8 @@@@ pmap_bootstrap(paddr_t firstaddr, paddr_ d432 1 a432 1 + uvm_physmem_init(); d443 1 a443 1 +++ sys/arch/arc/arc/machdep.c 20 Nov 2016 07:18:19 -0000 d448 1 a448 1 +#include d457 1 a457 1 + uvm_physmem_init(); d468 1 a468 1 +++ sys/arch/arm/arm32/arm32_boot.c 20 Nov 2016 07:18:23 -0000 d473 1 a473 1 +#include d482 1 a482 1 + uvm_physmem_init(); d490 5 a494 5 retrieving revision 1.95 diff -p -u -r1.95 bus_dma.c --- sys/arch/arm/arm32/bus_dma.c 18 Jun 2016 16:51:44 -0000 1.95 +++ sys/arch/arm/arm32/bus_dma.c 20 Nov 2016 07:18:25 -0000 @@@@ -1361,11 +1361,11 @@@@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma d500 2 a501 2 + uvm_physmem_t lcv = vm_physseg_find(atop(pa), NULL); + KASSERT(uvm_physmem_valid(lcv)); d505 1 a505 1 + (arm_poolpage_vmfreelist == uvm_physmem_get_free_list(lcv)); a508 18 Index: sys/arch/arm/arm32/pmap.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm32/pmap.c,v retrieving revision 1.340 diff -p -u -r1.340 pmap.c --- sys/arch/arm/arm32/pmap.c 4 Aug 2016 08:46:06 -0000 1.340 +++ sys/arch/arm/arm32/pmap.c 20 Nov 2016 07:18:33 -0000 @@@@ -6453,8 +6453,8 @@@@ pmap_init(void) * One could argue whether this should be the entire memory or just * the memory that is useable in a user process. */ - avail_start = ptoa(VM_PHYSMEM_PTR(0)->start); - avail_end = ptoa(VM_PHYSMEM_PTR(vm_nphysseg - 1)->end); + avail_start = ptoa(uvm_physmem_get_start(uvm_physmem_get_first())); + avail_end = ptoa(uvm_physmem_get_end(uvm_physmem_get_last())); /* * Now we need to free enough pv_entry structures to allow us to get d515 10 a524 2 +++ sys/arch/arm/at91/at91bus.c 20 Nov 2016 07:18:34 -0000 @@@@ -512,6 +512,7 @@@@ at91bus_setup(BootConfig *mem) d528 1 a528 1 + uvm_physmem_init(); d538 10 a547 2 +++ sys/arch/atari/atari/pmap_bootstrap.c 20 Nov 2016 07:18:36 -0000 @@@@ -109,7 +109,8 @@@@ pmap_bootstrap(vaddr_t vstart) d552 1 a552 1 + uvm_physmem_init(); d563 1 a563 1 +++ sys/arch/cesfic/cesfic/machdep.c 20 Nov 2016 07:18:37 -0000 d568 1 a568 1 +#include d585 1 a585 1 + uvm_physmem_init(); d595 1 a595 1 +++ sys/arch/cobalt/cobalt/machdep.c 20 Nov 2016 07:18:37 -0000 d600 1 a600 1 +#include d609 1 a609 1 + uvm_physmem_init(); d620 1 a620 1 +++ sys/arch/dreamcast/dreamcast/machdep.c 20 Nov 2016 07:18:37 -0000 d625 1 a625 1 +#include d634 1 a634 1 + uvm_physmem_init(); d644 1 a644 1 +++ sys/arch/emips/emips/machdep.c 20 Nov 2016 07:18:38 -0000 d649 1 a649 1 +#include d659 10 a668 2 +++ sys/arch/epoc32/epoc32/machdep.c 20 Nov 2016 07:18:38 -0000 @@@@ -441,6 +441,7 @@@@ initarm(void *arg) d672 1 a672 1 + uvm_physmem_init(); d682 10 a691 2 +++ sys/arch/evbarm/adi_brh/brh_machdep.c 20 Nov 2016 07:18:38 -0000 @@@@ -758,6 +758,7 @@@@ initarm(void *arg) d695 1 a695 1 + uvm_physmem_init(); d705 10 a714 2 +++ sys/arch/evbarm/armadillo/armadillo9_machdep.c 20 Nov 2016 07:18:41 -0000 @@@@ -814,6 +814,7 @@@@ initarm(void *arg) d718 1 a718 1 + uvm_physmem_init(); d728 10 a737 2 +++ sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c 20 Nov 2016 07:18:43 -0000 @@@@ -829,6 +829,7 @@@@ initarm(void *arg) d741 1 a741 1 + uvm_physmem_init(); d751 10 a760 2 +++ sys/arch/evbarm/gemini/gemini_machdep.c 20 Nov 2016 07:18:45 -0000 @@@@ -708,7 +708,8 @@@@ initarm(void *arg) d765 1 a765 1 + uvm_physmem_init(); a769 15 Index: sys/arch/evbarm/hawk/hawk_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/evbarm/hawk/hawk_machdep.c,v retrieving revision 1.1 diff -p -u -r1.1 hawk_machdep.c --- sys/arch/evbarm/hawk/hawk_machdep.c 2 Oct 2013 16:48:26 -0000 1.1 +++ sys/arch/evbarm/hawk/hawk_machdep.c 20 Nov 2016 07:18:45 -0000 @@@@ -358,6 +358,7 @@@@ initarm(void *arg) */ emac_cppi_start = EMAC_CPPI_RAM_BASE; emac_cppi_end = EMAC_CPPI_RAM_BASE + EMAC_CPPI_RAM_SIZE; + uvm_page_physload(atop(emac_cppi_start), atop(emac_cppi_end), atop(emac_cppi_start), atop(emac_cppi_end), VM_FREELIST_ISADMA); d776 10 a785 2 +++ sys/arch/evbarm/hdl_g/hdlg_machdep.c 20 Nov 2016 07:18:49 -0000 @@@@ -596,6 +596,7 @@@@ initarm(void *arg) d789 1 a789 1 + uvm_physmem_init(); d799 10 a808 2 +++ sys/arch/evbarm/imx31/imx31lk_machdep.c 20 Nov 2016 07:18:52 -0000 @@@@ -693,6 +693,7 @@@@ printf("%s: textsize %#lx, totalsize %#l d812 1 a812 1 + uvm_physmem_init(); d822 10 a831 2 +++ sys/arch/evbarm/iq80310/iq80310_machdep.c 20 Nov 2016 07:18:58 -0000 @@@@ -718,6 +718,7 @@@@ initarm(void *arg) d835 1 a835 1 + uvm_physmem_init(); d845 10 a854 2 +++ sys/arch/evbarm/iq80321/iq80321_machdep.c 20 Nov 2016 07:19:02 -0000 @@@@ -743,6 +743,7 @@@@ initarm(void *arg) d858 1 a858 1 + uvm_physmem_init(); d868 10 a877 2 +++ sys/arch/evbarm/ixdp425/ixdp425_machdep.c 20 Nov 2016 07:19:02 -0000 @@@@ -710,6 +710,7 @@@@ initarm(void *arg) d881 1 a881 1 + uvm_physmem_init(); d891 10 a900 2 +++ sys/arch/evbarm/ixm1200/ixm1200_machdep.c 20 Nov 2016 07:19:04 -0000 @@@@ -677,6 +677,7 @@@@ initarm(void *arg) d904 1 a904 1 + uvm_physmem_init(); d914 1 a914 1 +++ sys/arch/evbarm/lubbock/lubbock_machdep.c 20 Nov 2016 07:19:06 -0000 d919 1 a919 1 + uvm_physmem_init(); d929 10 a938 2 +++ sys/arch/evbarm/mini2440/mini2440_machdep.c 20 Nov 2016 07:19:07 -0000 @@@@ -887,6 +887,7 @@@@ initarm(void *arg) d942 1 a942 1 + uvm_physmem_init(); d952 10 a961 2 +++ sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c 20 Nov 2016 07:19:08 -0000 @@@@ -713,6 +713,7 @@@@ initarm(void *arg) d965 1 a965 1 + uvm_physmem_init(); d975 10 a984 2 +++ sys/arch/evbarm/nslu2/nslu2_machdep.c 20 Nov 2016 07:19:09 -0000 @@@@ -778,6 +778,7 @@@@ initarm(void *arg) d988 1 a988 1 + uvm_physmem_init(); d998 10 a1007 2 +++ sys/arch/evbarm/osk5912/osk5912_machdep.c 20 Nov 2016 07:19:09 -0000 @@@@ -448,6 +448,7 @@@@ initarm(void *arg) d1011 1 a1011 1 + uvm_physmem_init(); d1021 10 a1030 2 +++ sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c 20 Nov 2016 07:19:09 -0000 @@@@ -845,6 +845,7 @@@@ initarm(void *arg) d1034 1 a1034 1 + uvm_physmem_init(); d1044 10 a1053 2 +++ sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c 20 Nov 2016 07:19:10 -0000 @@@@ -762,6 +762,7 @@@@ initarm(void *arg) d1057 1 a1057 1 + uvm_physmem_init(); d1067 10 a1076 2 +++ sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c 20 Nov 2016 07:19:11 -0000 @@@@ -542,6 +542,7 @@@@ initarm(void *arg) d1080 1 a1080 1 + uvm_physmem_init(); d1090 10 a1099 2 +++ sys/arch/evbarm/tsarm/tsarm_machdep.c 20 Nov 2016 07:19:11 -0000 @@@@ -727,6 +727,7 @@@@ initarm(void *arg) d1103 1 a1103 1 + uvm_physmem_init(); d1113 10 a1122 2 +++ sys/arch/evbarm/viper/viper_machdep.c 20 Nov 2016 07:19:12 -0000 @@@@ -747,6 +747,7 @@@@ initarm(void *arg) d1126 1 a1126 1 + uvm_physmem_init(); d1136 10 a1145 2 +++ sys/arch/evbsh3/evbsh3/machdep.c 20 Nov 2016 07:19:13 -0000 @@@@ -303,6 +303,7 @@@@ initSH3(void *pc) /* XXX return address d1149 1 a1149 1 + uvm_physmem_init(); d1159 10 a1168 2 +++ sys/arch/ews4800mips/ews4800mips/machdep.c 20 Nov 2016 07:19:13 -0000 @@@@ -111,7 +111,8 @@@@ mach_init(int argc, char *argv[], struct d1173 1 a1173 1 + uvm_physmem_init(); d1184 10 a1193 2 +++ sys/arch/hp300/hp300/machdep.c 20 Nov 2016 07:19:14 -0000 @@@@ -197,6 +197,7 @@@@ hp300_init(void) d1197 1 a1197 1 + uvm_physmem_init(); d1207 10 a1216 2 +++ sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c 20 Nov 2016 07:19:15 -0000 @@@@ -609,6 +609,7 @@@@ init_pxa2x0(int argc, char **argv, struc d1220 1 a1220 1 + uvm_physmem_init(); d1230 10 a1239 2 +++ sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c 20 Nov 2016 07:19:15 -0000 @@@@ -538,6 +538,7 @@@@ init_sa11x0(int argc, char **argv, struc d1243 1 a1243 1 + uvm_physmem_init(); d1253 10 a1262 2 +++ sys/arch/hpcsh/hpcsh/machdep.c 20 Nov 2016 07:19:16 -0000 @@@@ -281,6 +281,7 @@@@ machine_startup(int argc, char *argv[], d1266 1 a1266 1 + uvm_physmem_init(); d1276 10 a1285 2 +++ sys/arch/hppa/hppa/pmap.c 20 Nov 2016 07:19:17 -0000 @@@@ -676,7 +676,8 @@@@ pmap_bootstrap(vaddr_t vstart) d1290 1 a1290 1 + uvm_physmem_init(); a1294 94 Index: sys/arch/i386/i386/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/i386/i386/machdep.c,v retrieving revision 1.762 diff -p -u -r1.762 machdep.c --- sys/arch/i386/i386/machdep.c 25 Sep 2016 12:59:19 -0000 1.762 +++ sys/arch/i386/i386/machdep.c 20 Nov 2016 07:19:17 -0000 @@@@ -1031,57 +1031,30 @@@@ initgdt(union descriptor *tgdt) static void init386_msgbuf(void) { - /* Message buffer is located at end of core. */ - struct vm_physseg *vps; - psize_t sz = round_page(MSGBUFSIZE); - psize_t reqsz = sz; - unsigned int x; - - search_again: - vps = NULL; - for (x = 0; x < vm_nphysseg; ++x) { - vps = VM_PHYSMEM_PTR(x); - if (ctob(vps->avail_end) == avail_end) { - break; - } - } - if (x == vm_nphysseg) - panic("init386: can't find end of memory"); + /* Message buffer is located at end of core. */ + psize_t reqsz = round_page(MSGBUFSIZE); + psize_t sz = 0; - /* Shrink so it'll fit in the last segment. */ - if (vps->avail_end - vps->avail_start < atop(sz)) - sz = ctob(vps->avail_end - vps->avail_start); - - vps->avail_end -= atop(sz); - vps->end -= atop(sz); - msgbuf_p_seg[msgbuf_p_cnt].sz = sz; - msgbuf_p_seg[msgbuf_p_cnt++].paddr = ctob(vps->avail_end); - - /* Remove the last segment if it now has no pages. */ - if (vps->start == vps->end) { - for (--vm_nphysseg; x < vm_nphysseg; x++) - VM_PHYSMEM_PTR_SWAP(x, x + 1); - } - - /* Now find where the new avail_end is. */ - for (avail_end = 0, x = 0; x < vm_nphysseg; x++) - if (VM_PHYSMEM_PTR(x)->avail_end > avail_end) - avail_end = VM_PHYSMEM_PTR(x)->avail_end; - avail_end = ctob(avail_end); + for (sz = 0; sz < reqsz; sz += PAGE_SIZE) { + paddr_t stolenpa; - if (sz == reqsz) - return; + if (!uvm_page_physget(&stolenpa)) + break; - reqsz -= sz; - if (msgbuf_p_cnt == VM_PHYSSEG_MAX) { - /* No more segments available, bail out. */ - printf("WARNING: MSGBUFSIZE (%zu) too large, using %zu.\n", - (size_t)MSGBUFSIZE, (size_t)(MSGBUFSIZE - reqsz)); - return; + if (stolenpa == (msgbuf_p_seg[msgbuf_p_cnt].paddr + + PAGE_SIZE)) { + /* contiguous: append it to current buf alloc */ + msgbuf_p_seg[msgbuf_p_cnt].sz += PAGE_SIZE; + } else { + /* non-contiguous: start a new msgbuf seg */ + msgbuf_p_seg[msgbuf_p_cnt].sz = PAGE_SIZE; + msgbuf_p_seg[msgbuf_p_cnt++].paddr = stolenpa; + } } - sz = reqsz; - goto search_again; + if (sz != reqsz) + printf("%s: could only allocate %ld bytes of requested %ld bytes\n", + __func__, sz, reqsz); } #ifndef XEN @@@@ -1183,7 +1156,8 @@@@ init386(paddr_t first_avail) * Initialize PAGE_SIZE-dependent variables. */ uvm_setpagesize(); - + uvm_physmem_init(); + /* * Start with 2 color bins -- this is just a guess to get us * started. We'll recolor when we determine the largest cache d1301 10 a1310 2 +++ sys/arch/ia64/ia64/machdep.c 20 Nov 2016 07:19:18 -0000 @@@@ -175,18 +175,19 @@@@ cpu_startup(void) d1317 1 a1317 1 + uvm_physmem_t lcv; d1325 5 a1329 5 + for (vm_nphysseg = 0, lcv = uvm_physmem_get_first(); + uvm_physmem_valid(lcv); + vm_nphysseg++, lcv = uvm_physmem_get_next(lcv)) { + sizetmp = uvm_physmem_get_avail_end(lcv) - + uvm_physmem_get_avail_start(lcv); d1334 2 a1335 2 + ptoa(uvm_physmem_get_avail_start(lcv)), + ptoa(uvm_physmem_get_avail_end(lcv)) - 1, d1339 1 a1339 1 @@@@ -466,7 +467,8 @@@@ ia64_init(void) d1344 1 a1344 1 + uvm_physmem_init(); d1355 10 a1364 2 +++ sys/arch/ia64/ia64/pmap.c 20 Nov 2016 07:19:19 -0000 @@@@ -316,47 +316,33 @@@@ pmap_steal_vhpt_memory(vsize_t); d1370 1 a1370 1 + uvm_physmem_t upm; d1378 3 a1380 3 + for (upm = uvm_physmem_get_first(); + uvm_physmem_valid(upm); + upm = uvm_physmem_get_next(upm)) { d1386 2 a1387 2 + if (uvm_physmem_get_avail_start(upm) != uvm_physmem_get_start(upm) || + uvm_physmem_get_avail_start(upm) >= uvm_physmem_get_avail_end(upm)) d1391 1 a1391 1 + if ((uvm_physmem_get_avail_end(upm) - uvm_physmem_get_avail_start(upm)) d1417 2 a1418 2 + pa = ptoa(uvm_physmem_get_start(bank)); + uvm_physmem_unplug(atop(pa), npgs); d1422 1 a1422 1 @@@@ -380,31 +366,34 @@@@ pmap_steal_memory(vsize_t size, vaddr_t d1428 1 a1428 1 + uvm_physmem_t upm; d1438 3 a1440 3 + for (upm = uvm_physmem_get_first(); + uvm_physmem_valid(upm); + upm = uvm_physmem_get_next(upm)) { d1446 2 a1447 2 + if (uvm_physmem_get_avail_start(upm) != uvm_physmem_get_start(upm) || /* XXX: ??? */ + uvm_physmem_get_avail_start(upm) >= uvm_physmem_get_avail_end(upm)) d1453 1 a1453 1 + start1 = uvm_physmem_get_avail_start(upm); d1460 1 a1460 1 + end2 = uvm_physmem_get_avail_end(upm); d1464 1 a1464 1 @@@@ -423,7 +412,7 @@@@ pmap_steal_vhpt_memory(vsize_t size) d1469 1 a1469 1 + uvm_physmem_get_first() == uvm_physmem_get_last() /* single segment */) { d1473 1 a1473 1 @@@@ -431,11 +420,13 @@@@ pmap_steal_vhpt_memory(vsize_t size) d1482 5 a1486 5 + if (uvm_physmem_unplug(uvm_physmem_get_start(upm), + uvm_physmem_get_end(upm) - uvm_physmem_get_start(upm)) == false) { + panic("%s: uvm_physmem_unplug(%"PRIxPADDR", %"PRIxPADDR") failed\n", + __func__, uvm_physmem_get_start(upm), + uvm_physmem_get_end(upm) - uvm_physmem_get_start(upm)); d1498 1 a1498 1 +++ sys/arch/iyonix/iyonix/iyonix_machdep.c 20 Nov 2016 07:19:19 -0000 d1503 1 a1503 1 +#include d1511 1 a1511 1 + uvm_physmem_init(); d1521 1 a1521 1 +++ sys/arch/landisk/landisk/machdep.c 20 Nov 2016 07:19:19 -0000 d1526 1 a1526 1 +#include d1534 1 a1534 1 + uvm_physmem_init(); d1544 1 a1544 1 +++ sys/arch/luna68k/luna68k/machdep.c 20 Nov 2016 07:19:21 -0000 d1549 1 a1549 1 +#include d1557 1 a1557 1 + uvm_physmem_init(); d1567 1 a1567 1 +++ sys/arch/luna68k/luna68k/pmap_bootstrap.c 20 Nov 2016 07:19:21 -0000 d1584 10 a1593 2 +++ sys/arch/m68k/m68k/pmap_motorola.c 20 Nov 2016 07:19:22 -0000 @@@@ -295,10 +295,11 @@@@ struct pool pmap_pv_pool; /* memory pool d1599 3 a1601 1 + uvm_physmem_t bank = 0; /* XXX gcc4 -Wuninitialized */ d1604 2 a1605 3 bank = vm_physseg_find(atop((pa)), &pg); - return &VM_PHYSMEM_PTR(bank)->pmseg.pvheader[pg]; + return &uvm_physmem_get_pmseg(bank)->pvheader[pg]; d1609 1 a1609 1 @@@@ -412,7 +413,7 @@@@ pmap_init(void) d1614 1 a1614 1 + uvm_physmem_t bank; d1618 1 a1618 1 @@@@ -434,8 +435,10 @@@@ pmap_init(void) d1624 4 a1627 4 + for (page_cnt = 0, bank = uvm_physmem_get_first(); + uvm_physmem_valid(bank); + bank = uvm_physmem_get_next(bank)) + page_cnt += uvm_physmem_get_end(bank) - uvm_physmem_get_start(bank); d1631 1 a1631 1 @@@@ -461,9 +464,11 @@@@ pmap_init(void) d1638 5 a1642 5 + for (bank = uvm_physmem_get_first(); + uvm_physmem_valid(bank); + bank = uvm_physmem_get_next(bank)) { + npages = uvm_physmem_get_end(bank) - uvm_physmem_get_start(bank); + uvm_physmem_get_pmseg(bank)->pvheader = pvh; d1646 1 a1646 1 @@@@ -1704,17 +1709,20 @@@@ pmap_collect1(pmap_t pmap, paddr_t start d1653 1 a1653 1 + uvm_physmem_t bank; d1664 5 a1668 5 + for (bank = uvm_physmem_get_first(); + uvm_physmem_valid(bank); + bank = uvm_physmem_get_next(bank)) { + pmap_collect1(pmap_kernel(), ptoa(uvm_physmem_get_start(bank)), + ptoa(uvm_physmem_get_end(bank))); d1678 1 a1678 1 +++ sys/arch/mac68k/mac68k/machdep.c 20 Nov 2016 07:19:24 -0000 d1683 1 a1683 1 +#include d1691 1 a1691 1 + uvm_physmem_init(); d1701 1 a1701 1 +++ sys/arch/mips/include/pmap.h 20 Nov 2016 07:19:25 -0000 d1707 1 a1707 1 +#include d1716 1 a1716 1 +bool pmap_md_ok_to_steal_p(const uvm_physmem_t, size_t); a1719 8 @@@@ -164,6 +164,7 @@@@ struct tlbmask { #include #include + #ifdef _KERNEL /* * Select CCA to use for unmanaged pages. d1726 10 a1735 2 +++ sys/arch/mips/mips/mips_machdep.c 20 Nov 2016 07:19:28 -0000 @@@@ -2008,38 +2008,34 @@@@ mips_init_msgbuf(void) d1741 1 a1741 1 + uvm_physmem_t bank = uvm_physmem_get_last(); d1748 2 a1749 2 + for (; uvm_physmem_valid(bank); bank = uvm_physmem_get_prev(bank)) { + if (uvm_physmem_get_avail_start(bank) + atop(sz) <= atop(MIPS_PHYS_MASK)) d1754 2 a1755 2 + paddr_t start = uvm_physmem_get_start(bank); + paddr_t end = uvm_physmem_get_end(bank); d1766 1 a1766 1 + uvm_physmem_unplug(end, atop(sz)); d1793 10 a1802 2 +++ sys/arch/mips/mips/pmap_machdep.c 20 Nov 2016 07:19:29 -0000 @@@@ -306,12 +306,12 @@@@ pmap_md_vca_page_wbinv(struct vm_page *p d1807 1 a1807 1 +pmap_md_ok_to_steal_p(const uvm_physmem_t bank, size_t npgs) d1813 1 a1813 1 + if (uvm_physmem_get_avail_start(bank) + npgs >= atop(MIPS_PHYS_MASK + 1)) { d1819 1 a1819 1 @@@@ -393,8 +393,8 @@@@ pmap_bootstrap(void) d1825 2 a1826 2 + pmap_limits.avail_start = ptoa(uvm_physmem_get_start(uvm_physmem_get_first())); + pmap_limits.avail_end = ptoa(uvm_physmem_get_end(uvm_physmem_get_last())); d1836 1 a1836 1 +++ sys/arch/mipsco/mipsco/machdep.c 20 Nov 2016 07:19:30 -0000 d1841 1 a1841 1 +#include d1850 1 a1850 1 + uvm_physmem_init(); d1861 1 a1861 1 +++ sys/arch/mmeye/mmeye/machdep.c 20 Nov 2016 07:19:30 -0000 d1866 1 a1866 1 +#include d1874 1 a1874 1 + uvm_physmem_init(); d1884 10 a1893 2 +++ sys/arch/mvme68k/mvme68k/machdep.c 20 Nov 2016 07:19:31 -0000 @@@@ -218,6 +218,7 @@@@ mvme68k_init(void) d1897 1 a1897 1 + uvm_physmem_init(); d1907 1 a1907 1 +++ sys/arch/netwinder/netwinder/netwinder_machdep.c 20 Nov 2016 07:19:31 -0000 d1912 1 a1912 1 +#include d1930 1 a1930 1 + uvm_physmem_init(); d1940 1 a1940 1 +++ sys/arch/news68k/news68k/machdep.c 20 Nov 2016 07:19:32 -0000 d1945 1 a1945 1 +#include d1953 1 a1953 1 + uvm_physmem_init(); a1956 17 Index: sys/arch/news68k/news68k/pmap_bootstrap.c =================================================================== RCS file: /cvsroot/src/sys/arch/news68k/news68k/pmap_bootstrap.c,v retrieving revision 1.40 diff -p -u -r1.40 pmap_bootstrap.c --- sys/arch/news68k/news68k/pmap_bootstrap.c 10 Feb 2012 06:28:39 -0000 1.40 +++ sys/arch/news68k/news68k/pmap_bootstrap.c 20 Nov 2016 07:19:32 -0000 @@@@ -56,7 +56,8 @@@@ extern char *etext; extern char *extiobase; extern char *cache_ctl, *cache_clr; -extern int maxmem, physmem; +extern int maxmem; +extern psize_t physmem; extern paddr_t avail_start, avail_end; /* d1963 1 a1963 1 +++ sys/arch/newsmips/newsmips/machdep.c 20 Nov 2016 07:19:32 -0000 d1968 1 a1968 1 +#include d1977 1 a1977 1 + uvm_physmem_init(); d1988 1 a1988 1 +++ sys/arch/next68k/next68k/machdep.c 20 Nov 2016 07:19:32 -0000 d1993 1 a1993 1 +#include d2001 1 a2001 1 + uvm_physmem_init(); a2004 17 Index: sys/arch/next68k/next68k/pmap_bootstrap.c =================================================================== RCS file: /cvsroot/src/sys/arch/next68k/next68k/pmap_bootstrap.c,v retrieving revision 1.43 diff -p -u -r1.43 pmap_bootstrap.c --- sys/arch/next68k/next68k/pmap_bootstrap.c 5 Jan 2014 06:30:48 -0000 1.43 +++ sys/arch/next68k/next68k/pmap_bootstrap.c 20 Nov 2016 07:19:32 -0000 @@@@ -65,7 +65,8 @@@@ __KERNEL_RCSID(0, "$NetBSD: pmap_bootstr extern char *etext; -extern int maxmem, physmem; +extern int maxmem; +extern psize_t physmem; extern paddr_t avail_start, avail_end; extern phys_ram_seg_t mem_clusters[]; extern int mem_cluster_cnt; d2011 10 a2020 2 +++ sys/arch/playstation2/playstation2/machdep.c 20 Nov 2016 07:19:33 -0000 @@@@ -115,6 +115,8 @@@@ mach_init(void) d2024 1 a2024 1 + uvm_physmem_init(); a2028 17 Index: sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c,v retrieving revision 1.18 diff -p -u -r1.18 ibm4xx_machdep.c --- sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c 12 Dec 2011 11:38:26 -0000 1.18 +++ sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c 20 Nov 2016 07:19:33 -0000 @@@@ -226,7 +226,8 @@@@ ibm4xx_init(vaddr_t startkernel, vaddr_t consinit(); uvm_setpagesize(); - + uvm_physmem_init(); + /* * Initialize pmap module. */ d2035 28 a2062 2 +++ sys/arch/powerpc/ibm4xx/pmap.c 20 Nov 2016 07:19:34 -0000 @@@@ -295,7 +295,8 @@@@ pmap_bootstrap(u_int kernelstart, u_int d2067 1 a2067 1 + uvm_physmem_init(); a2071 54 Index: sys/arch/powerpc/isa/isadma_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/powerpc/isa/isadma_machdep.c,v retrieving revision 1.10 diff -p -u -r1.10 isadma_machdep.c --- sys/arch/powerpc/isa/isadma_machdep.c 26 Feb 2016 18:17:39 -0000 1.10 +++ sys/arch/powerpc/isa/isadma_machdep.c 20 Nov 2016 07:19:34 -0000 @@@@ -168,9 +168,11 @@@@ _isa_bus_dmamap_create(bus_dma_tag_t t, size_t cookiesize; paddr_t avail_end = 0; - for (bank = 0; bank < vm_nphysseg; bank++) { - if (avail_end < VM_PHYSMEM_PTR(bank)->avail_end << PGSHIFT) - avail_end = VM_PHYSMEM_PTR(bank)->avail_end << PGSHIFT; + for (bank = uvm_physmem_get_first(); + uvm_physmem_valid(bank); + bank = uvm_physmem_get_next(bank)) { + if (avail_end < uvm_physmem_get_avail_end(bank) << PGSHIFT) + avail_end = uvm_physmem_get_avail_end(bank) << PGSHIFT; } /* Call common function to create the basic map. */ @@@@ -598,9 +600,11 @@@@ _isa_bus_dmamem_alloc(bus_dma_tag_t t, b paddr_t high, avail_end = 0; int bank; - for (bank = 0; bank < vm_nphysseg; bank++) { - if (avail_end < VM_PHYSMEM_PTR(bank)->avail_end << PGSHIFT) - avail_end = VM_PHYSMEM_PTR(bank)->avail_end << PGSHIFT; + for (bank = uvm_physmem_get_first(); + uvm_physmem_valid(bank); + bank = uvm_physmem_get_next(bank)) { + if (avail_end < uvm_physmem_get_avail_end(bank) << PGSHIFT) + avail_end = uvm_physmem_get_avail_end(bank) << PGSHIFT; } if (avail_end > ISA_DMA_BOUNCE_THRESHOLD) Index: sys/arch/powerpc/oea/ofwoea_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/powerpc/oea/ofwoea_machdep.c,v retrieving revision 1.38 diff -p -u -r1.38 ofwoea_machdep.c --- sys/arch/powerpc/oea/ofwoea_machdep.c 25 Mar 2014 16:41:37 -0000 1.38 +++ sys/arch/powerpc/oea/ofwoea_machdep.c 20 Nov 2016 07:19:34 -0000 @@@@ -233,7 +233,8 @@@@ ofwoea_initppc(u_int startkernel, u_int } uvm_setpagesize(); - + uvm_physmem_init(); + pmap_bootstrap(startkernel, endkernel); /* as far as I can tell, the pmap_setup_seg0 stuff is horribly broken */ d2078 1 a2078 1 +++ sys/arch/powerpc/oea/pmap.c 20 Nov 2016 07:19:36 -0000 d2083 1 a2083 1 +#include d2096 1 a2096 1 + uvm_physmem_t bank; d2110 3 a2112 3 + for (bank = uvm_physmem_get_first(); + uvm_physmem_valid(bank); + bank = uvm_physmem_get_next(bank)) { d2114 3 a2116 3 + freelist = uvm_physmem_get_free_list(bank); + start = uvm_physmem_get_start(bank); + end = uvm_physmem_get_end(bank); d2141 1 a2141 1 + uvm_physmem_unplug(start, npgs); d2157 4 a2160 4 + for (bank = uvm_physmem_get_first(); + uvm_physmem_valid(bank); + bank = uvm_physmem_get_next(bank)) { + cnt += uvm_physmem_get_avail_end(bank) - uvm_physmem_get_avail_start(bank); d2169 1 a2169 1 + uvm_physmem_t bank; d2173 5 a2177 5 + for (cnt = 0, bank = uvm_physmem_get_first(); + uvm_physmem_valid(bank); + bank = uvm_physmem_get_next(bank)) { + cnt += uvm_physmem_get_avail_end(bank) - + uvm_physmem_get_avail_start(bank); d2183 3 a2185 3 + ptoa(uvm_physmem_get_avail_start(bank)), + ptoa(uvm_physmem_get_avail_end(bank)), + ptoa(uvm_physmem_get_avail_end(bank) - uvm_physmem_get_avail_start(bank))); a2188 17 Index: sys/arch/powerpc/oea/prep_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/powerpc/oea/prep_machdep.c,v retrieving revision 1.10 diff -p -u -r1.10 prep_machdep.c --- sys/arch/powerpc/oea/prep_machdep.c 11 Feb 2012 13:53:59 -0000 1.10 +++ sys/arch/powerpc/oea/prep_machdep.c 20 Nov 2016 07:19:36 -0000 @@@@ -164,7 +164,8 @@@@ prep_initppc(u_long startkernel, u_long /* Set the page size */ uvm_setpagesize(); - + uvm_physmem_init(); + /* Initialize pmap module */ pmap_bootstrap(startkernel, endkernel); d2195 10 a2204 2 +++ sys/arch/powerpc/powerpc/bus_dma.c 20 Nov 2016 07:19:36 -0000 @@@@ -544,13 +544,15 @@@@ int d2209 1 a2209 1 + uvm_physmem_t bank; d2216 7 a2222 7 + for (bank = uvm_physmem_get_first(); + uvm_physmem_valid(bank); + bank = uvm_physmem_get_next(bank)) { + if (start > ptoa(uvm_physmem_get_avail_start(bank))) + start = ptoa(uvm_physmem_get_avail_start(bank)); + if (end < ptoa(uvm_physmem_get_avail_end(bank))) + end = ptoa(uvm_physmem_get_avail_end(bank)); d2232 1 a2232 1 +++ sys/arch/sh3/sh3/pmap.c 20 Nov 2016 07:19:41 -0000 d2237 1 a2237 1 +#include d2247 2 a2248 2 + avail_start = ptoa(uvm_physmem_get_start(uvm_physmem_get_first())); + avail_end = ptoa(uvm_physmem_get_end(uvm_physmem_get_last())); d2261 1 a2261 1 + uvm_physmem_t bank; d2272 4 a2275 4 + for (bank = uvm_physmem_get_first(); + uvm_physmem_valid(bank); + bank = uvm_physmem_get_next(bank)) { + if (npage <= uvm_physmem_get_end(bank) - uvm_physmem_get_start(bank)) d2294 1 a2294 1 + KDASSERT(uvm_physmem_valid(bank)); d2297 2 a2298 2 + pa = ptoa(uvm_physmem_get_start(bank)); + uvm_physmem_unplug(start, npage); d2308 1 a2308 1 +++ sys/arch/sh3/sh3/vm_machdep.c 20 Nov 2016 07:19:41 -0000 d2313 1 a2313 1 +#include d2322 1 a2322 1 + if (atop(pa) < uvm_physmem_get_start(uvm_physmem_get_first()) || PHYS_TO_VM_PAGE(pa) != NULL) { d2332 10 a2341 2 +++ sys/arch/shark/ofw/ofw.c 20 Nov 2016 07:19:42 -0000 @@@@ -873,7 +873,8 @@@@ ofw_configmem(void) d2346 1 a2346 1 + uvm_physmem_init(); d2357 10 a2366 2 +++ sys/arch/sparc/sparc/pmap.c 20 Nov 2016 07:19:46 -0000 @@@@ -3036,7 +3036,8 @@@@ pmap_bootstrap(int nctx, int nregion, in d2371 1 a2371 1 + uvm_physmem_init(); d2379 13 a2391 5 retrieving revision 1.303 diff -p -u -r1.303 pmap.c --- sys/arch/sparc64/sparc64/pmap.c 7 Jul 2016 06:55:38 -0000 1.303 +++ sys/arch/sparc64/sparc64/pmap.c 20 Nov 2016 07:19:49 -0000 @@@@ -778,7 +778,8 @@@@ pmap_bootstrap(u_long kernelstart, u_lon d2396 1 a2396 1 + uvm_physmem_init(); d2407 10 a2416 2 +++ sys/arch/sun2/sun2/pmap.c 20 Nov 2016 07:19:50 -0000 @@@@ -1701,7 +1701,8 @@@@ pmap_bootstrap(vaddr_t nextva) d2421 1 a2421 1 + uvm_physmem_init(); d2432 10 a2441 2 +++ sys/arch/sun3/sun3/pmap.c 20 Nov 2016 07:19:51 -0000 @@@@ -1731,7 +1731,8 @@@@ pmap_bootstrap(vaddr_t nextva) d2446 1 a2446 1 + uvm_physmem_init(); d2457 10 a2466 2 +++ sys/arch/sun3/sun3x/pmap.c 20 Nov 2016 07:19:52 -0000 @@@@ -894,7 +894,8 @@@@ pmap_bootstrap(vaddr_t nextva) d2471 1 a2471 1 + uvm_physmem_init(); d2482 10 a2491 2 +++ sys/arch/usermode/usermode/pmap.c 20 Nov 2016 07:19:53 -0000 @@@@ -409,6 +409,8 @@@@ pmap_bootstrap(void) d2495 1 a2495 1 + uvm_physmem_init(); d2506 1 a2506 1 +++ sys/arch/vax/vax/ka650.c 20 Nov 2016 07:19:53 -0000 d2522 10 a2531 2 +++ sys/arch/vax/vax/pmap.c 20 Nov 2016 07:19:54 -0000 @@@@ -446,6 +446,7 @@@@ pmap_bootstrap(void) d2535 1 a2535 1 + uvm_physmem_init(); d2539 1 a2539 1 @@@@ -475,7 +476,8 @@@@ pmap_steal_memory(vsize_t size, vaddr_t d2544 1 a2544 1 + uvm_physmem_t bank; d2549 1 a2549 1 @@@@ -490,10 +492,10 @@@@ pmap_steal_memory(vsize_t size, vaddr_t d2553 1 a2553 1 + bank = uvm_physmem_get_first(); d2558 2 a2559 2 + v = (uvm_physmem_get_start(bank) << PGSHIFT) | KERNBASE; + uvm_physmem_unplug(uvm_physmem_get_start(bank), npgs); d2566 13 a2578 5 retrieving revision 1.193 diff -p -u -r1.193 machdep.c --- sys/arch/x68k/x68k/machdep.c 14 Jun 2016 07:51:10 -0000 1.193 +++ sys/arch/x68k/x68k/machdep.c 20 Nov 2016 07:19:54 -0000 @@@@ -184,6 +184,8 @@@@ x68k_init(void) d2582 1 a2582 1 + uvm_physmem_init(); d2587 1 a2587 1 @@@@ -553,7 +555,7 @@@@ cpu_init_kcore_hdr(void) d2591 5 a2595 2 - int i; + uvm_physmem_t i; d2599 3 a2601 1 @@@@ -604,11 +606,22 @@@@ cpu_init_kcore_hdr(void) d2603 14 a2616 7 m->ram_segs[0].start = lowram; m->ram_segs[0].size = mem_size - lowram; - for (i = 1; i < vm_nphysseg; i++) { - m->ram_segs[i].start = - ctob(VM_PHYSMEM_PTR(i)->start); - m->ram_segs[i].size = - ctob(VM_PHYSMEM_PTR(i)->end - VM_PHYSMEM_PTR(i)->start); d2618 1 a2618 1 + i = uvm_physmem_get_first(); d2620 2 a2621 2 + for (uvm_physmem_get_next(i); uvm_physmem_valid(i); i = uvm_physmem_get_next(i)) { + if (uvm_physmem_valid(i) == false) d2624 2 a2625 2 + const paddr_t startpfn = uvm_physmem_get_start(i); + const paddr_t endpfn = uvm_physmem_get_end(i); d2634 1 d2637 2 a2638 1 @@@@ -1240,11 +1253,14 @@@@ cpu_intr_p(void) d2643 1 a2643 1 + uvm_physmem_t i; d2645 2 a2646 2 + for (i = uvm_physmem_get_first(); uvm_physmem_valid(i); i = uvm_physmem_get_next(i)) { + if (uvm_physmem_valid(i) == false) d2652 2 a2653 2 + if (ctob(uvm_physmem_get_start(i)) <= pa && + pa < ctob(uvm_physmem_get_end(i))) d2663 1 a2663 1 +++ sys/arch/x68k/x68k/pmap_bootstrap.c 20 Nov 2016 07:19:54 -0000 d2677 4 a2680 4 retrieving revision 1.75 diff -p -u -r1.75 x86_machdep.c --- sys/arch/x86/x86/x86_machdep.c 1 Aug 2016 16:07:39 -0000 1.75 +++ sys/arch/x86/x86/x86_machdep.c 20 Nov 2016 07:19:54 -0000 d2685 1 a2685 1 +#include d2695 1 a2695 1 +++ sys/arch/xen/xen/balloon.c 20 Nov 2016 07:19:55 -0000 d2711 1 a2711 1 +#include d2750 1 a2750 1 + if (uvm_physmem_plug(atop(pa), 1, NULL) == false) { d2783 10 a2792 2 +++ sys/arch/zaurus/zaurus/machdep.c 20 Nov 2016 07:19:55 -0000 @@@@ -1091,6 +1091,7 @@@@ initarm(void *arg) d2796 1 a2796 1 + uvm_physmem_init(); @ 1.7 log @Some of the changes that Chuck suggested. @ text @a0 85 ? sys/arch/amd64/conf/kern.ldscript.2MB ? sys/arch/amd64/conf/largepages.inc ? sys/arch/amiga/dev/grfws.h ? sys/arch/arm/nvidia/tegra_car.c ? sys/arch/arm/nvidia/tegra_carreg.h ? sys/arch/arm/nvidia/tegra_dc.c ? sys/arch/arm/nvidia/tegra_ehcireg.h ? sys/arch/arm/nvidia/tegra_genfb.c ? sys/arch/arm/nvidia/tegra_hdmi.c ? sys/arch/arm/nvidia/tegra_host1x.c ? sys/arch/arm/nvidia/tegra_io.c ? sys/arch/arm/samsung/exynos4_loc.c ? sys/arch/arm/samsung/exynos4_reg.h ? sys/arch/arm/samsung/exynos5_loc.c ? sys/arch/arm/samsung/exynos_dma.c ? sys/arch/arm/samsung/exynos_io.c ? sys/arch/arm/samsung/exynos_io.h ? sys/arch/arm/samsung/exynos_space.c ? sys/arch/arm/samsung/exynos_usb.c ? sys/arch/bebox/stand/boot/bebox ? sys/arch/bebox/stand/boot/machine ? sys/arch/bebox/stand/boot/powerpc ? sys/arch/bebox/stand/boot_com0/bebox ? sys/arch/bebox/stand/boot_com0/machine ? sys/arch/bebox/stand/boot_com0/powerpc ? sys/arch/bebox/stand/boot_vga/bebox ? sys/arch/bebox/stand/boot_vga/machine ? sys/arch/bebox/stand/boot_vga/powerpc ? sys/arch/bebox/stand/common/bebox ? sys/arch/bebox/stand/common/machine ? sys/arch/bebox/stand/common/powerpc ? sys/arch/evbarm/odroid ? sys/arch/evbarm/conf/JETSONTK1 ? sys/arch/evbarm/conf/JETSONTK1_INSTALL ? sys/arch/evbarm/conf/NYAN-BIG ? sys/arch/evbarm/conf/files.odroid ? sys/arch/evbarm/conf/mk.odroid ? sys/arch/evbarm/conf/std.odroid ? sys/arch/evbarm/stand/boot2440/arm ? sys/arch/evbarm/stand/boot2440/evbarm ? sys/arch/evbarm/stand/boot2440/machine ? sys/arch/evbarm/stand/bootimx23/arm ? sys/arch/evbarm/stand/bootimx23/evbarm ? sys/arch/evbarm/stand/bootimx23/machine ? sys/arch/evbarm/stand/gzboot/ADI_BRH_flash_0x00140000/arm ? sys/arch/evbarm/stand/gzboot/ADI_BRH_flash_0x00140000/evbarm ? sys/arch/evbarm/stand/gzboot/ADI_BRH_flash_0x00140000/machine ? sys/arch/evbarm/stand/gzboot/GEMINI_dram_0x01600000/arm ? sys/arch/evbarm/stand/gzboot/GEMINI_dram_0x01600000/evbarm ? sys/arch/evbarm/stand/gzboot/GEMINI_dram_0x01600000/machine ? sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x00080000/arm ? sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x00080000/evbarm ? sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x00080000/machine ? sys/arch/evbarm/stand/gzboot/IQ80321_flash_0xf0080000/arm ? sys/arch/evbarm/stand/gzboot/IQ80321_flash_0xf0080000/evbarm ? sys/arch/evbarm/stand/gzboot/IQ80321_flash_0xf0080000/machine ? sys/arch/evbarm/stand/gzboot/SMDK2410_flash_0x00000000/arm ? sys/arch/evbarm/stand/gzboot/SMDK2410_flash_0x00000000/evbarm ? sys/arch/evbarm/stand/gzboot/SMDK2410_flash_0x00000000/machine ? sys/arch/evbarm/stand/gzboot/SMDK2800_flash_0x00000000/arm ? sys/arch/evbarm/stand/gzboot/SMDK2800_flash_0x00000000/evbarm ? sys/arch/evbarm/stand/gzboot/SMDK2800_flash_0x00000000/machine ? sys/arch/evbarm/stand/gzboot/SMDK2800_flash_0x00100000/arm ? sys/arch/evbarm/stand/gzboot/SMDK2800_flash_0x00100000/evbarm ? sys/arch/evbarm/stand/gzboot/SMDK2800_flash_0x00100000/machine ? sys/arch/evbarm/stand/gzboot/TS7200_flash_0x60660000/arm ? sys/arch/evbarm/stand/gzboot/TS7200_flash_0x60660000/evbarm ? sys/arch/evbarm/stand/gzboot/TS7200_flash_0x60660000/machine ? sys/arch/ia64/include/acpi_func.h ? sys/arch/ia64/stand/efi/include ? sys/arch/ia64/stand/ia64/efi/efi ? sys/arch/ia64/stand/ia64/efi/lib ? sys/arch/ia64/stand/ia64/ski/lib ? sys/arch/mips/mips/pmap.c ? sys/arch/mips/mips/pmap_segtab.c ? sys/arch/mips/mips/pmap_tlb.c ? sys/arch/x68k/include/uvm_physmem.h ? sys/arch/x68k/stand/netboot/conf.c ? sys/arch/x68k/stand/netboot/version ? sys/arch/zaurus/stand/zboot/arm ? sys/arch/zaurus/stand/zboot/machine ? sys/arch/zaurus/stand/zboot/zaurus ? sys/arch/zaurus/stand/zbsdmod/arm ? sys/arch/zaurus/stand/zbsdmod/machine ? sys/arch/zaurus/stand/zbsdmod/zaurus @ 1.6 log @options UVM_HOTPLUG @ text @d1 85 d90 1 a90 1 diff -u -p -r1.36 pmap.c d92 1 a92 1 +++ sys/arch/acorn26/acorn26/pmap.c 17 Nov 2016 15:34:22 -0000 d130 1 a130 1 diff -u -p -r1.20 start.c d132 1 a132 1 +++ sys/arch/acorn26/acorn26/start.c 17 Nov 2016 15:34:25 -0000 d153 1 a153 1 diff -u -p -r1.17 arcvideo.c d155 1 a155 1 +++ sys/arch/acorn26/vidc/arcvideo.c 17 Nov 2016 15:34:26 -0000 d168 1 a168 1 diff -u -p -r1.90 rpc_machdep.c d170 1 a170 1 +++ sys/arch/acorn32/acorn32/rpc_machdep.c 17 Nov 2016 15:34:27 -0000 d184 1 a184 1 diff -u -p -r1.28 eb7500atx_machdep.c d186 1 a186 1 +++ sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c 17 Nov 2016 15:34:28 -0000 d200 1 a200 1 diff -u -p -r1.346 machdep.c d202 1 a202 1 +++ sys/arch/alpha/alpha/machdep.c 17 Nov 2016 15:34:30 -0000 d268 1 a268 1 diff -u -p -r1.260 pmap.c d270 1 a270 1 +++ sys/arch/alpha/alpha/pmap.c 17 Nov 2016 15:34:32 -0000 d363 1 a363 1 diff -u -p -r1.230 machdep.c d365 1 a365 1 +++ sys/arch/amd64/amd64/machdep.c 17 Nov 2016 15:34:35 -0000 d505 1 a505 1 diff -u -p -r1.437 GENERIC d507 1 a507 1 +++ sys/arch/amd64/conf/GENERIC 17 Nov 2016 15:34:37 -0000 d520 1 a520 1 diff -u -p -r1.246 machdep.c d522 1 a522 1 +++ sys/arch/amiga/amiga/machdep.c 17 Nov 2016 15:34:37 -0000 d536 1 a536 1 diff -u -p -r1.9 pmap_bootstrap.c d538 1 a538 1 +++ sys/arch/amiga/amiga/pmap_bootstrap.c 17 Nov 2016 15:34:37 -0000 d553 1 a553 1 diff -u -p -r1.129 machdep.c d555 1 a555 1 +++ sys/arch/arc/arc/machdep.c 17 Nov 2016 15:34:38 -0000 d578 1 a578 1 diff -u -p -r1.17 arm32_boot.c d580 1 a580 1 +++ sys/arch/arm/arm32/arm32_boot.c 17 Nov 2016 15:34:39 -0000 d603 1 a603 1 diff -u -p -r1.95 bus_dma.c d605 1 a605 1 +++ sys/arch/arm/arm32/bus_dma.c 17 Nov 2016 15:34:39 -0000 d625 1 a625 1 diff -u -p -r1.340 pmap.c d627 1 a627 1 +++ sys/arch/arm/arm32/pmap.c 17 Nov 2016 15:34:50 -0000 d643 1 a643 1 diff -u -p -r1.18 at91bus.c d645 1 a645 1 +++ sys/arch/arm/at91/at91bus.c 17 Nov 2016 15:34:51 -0000 d658 1 a658 1 diff -u -p -r1.7 pmap_bootstrap.c d660 1 a660 1 +++ sys/arch/atari/atari/pmap_bootstrap.c 17 Nov 2016 15:34:54 -0000 d675 1 a675 1 diff -u -p -r1.66 machdep.c d677 1 a677 1 +++ sys/arch/cesfic/cesfic/machdep.c 17 Nov 2016 15:34:57 -0000 d707 1 a707 1 diff -u -p -r1.118 machdep.c d709 1 a709 1 +++ sys/arch/cobalt/cobalt/machdep.c 17 Nov 2016 15:34:57 -0000 d732 1 a732 1 diff -u -p -r1.45 machdep.c d734 1 a734 1 +++ sys/arch/dreamcast/dreamcast/machdep.c 17 Nov 2016 15:34:58 -0000 d756 1 a756 1 diff -u -p -r1.11 machdep.c d758 1 a758 1 +++ sys/arch/emips/emips/machdep.c 17 Nov 2016 15:34:59 -0000 d771 1 a771 1 diff -u -p -r1.4 machdep.c d773 1 a773 1 +++ sys/arch/epoc32/epoc32/machdep.c 17 Nov 2016 15:34:59 -0000 d786 1 a786 1 diff -u -p -r1.43 brh_machdep.c d788 1 a788 1 +++ sys/arch/evbarm/adi_brh/brh_machdep.c 17 Nov 2016 15:34:59 -0000 d801 1 a801 1 diff -u -p -r1.28 armadillo9_machdep.c d803 1 a803 1 +++ sys/arch/evbarm/armadillo/armadillo9_machdep.c 17 Nov 2016 15:35:00 -0000 d816 1 a816 1 diff -u -p -r1.29 g42xxeb_machdep.c d818 1 a818 1 +++ sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c 17 Nov 2016 15:35:01 -0000 d831 1 a831 1 diff -u -p -r1.22 gemini_machdep.c d833 1 a833 1 +++ sys/arch/evbarm/gemini/gemini_machdep.c 17 Nov 2016 15:35:02 -0000 d848 1 a848 1 diff -u -p -r1.1 hawk_machdep.c d850 1 a850 1 +++ sys/arch/evbarm/hawk/hawk_machdep.c 17 Nov 2016 15:35:02 -0000 d863 1 a863 1 diff -u -p -r1.22 hdlg_machdep.c d865 1 a865 1 +++ sys/arch/evbarm/hdl_g/hdlg_machdep.c 17 Nov 2016 15:35:02 -0000 d878 1 a878 1 diff -u -p -r1.18 imx31lk_machdep.c d880 1 a880 1 +++ sys/arch/evbarm/imx31/imx31lk_machdep.c 17 Nov 2016 15:35:03 -0000 d893 1 a893 1 diff -u -p -r1.85 iq80310_machdep.c d895 1 a895 1 +++ sys/arch/evbarm/iq80310/iq80310_machdep.c 17 Nov 2016 15:35:03 -0000 d908 1 a908 1 diff -u -p -r1.55 iq80321_machdep.c d910 1 a910 1 +++ sys/arch/evbarm/iq80321/iq80321_machdep.c 17 Nov 2016 15:35:04 -0000 d923 1 a923 1 diff -u -p -r1.36 ixdp425_machdep.c d925 1 a925 1 +++ sys/arch/evbarm/ixdp425/ixdp425_machdep.c 17 Nov 2016 15:35:04 -0000 d938 1 a938 1 diff -u -p -r1.56 ixm1200_machdep.c d940 1 a940 1 +++ sys/arch/evbarm/ixm1200/ixm1200_machdep.c 17 Nov 2016 15:35:04 -0000 d953 1 a953 1 diff -u -p -r1.33 lubbock_machdep.c d955 1 a955 1 +++ sys/arch/evbarm/lubbock/lubbock_machdep.c 17 Nov 2016 15:35:05 -0000 d968 1 a968 1 diff -u -p -r1.9 mini2440_machdep.c d970 1 a970 1 +++ sys/arch/evbarm/mini2440/mini2440_machdep.c 17 Nov 2016 15:35:06 -0000 d983 1 a983 1 diff -u -p -r1.20 npwr_fc_machdep.c d985 1 a985 1 +++ sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c 17 Nov 2016 15:35:07 -0000 d998 1 a998 1 diff -u -p -r1.26 nslu2_machdep.c d1000 1 a1000 1 +++ sys/arch/evbarm/nslu2/nslu2_machdep.c 17 Nov 2016 15:35:07 -0000 d1013 1 a1013 1 diff -u -p -r1.15 osk5912_machdep.c d1015 1 a1015 1 +++ sys/arch/evbarm/osk5912/osk5912_machdep.c 17 Nov 2016 15:35:07 -0000 d1028 1 a1028 1 diff -u -p -r1.35 smdk2410_machdep.c d1030 1 a1030 1 +++ sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c 17 Nov 2016 15:35:09 -0000 d1043 1 a1043 1 diff -u -p -r1.42 smdk2800_machdep.c d1045 1 a1045 1 +++ sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c 17 Nov 2016 15:35:09 -0000 d1058 1 a1058 1 diff -u -p -r1.16 sdp24xx_machdep.c d1060 1 a1060 1 +++ sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c 17 Nov 2016 15:35:10 -0000 d1073 1 a1073 1 diff -u -p -r1.23 tsarm_machdep.c d1075 1 a1075 1 +++ sys/arch/evbarm/tsarm/tsarm_machdep.c 17 Nov 2016 15:35:10 -0000 d1088 1 a1088 1 diff -u -p -r1.24 viper_machdep.c d1090 1 a1090 1 +++ sys/arch/evbarm/viper/viper_machdep.c 17 Nov 2016 15:35:11 -0000 d1103 1 a1103 1 diff -u -p -r1.75 machdep.c d1105 1 a1105 1 +++ sys/arch/evbsh3/evbsh3/machdep.c 17 Nov 2016 15:35:12 -0000 d1118 1 a1118 1 diff -u -p -r1.26 machdep.c d1120 1 a1120 1 +++ sys/arch/ews4800mips/ews4800mips/machdep.c 17 Nov 2016 15:35:12 -0000 d1135 1 a1135 1 diff -u -p -r1.229 machdep.c d1137 1 a1137 1 +++ sys/arch/hp300/hp300/machdep.c 17 Nov 2016 15:35:13 -0000 d1150 1 a1150 1 diff -u -p -r1.22 pxa2x0_hpc_machdep.c d1152 1 a1152 1 +++ sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c 17 Nov 2016 15:35:14 -0000 d1165 1 a1165 1 diff -u -p -r1.10 sa11x0_hpc_machdep.c d1167 1 a1167 1 +++ sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c 17 Nov 2016 15:35:15 -0000 d1180 1 a1180 1 diff -u -p -r1.77 machdep.c d1182 1 a1182 1 +++ sys/arch/hpcsh/hpcsh/machdep.c 17 Nov 2016 15:35:17 -0000 d1195 1 a1195 1 diff -u -p -r1.99 pmap.c d1197 1 a1197 1 +++ sys/arch/hppa/hppa/pmap.c 17 Nov 2016 15:35:17 -0000 d1212 1 a1212 1 diff -u -p -r1.762 machdep.c d1214 1 a1214 1 +++ sys/arch/i386/i386/machdep.c 17 Nov 2016 15:35:18 -0000 d1306 1 a1306 1 diff -u -p -r1.35 machdep.c d1308 1 a1308 1 +++ sys/arch/ia64/ia64/machdep.c 17 Nov 2016 15:35:19 -0000 d1352 1 a1352 1 diff -u -p -r1.32 pmap.c d1354 1 a1354 1 +++ sys/arch/ia64/ia64/pmap.c 17 Nov 2016 15:35:19 -0000 d1361 1 a1361 1 + uvm_physmem_t lcv; d1369 3 a1371 3 + for (lcv = uvm_physmem_get_first(); + uvm_physmem_valid(lcv); + lcv = uvm_physmem_get_next(lcv)) { d1377 2 a1378 2 + if (uvm_physmem_get_avail_start(lcv) != uvm_physmem_get_start(lcv) || + uvm_physmem_get_avail_start(lcv) >= uvm_physmem_get_avail_end(lcv)) d1382 1 a1382 1 + if ((uvm_physmem_get_avail_end(lcv) - uvm_physmem_get_avail_start(lcv)) d1419 1 a1419 1 + uvm_physmem_t lcv; d1429 3 a1431 3 + for (lcv = uvm_physmem_get_first(); + uvm_physmem_valid(lcv); + lcv = uvm_physmem_get_next(lcv)) { d1437 2 a1438 2 + if (uvm_physmem_get_avail_start(lcv) != uvm_physmem_get_start(lcv) || /* XXX: ??? */ + uvm_physmem_get_avail_start(lcv) >= uvm_physmem_get_avail_end(lcv)) d1444 1 a1444 1 + start1 = uvm_physmem_get_avail_start(lcv); d1451 1 a1451 1 + end2 = uvm_physmem_get_avail_end(lcv); d1473 2 a1474 2 + if (uvm_physmem_unplug(uvm_physmem_get_start(lcv), + uvm_physmem_get_end(lcv) - uvm_physmem_get_start(lcv)) == false) { d1476 2 a1477 2 + __func__, uvm_physmem_get_start(lcv), + uvm_physmem_get_end(lcv) - uvm_physmem_get_start(lcv)); d1487 1 a1487 1 diff -u -p -r1.24 iyonix_machdep.c d1489 1 a1489 1 +++ sys/arch/iyonix/iyonix/iyonix_machdep.c 17 Nov 2016 15:35:20 -0000 d1510 1 a1510 1 diff -u -p -r1.18 machdep.c d1512 1 a1512 1 +++ sys/arch/landisk/landisk/machdep.c 17 Nov 2016 15:35:20 -0000 d1533 1 a1533 1 diff -u -p -r1.99 machdep.c d1535 1 a1535 1 +++ sys/arch/luna68k/luna68k/machdep.c 17 Nov 2016 15:35:21 -0000 d1556 1 a1556 1 diff -u -p -r1.36 pmap_bootstrap.c d1558 1 a1558 1 +++ sys/arch/luna68k/luna68k/pmap_bootstrap.c 17 Nov 2016 15:35:21 -0000 d1573 1 a1573 1 diff -u -p -r1.67 pmap_motorola.c d1575 1 a1575 1 +++ sys/arch/m68k/m68k/pmap_motorola.c 17 Nov 2016 15:35:22 -0000 d1658 1 a1658 1 diff -u -p -r1.349 machdep.c d1660 1 a1660 1 +++ sys/arch/mac68k/mac68k/machdep.c 17 Nov 2016 15:35:23 -0000 d1681 1 a1681 1 diff -u -p -r1.68 pmap.h d1683 1 a1683 1 +++ sys/arch/mips/include/pmap.h 17 Nov 2016 15:35:24 -0000 d1714 1 a1714 1 diff -u -p -r1.274 mips_machdep.c d1716 1 a1716 1 +++ sys/arch/mips/mips/mips_machdep.c 17 Nov 2016 15:35:25 -0000 d1773 1 a1773 1 diff -u -p -r1.11 pmap_machdep.c d1775 1 a1775 1 +++ sys/arch/mips/mips/pmap_machdep.c 17 Nov 2016 15:35:25 -0000 d1808 1 a1808 1 diff -u -p -r1.79 machdep.c d1810 1 a1810 1 +++ sys/arch/mipsco/mipsco/machdep.c 17 Nov 2016 15:35:25 -0000 d1833 1 a1833 1 diff -u -p -r1.57 machdep.c d1835 1 a1835 1 +++ sys/arch/mmeye/mmeye/machdep.c 17 Nov 2016 15:35:26 -0000 d1856 1 a1856 1 diff -u -p -r1.154 machdep.c d1858 1 a1858 1 +++ sys/arch/mvme68k/mvme68k/machdep.c 17 Nov 2016 15:35:26 -0000 d1871 1 a1871 1 diff -u -p -r1.83 netwinder_machdep.c d1873 1 a1873 1 +++ sys/arch/netwinder/netwinder/netwinder_machdep.c 17 Nov 2016 15:35:26 -0000 d1904 1 a1904 1 diff -u -p -r1.101 machdep.c d1906 1 a1906 1 +++ sys/arch/news68k/news68k/machdep.c 17 Nov 2016 15:35:27 -0000 d1927 1 a1927 1 diff -u -p -r1.40 pmap_bootstrap.c d1929 1 a1929 1 +++ sys/arch/news68k/news68k/pmap_bootstrap.c 17 Nov 2016 15:35:27 -0000 d1944 1 a1944 1 diff -u -p -r1.118 machdep.c d1946 1 a1946 1 +++ sys/arch/newsmips/newsmips/machdep.c 17 Nov 2016 15:35:27 -0000 d1969 1 a1969 1 diff -u -p -r1.111 machdep.c d1971 1 a1971 1 +++ sys/arch/next68k/next68k/machdep.c 17 Nov 2016 15:35:27 -0000 d1992 1 a1992 1 diff -u -p -r1.43 pmap_bootstrap.c d1994 1 a1994 1 +++ sys/arch/next68k/next68k/pmap_bootstrap.c 17 Nov 2016 15:35:27 -0000 d2009 1 a2009 1 diff -u -p -r1.31 machdep.c d2011 1 a2011 1 +++ sys/arch/playstation2/playstation2/machdep.c 17 Nov 2016 15:35:28 -0000 d2025 1 a2025 1 diff -u -p -r1.18 ibm4xx_machdep.c d2027 1 a2027 1 +++ sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c 17 Nov 2016 15:35:28 -0000 d2042 1 a2042 1 diff -u -p -r1.72 pmap.c d2044 1 a2044 1 +++ sys/arch/powerpc/ibm4xx/pmap.c 17 Nov 2016 15:35:30 -0000 d2059 1 a2059 1 diff -u -p -r1.10 isadma_machdep.c d2061 1 a2061 1 +++ sys/arch/powerpc/isa/isadma_machdep.c 17 Nov 2016 15:35:31 -0000 d2096 1 a2096 1 diff -u -p -r1.38 ofwoea_machdep.c d2098 1 a2098 1 +++ sys/arch/powerpc/oea/ofwoea_machdep.c 17 Nov 2016 15:35:31 -0000 d2113 1 a2113 1 diff -u -p -r1.93 pmap.c d2115 1 a2115 1 +++ sys/arch/powerpc/oea/pmap.c 17 Nov 2016 15:35:33 -0000 d2155 1 a2155 1 + if (uvm_physmem_get_free_list(bank) == VM_FREELIST_FIRST256 && d2197 1 a2197 1 + cnt += uvm_physmem_get_end(bank) - uvm_physmem_get_start(bank); d2230 1 a2230 1 diff -u -p -r1.10 prep_machdep.c d2232 1 a2232 1 +++ sys/arch/powerpc/oea/prep_machdep.c 17 Nov 2016 15:35:33 -0000 d2247 1 a2247 1 diff -u -p -r1.46 bus_dma.c d2249 1 a2249 1 +++ sys/arch/powerpc/powerpc/bus_dma.c 17 Nov 2016 15:35:35 -0000 d2276 1 a2276 1 diff -u -p -r1.78 pmap.c d2278 1 a2278 1 +++ sys/arch/sh3/sh3/pmap.c 17 Nov 2016 15:35:37 -0000 d2352 1 a2352 1 diff -u -p -r1.76 vm_machdep.c d2354 1 a2354 1 +++ sys/arch/sh3/sh3/vm_machdep.c 17 Nov 2016 15:35:37 -0000 d2376 1 a2376 1 diff -u -p -r1.65 ofw.c d2378 1 a2378 1 +++ sys/arch/shark/ofw/ofw.c 17 Nov 2016 15:35:38 -0000 d2393 1 a2393 1 diff -u -p -r1.360 pmap.c d2395 1 a2395 1 +++ sys/arch/sparc/sparc/pmap.c 17 Nov 2016 15:35:40 -0000 d2410 1 a2410 1 diff -u -p -r1.303 pmap.c d2412 1 a2412 1 +++ sys/arch/sparc64/sparc64/pmap.c 17 Nov 2016 15:35:43 -0000 d2427 1 a2427 1 diff -u -p -r1.47 pmap.c d2429 1 a2429 1 +++ sys/arch/sun2/sun2/pmap.c 17 Nov 2016 15:35:46 -0000 d2444 1 a2444 1 diff -u -p -r1.170 pmap.c d2446 1 a2446 1 +++ sys/arch/sun3/sun3/pmap.c 17 Nov 2016 15:35:48 -0000 d2461 1 a2461 1 diff -u -p -r1.113 pmap.c d2463 1 a2463 1 +++ sys/arch/sun3/sun3x/pmap.c 17 Nov 2016 15:35:52 -0000 d2478 1 a2478 1 diff -u -p -r1.106 pmap.c d2480 1 a2480 1 +++ sys/arch/usermode/usermode/pmap.c 17 Nov 2016 15:35:53 -0000 d2494 1 a2494 1 diff -u -p -r1.36 ka650.c d2496 1 a2496 1 +++ sys/arch/vax/vax/ka650.c 17 Nov 2016 15:35:53 -0000 d2510 1 a2510 1 diff -u -p -r1.182 pmap.c d2512 1 a2512 1 +++ sys/arch/vax/vax/pmap.c 17 Nov 2016 15:35:54 -0000 d2549 1 a2549 1 diff -u -p -r1.193 machdep.c d2551 1 a2551 1 +++ sys/arch/x68k/x68k/machdep.c 17 Nov 2016 15:35:55 -0000 d2621 1 a2621 1 diff -u -p -r1.60 pmap_bootstrap.c d2623 1 a2623 1 +++ sys/arch/x68k/x68k/pmap_bootstrap.c 17 Nov 2016 15:35:55 -0000 d2638 1 a2638 1 diff -u -p -r1.75 x86_machdep.c d2640 1 a2640 1 +++ sys/arch/x86/x86/x86_machdep.c 17 Nov 2016 15:35:57 -0000 d2653 1 a2653 1 diff -u -p -r1.17 balloon.c d2655 1 a2655 1 +++ sys/arch/xen/xen/balloon.c 17 Nov 2016 15:35:58 -0000 d2741 1 a2741 1 diff -u -p -r1.37 machdep.c d2743 1 a2743 1 +++ sys/arch/zaurus/zaurus/machdep.c 17 Nov 2016 15:35:58 -0000 @ 1.5 log @hotplug with balloon(4) implementation. Includes skrll@@ patches. @ text @d7 1 a7 1 +++ sys/arch/acorn26/acorn26/pmap.c 13 Nov 2016 10:14:39 -0000 d47 1 a47 1 +++ sys/arch/acorn26/acorn26/start.c 13 Nov 2016 10:14:39 -0000 d70 1 a70 1 +++ sys/arch/acorn26/vidc/arcvideo.c 13 Nov 2016 10:14:40 -0000 d85 1 a85 1 +++ sys/arch/acorn32/acorn32/rpc_machdep.c 13 Nov 2016 10:14:41 -0000 d101 1 a101 1 +++ sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c 13 Nov 2016 10:14:46 -0000 d117 1 a117 1 +++ sys/arch/alpha/alpha/machdep.c 13 Nov 2016 10:15:01 -0000 d144 1 a144 1 @@@@ -611,23 +612,25 @@@@ nobootinfo: a147 1 + int freelist; d185 1 a185 1 +++ sys/arch/alpha/alpha/pmap.c 13 Nov 2016 10:15:09 -0000 d280 1 a280 1 +++ sys/arch/amd64/amd64/machdep.c 13 Nov 2016 10:15:15 -0000 d416 15 d437 1 a437 1 +++ sys/arch/amiga/amiga/machdep.c 13 Nov 2016 10:15:20 -0000 d453 1 a453 1 +++ sys/arch/amiga/amiga/pmap_bootstrap.c 13 Nov 2016 10:15:20 -0000 d470 1 a470 1 +++ sys/arch/arc/arc/machdep.c 13 Nov 2016 10:15:22 -0000 d495 1 a495 1 +++ sys/arch/arm/arm32/arm32_boot.c 13 Nov 2016 10:15:31 -0000 d520 1 a520 1 +++ sys/arch/arm/arm32/bus_dma.c 13 Nov 2016 10:15:40 -0000 d542 1 a542 1 +++ sys/arch/arm/arm32/pmap.c 13 Nov 2016 10:16:33 -0000 d560 1 a560 1 +++ sys/arch/arm/at91/at91bus.c 13 Nov 2016 10:16:33 -0000 d575 1 a575 1 +++ sys/arch/atari/atari/pmap_bootstrap.c 13 Nov 2016 10:17:09 -0000 d592 1 a592 1 +++ sys/arch/cesfic/cesfic/machdep.c 13 Nov 2016 10:17:16 -0000 d624 1 a624 1 +++ sys/arch/cobalt/cobalt/machdep.c 13 Nov 2016 10:17:21 -0000 d649 1 a649 1 +++ sys/arch/dreamcast/dreamcast/machdep.c 13 Nov 2016 10:17:29 -0000 d673 1 a673 1 +++ sys/arch/emips/emips/machdep.c 13 Nov 2016 10:17:29 -0000 d688 1 a688 1 +++ sys/arch/epoc32/epoc32/machdep.c 13 Nov 2016 10:17:38 -0000 d703 1 a703 1 +++ sys/arch/evbarm/adi_brh/brh_machdep.c 13 Nov 2016 10:17:42 -0000 d718 1 a718 1 +++ sys/arch/evbarm/armadillo/armadillo9_machdep.c 13 Nov 2016 10:17:44 -0000 d733 1 a733 1 +++ sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c 13 Nov 2016 10:17:51 -0000 d748 1 a748 1 +++ sys/arch/evbarm/gemini/gemini_machdep.c 13 Nov 2016 10:18:02 -0000 d765 1 a765 1 +++ sys/arch/evbarm/hawk/hawk_machdep.c 13 Nov 2016 10:18:02 -0000 d780 1 a780 1 +++ sys/arch/evbarm/hdl_g/hdlg_machdep.c 13 Nov 2016 10:18:06 -0000 d795 1 a795 1 +++ sys/arch/evbarm/imx31/imx31lk_machdep.c 13 Nov 2016 10:18:09 -0000 d810 1 a810 1 +++ sys/arch/evbarm/iq80310/iq80310_machdep.c 13 Nov 2016 10:18:09 -0000 d825 1 a825 1 +++ sys/arch/evbarm/iq80321/iq80321_machdep.c 13 Nov 2016 10:18:15 -0000 d840 1 a840 1 +++ sys/arch/evbarm/ixdp425/ixdp425_machdep.c 13 Nov 2016 10:18:18 -0000 d855 1 a855 1 +++ sys/arch/evbarm/ixm1200/ixm1200_machdep.c 13 Nov 2016 10:18:27 -0000 d870 1 a870 1 +++ sys/arch/evbarm/lubbock/lubbock_machdep.c 13 Nov 2016 10:18:36 -0000 d885 1 a885 1 +++ sys/arch/evbarm/mini2440/mini2440_machdep.c 13 Nov 2016 10:18:44 -0000 d900 1 a900 1 +++ sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c 13 Nov 2016 10:18:44 -0000 d915 1 a915 1 +++ sys/arch/evbarm/nslu2/nslu2_machdep.c 13 Nov 2016 10:18:51 -0000 d930 1 a930 1 +++ sys/arch/evbarm/osk5912/osk5912_machdep.c 13 Nov 2016 10:18:58 -0000 d945 1 a945 1 +++ sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c 13 Nov 2016 10:19:03 -0000 d960 1 a960 1 +++ sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c 13 Nov 2016 10:19:05 -0000 d975 1 a975 1 +++ sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c 13 Nov 2016 10:19:13 -0000 d990 1 a990 1 +++ sys/arch/evbarm/tsarm/tsarm_machdep.c 13 Nov 2016 10:19:16 -0000 d1005 1 a1005 1 +++ sys/arch/evbarm/viper/viper_machdep.c 13 Nov 2016 10:19:23 -0000 d1020 1 a1020 1 +++ sys/arch/evbsh3/evbsh3/machdep.c 13 Nov 2016 10:19:28 -0000 d1035 1 a1035 1 +++ sys/arch/ews4800mips/ews4800mips/machdep.c 13 Nov 2016 10:19:28 -0000 d1052 1 a1052 1 +++ sys/arch/hp300/hp300/machdep.c 13 Nov 2016 10:19:36 -0000 d1067 1 a1067 1 +++ sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c 13 Nov 2016 10:19:44 -0000 d1082 1 a1082 1 +++ sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c 13 Nov 2016 10:19:48 -0000 d1097 1 a1097 1 +++ sys/arch/hpcsh/hpcsh/machdep.c 13 Nov 2016 10:19:52 -0000 d1112 1 a1112 1 +++ sys/arch/hppa/hppa/pmap.c 13 Nov 2016 10:20:01 -0000 d1129 1 a1129 1 +++ sys/arch/i386/i386/machdep.c 13 Nov 2016 10:20:14 -0000 d1223 1 a1223 1 +++ sys/arch/ia64/ia64/machdep.c 13 Nov 2016 10:20:28 -0000 d1269 1 a1269 1 +++ sys/arch/ia64/ia64/pmap.c 13 Nov 2016 10:20:35 -0000 d1404 1 a1404 1 +++ sys/arch/iyonix/iyonix/iyonix_machdep.c 13 Nov 2016 10:20:51 -0000 d1427 1 a1427 1 +++ sys/arch/landisk/landisk/machdep.c 13 Nov 2016 10:20:51 -0000 d1450 1 a1450 1 +++ sys/arch/luna68k/luna68k/machdep.c 13 Nov 2016 10:20:58 -0000 d1473 1 a1473 1 +++ sys/arch/luna68k/luna68k/pmap_bootstrap.c 13 Nov 2016 10:20:58 -0000 d1490 1 a1490 1 +++ sys/arch/m68k/m68k/pmap_motorola.c 13 Nov 2016 10:21:23 -0000 d1575 1 a1575 1 +++ sys/arch/mac68k/mac68k/machdep.c 13 Nov 2016 10:21:32 -0000 d1598 1 a1598 1 +++ sys/arch/mips/include/pmap.h 13 Nov 2016 10:21:35 -0000 d1631 1 a1631 1 +++ sys/arch/mips/mips/mips_machdep.c 13 Nov 2016 10:21:59 -0000 d1690 1 a1690 1 +++ sys/arch/mips/mips/pmap_machdep.c 13 Nov 2016 10:21:59 -0000 d1725 1 a1725 1 +++ sys/arch/mipsco/mipsco/machdep.c 13 Nov 2016 10:22:01 -0000 d1750 1 a1750 1 +++ sys/arch/mmeye/mmeye/machdep.c 13 Nov 2016 10:22:08 -0000 d1773 1 a1773 1 +++ sys/arch/mvme68k/mvme68k/machdep.c 13 Nov 2016 10:22:18 -0000 d1788 1 a1788 1 +++ sys/arch/netwinder/netwinder/netwinder_machdep.c 13 Nov 2016 10:22:31 -0000 d1821 1 a1821 1 +++ sys/arch/news68k/news68k/machdep.c 13 Nov 2016 10:22:38 -0000 d1844 1 a1844 1 +++ sys/arch/news68k/news68k/pmap_bootstrap.c 13 Nov 2016 10:22:38 -0000 d1861 1 a1861 1 +++ sys/arch/newsmips/newsmips/machdep.c 13 Nov 2016 10:22:42 -0000 d1886 1 a1886 1 +++ sys/arch/next68k/next68k/machdep.c 13 Nov 2016 10:22:49 -0000 d1909 1 a1909 1 +++ sys/arch/next68k/next68k/pmap_bootstrap.c 13 Nov 2016 10:22:49 -0000 d1926 1 a1926 1 +++ sys/arch/playstation2/playstation2/machdep.c 13 Nov 2016 10:22:59 -0000 d1942 1 a1942 1 +++ sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c 13 Nov 2016 10:23:01 -0000 d1959 1 a1959 1 +++ sys/arch/powerpc/ibm4xx/pmap.c 13 Nov 2016 10:23:08 -0000 d1976 1 a1976 1 +++ sys/arch/powerpc/isa/isadma_machdep.c 13 Nov 2016 10:23:11 -0000 d2013 1 a2013 1 +++ sys/arch/powerpc/oea/ofwoea_machdep.c 13 Nov 2016 10:23:20 -0000 d2030 1 a2030 1 +++ sys/arch/powerpc/oea/pmap.c 13 Nov 2016 10:23:36 -0000 d2147 1 a2147 1 +++ sys/arch/powerpc/oea/prep_machdep.c 13 Nov 2016 10:23:36 -0000 d2164 1 a2164 1 +++ sys/arch/powerpc/powerpc/bus_dma.c 13 Nov 2016 10:23:39 -0000 d2193 1 a2193 1 +++ sys/arch/sh3/sh3/pmap.c 13 Nov 2016 10:24:10 -0000 d2269 1 a2269 1 +++ sys/arch/sh3/sh3/vm_machdep.c 13 Nov 2016 10:24:10 -0000 d2293 1 a2293 1 +++ sys/arch/shark/ofw/ofw.c 13 Nov 2016 10:24:23 -0000 d2310 1 a2310 1 +++ sys/arch/sparc/sparc/pmap.c 13 Nov 2016 10:24:53 -0000 d2327 1 a2327 1 +++ sys/arch/sparc64/sparc64/pmap.c 13 Nov 2016 10:25:05 -0000 d2344 1 a2344 1 +++ sys/arch/sun2/sun2/pmap.c 13 Nov 2016 10:25:25 -0000 d2361 1 a2361 1 +++ sys/arch/sun3/sun3/pmap.c 13 Nov 2016 10:25:37 -0000 d2378 1 a2378 1 +++ sys/arch/sun3/sun3x/pmap.c 13 Nov 2016 10:26:02 -0000 d2395 1 a2395 1 +++ sys/arch/usermode/usermode/pmap.c 13 Nov 2016 10:26:05 -0000 d2411 1 a2411 1 +++ sys/arch/vax/vax/ka650.c 13 Nov 2016 10:26:08 -0000 d2427 1 a2427 1 +++ sys/arch/vax/vax/pmap.c 13 Nov 2016 10:26:16 -0000 d2466 1 a2466 1 +++ sys/arch/x68k/x68k/machdep.c 13 Nov 2016 10:26:26 -0000 d2538 1 a2538 1 +++ sys/arch/x68k/x68k/pmap_bootstrap.c 13 Nov 2016 10:26:26 -0000 d2555 1 a2555 1 +++ sys/arch/x86/x86/x86_machdep.c 13 Nov 2016 10:26:35 -0000 d2570 2 a2571 3 +++ sys/arch/xen/xen/balloon.c 13 Nov 2016 10:26:41 -0000 @@@@ -69,6 +69,7 @@@@ */ a2573 1 +#define HOTPLUG 1 d2575 4 d2581 2 a2582 1 @@@@ -93,6 +94,7 @@@@ __KERNEL_RCSID(0, "$NetBSD: balloon.c,v d2590 1 a2590 1 @@@@ -454,6 +456,7 @@@@ balloon_deflate(struct balloon_xenbus_so d2594 1 a2594 1 +#ifndef HOTPLUG d2598 1 a2598 1 @@@@ -469,6 +472,7 @@@@ balloon_deflate(struct balloon_xenbus_so d2606 1 a2606 1 @@@@ -491,19 +495,41 @@@@ balloon_deflate(struct balloon_xenbus_so d2612 1 a2612 1 +#ifdef HOTPLUG d2658 1 a2658 1 +++ sys/arch/zaurus/zaurus/machdep.c 13 Nov 2016 10:26:46 -0000 @ 1.4 log @Move to the rbtree implementation. tests + MD stuff .' @ text @d7 2 a8 2 +++ sys/arch/acorn26/acorn26/pmap.c 30 Oct 2016 16:51:36 -0000 @@@@ -293,20 +293,29 @@@@ pmap_bootstrap(int npages, paddr_t zp_ph a25 2 + int freelist; + paddr_t stolenpa = 0; d28 1 a28 2 + if (uvm_page_physunload_force(bank, freelist, &stolenpa) == false) + panic("%s: couldn't steal enough pages!", __func__); d34 5 a38 4 - break; + ptoa(stolenpa)); + /* XXX: cherry - this is broken! What happened to size ? */ + break; a40 1 d47 1 a47 1 +++ sys/arch/acorn26/acorn26/start.c 30 Oct 2016 16:51:36 -0000 d70 1 a70 1 +++ sys/arch/acorn26/vidc/arcvideo.c 30 Oct 2016 16:51:37 -0000 d85 1 a85 1 +++ sys/arch/acorn32/acorn32/rpc_machdep.c 30 Oct 2016 16:51:38 -0000 d101 1 a101 1 +++ sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c 30 Oct 2016 16:51:38 -0000 d117 1 a117 1 +++ sys/arch/alpha/alpha/machdep.c 30 Oct 2016 16:51:40 -0000 d144 1 a144 1 @@@@ -611,23 +612,34 @@@@ nobootinfo: d149 1 a149 1 + paddr_t stolenpa; d167 2 a168 9 + freelist = uvm_physmem_get_free_list(bank); + /* + * XXX: Query to portmaster. The original implementation + * frees from the back of the segment. + * uvm_page_physunload_force() unloads from the front. + * Not sure if this is a problem + */ + uvm_page_physunload_force(bank, freelist, &stolenpa); + msgbufaddr = (void *) ALPHA_PHYS_TO_K0SEG(stolenpa); d173 3 a175 5 + /* XXX: This loop assumes linear pa allocation */ + KASSERT(sz > 0); + while(((vaddr_t) msgbufaddr + sz - PAGE_SIZE) > + (vaddr_t) ALPHA_PHYS_TO_K0SEG(stolenpa)) + uvm_page_physunload_force(bank, freelist, &stolenpa); d186 1 a186 1 +++ sys/arch/alpha/alpha/pmap.c 30 Oct 2016 16:51:41 -0000 d203 1 a203 1 + int npgs, freelist; d206 1 a206 1 + paddr_t pa = 0, tmppa = 0; d213 1 a213 1 @@@@ -1018,7 +1020,9 @@@@ pmap_steal_memory(vsize_t size, vaddr_t d219 1 a219 1 + bank < uvm_physmem_get_last(); d224 5 a228 1 @@@@ -1028,8 +1032,8 @@@@ pmap_steal_memory(vsize_t size, vaddr_t d239 2 a240 1 @@@@ -1037,31 +1041,19 @@@@ pmap_steal_memory(vsize_t size, vaddr_t a248 2 + freelist = uvm_physmem_get_free_list(bank); + d270 2 a271 4 + if (uvm_page_physunload_force(bank, freelist, &tmppa) == false) + panic("%s: couldn't steal enough pages!", __func__); + + pa = pa ? pa : tmppa; d281 1 a281 1 +++ sys/arch/amd64/amd64/machdep.c 30 Oct 2016 16:51:42 -0000 d297 1 a297 1 + upm <= uvm_physmem_get_last(); d423 1 a423 1 +++ sys/arch/amiga/amiga/machdep.c 30 Oct 2016 16:51:42 -0000 d439 1 a439 1 +++ sys/arch/amiga/amiga/pmap_bootstrap.c 30 Oct 2016 16:51:42 -0000 d456 1 a456 1 +++ sys/arch/arc/arc/machdep.c 30 Oct 2016 16:51:43 -0000 d481 1 a481 1 +++ sys/arch/arm/arm32/arm32_boot.c 30 Oct 2016 16:51:43 -0000 d506 1 a506 1 +++ sys/arch/arm/arm32/bus_dma.c 30 Oct 2016 16:51:44 -0000 d528 1 a528 1 +++ sys/arch/arm/arm32/pmap.c 30 Oct 2016 16:51:45 -0000 d546 1 a546 1 +++ sys/arch/arm/at91/at91bus.c 30 Oct 2016 16:51:45 -0000 d561 1 a561 1 +++ sys/arch/atari/atari/pmap_bootstrap.c 30 Oct 2016 16:51:46 -0000 d578 1 a578 1 +++ sys/arch/cesfic/cesfic/machdep.c 30 Oct 2016 16:51:47 -0000 d610 1 a610 1 +++ sys/arch/cobalt/cobalt/machdep.c 30 Oct 2016 16:51:47 -0000 d635 1 a635 1 +++ sys/arch/dreamcast/dreamcast/machdep.c 30 Oct 2016 16:51:47 -0000 d659 1 a659 1 +++ sys/arch/emips/emips/machdep.c 30 Oct 2016 16:51:47 -0000 d674 1 a674 1 +++ sys/arch/epoc32/epoc32/machdep.c 30 Oct 2016 16:51:47 -0000 d689 1 a689 1 +++ sys/arch/evbarm/adi_brh/brh_machdep.c 30 Oct 2016 16:51:48 -0000 d704 1 a704 1 +++ sys/arch/evbarm/armadillo/armadillo9_machdep.c 30 Oct 2016 16:51:48 -0000 d719 1 a719 1 +++ sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c 30 Oct 2016 16:51:48 -0000 d734 1 a734 1 +++ sys/arch/evbarm/gemini/gemini_machdep.c 30 Oct 2016 16:51:49 -0000 d751 1 a751 1 +++ sys/arch/evbarm/hawk/hawk_machdep.c 30 Oct 2016 16:51:49 -0000 d766 1 a766 1 +++ sys/arch/evbarm/hdl_g/hdlg_machdep.c 30 Oct 2016 16:51:49 -0000 d781 1 a781 1 +++ sys/arch/evbarm/imx31/imx31lk_machdep.c 30 Oct 2016 16:51:49 -0000 d796 1 a796 1 +++ sys/arch/evbarm/iq80310/iq80310_machdep.c 30 Oct 2016 16:51:49 -0000 d811 1 a811 1 +++ sys/arch/evbarm/iq80321/iq80321_machdep.c 30 Oct 2016 16:51:50 -0000 d826 1 a826 1 +++ sys/arch/evbarm/ixdp425/ixdp425_machdep.c 30 Oct 2016 16:51:50 -0000 d841 1 a841 1 +++ sys/arch/evbarm/ixm1200/ixm1200_machdep.c 30 Oct 2016 16:51:50 -0000 d856 1 a856 1 +++ sys/arch/evbarm/lubbock/lubbock_machdep.c 30 Oct 2016 16:51:50 -0000 d871 1 a871 1 +++ sys/arch/evbarm/mini2440/mini2440_machdep.c 30 Oct 2016 16:51:51 -0000 d886 1 a886 1 +++ sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c 30 Oct 2016 16:51:51 -0000 d901 1 a901 1 +++ sys/arch/evbarm/nslu2/nslu2_machdep.c 30 Oct 2016 16:51:51 -0000 d916 1 a916 1 +++ sys/arch/evbarm/osk5912/osk5912_machdep.c 30 Oct 2016 16:51:51 -0000 d931 1 a931 1 +++ sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c 30 Oct 2016 16:51:51 -0000 d946 1 a946 1 +++ sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c 30 Oct 2016 16:51:52 -0000 d961 1 a961 1 +++ sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c 30 Oct 2016 16:51:52 -0000 d976 1 a976 1 +++ sys/arch/evbarm/tsarm/tsarm_machdep.c 30 Oct 2016 16:51:52 -0000 d991 1 a991 1 +++ sys/arch/evbarm/viper/viper_machdep.c 30 Oct 2016 16:51:52 -0000 d1006 1 a1006 1 +++ sys/arch/evbsh3/evbsh3/machdep.c 30 Oct 2016 16:51:53 -0000 d1021 1 a1021 1 +++ sys/arch/ews4800mips/ews4800mips/machdep.c 30 Oct 2016 16:51:53 -0000 d1038 1 a1038 1 +++ sys/arch/hp300/hp300/machdep.c 30 Oct 2016 16:51:53 -0000 d1053 1 a1053 1 +++ sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c 30 Oct 2016 16:51:54 -0000 d1068 1 a1068 1 +++ sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c 30 Oct 2016 16:51:54 -0000 d1083 1 a1083 1 +++ sys/arch/hpcsh/hpcsh/machdep.c 30 Oct 2016 16:51:54 -0000 d1098 1 a1098 1 +++ sys/arch/hppa/hppa/pmap.c 30 Oct 2016 16:51:55 -0000 d1115 1 a1115 1 +++ sys/arch/i386/i386/machdep.c 30 Oct 2016 16:51:55 -0000 d1209 1 a1209 1 +++ sys/arch/ia64/ia64/machdep.c 30 Oct 2016 16:51:56 -0000 d1255 2 a1256 2 +++ sys/arch/ia64/ia64/pmap.c 30 Oct 2016 16:51:56 -0000 @@@@ -316,46 +316,38 @@@@ pmap_steal_vhpt_memory(vsize_t); d1261 1 a1261 1 + int npgs, x, freelist; d1264 1 a1264 2 - paddr_t pa; + paddr_t tmppa, pa = 0; d1293 1 a1293 2 + freelist = uvm_physmem_get_free_list(lcv); d1308 3 a1310 6 + for (x = 0; x < npgs; x++) { + uvm_page_physunload_force(lcv, freelist, &tmppa); + + pa = pa ? pa : tmppa; + } d1313 2 a1314 1 @@@@ -380,31 +372,34 @@@@ pmap_steal_memory(vsize_t size, vaddr_t d1319 1 a1319 1 + int npgs, x; d1356 1 a1356 1 @@@@ -423,7 +418,7 @@@@ pmap_steal_vhpt_memory(vsize_t size) d1365 1 a1365 1 @@@@ -431,10 +426,15 @@@@ pmap_steal_vhpt_memory(vsize_t size) d1373 6 a1378 8 + for (x = (uvm_physmem_get_end(lcv) - uvm_physmem_get_start(lcv)); + x > 0; + x--) { + if (uvm_page_physunload_force(lcv, + uvm_physmem_get_free_list(lcv), &tmppa) == false) { + panic("%s: uvm_page_physunload_force() x %d failed\n", + __func__, x); + } d1380 1 a1380 1 d1383 1 d1390 1 a1390 1 +++ sys/arch/iyonix/iyonix/iyonix_machdep.c 30 Oct 2016 16:51:57 -0000 d1413 1 a1413 1 +++ sys/arch/landisk/landisk/machdep.c 30 Oct 2016 16:51:57 -0000 d1436 1 a1436 1 +++ sys/arch/luna68k/luna68k/machdep.c 30 Oct 2016 16:51:57 -0000 d1459 1 a1459 1 +++ sys/arch/luna68k/luna68k/pmap_bootstrap.c 30 Oct 2016 16:51:57 -0000 d1476 1 a1476 1 +++ sys/arch/m68k/m68k/pmap_motorola.c 30 Oct 2016 16:51:58 -0000 d1508 1 a1508 1 + bank <= uvm_physmem_get_last(); d1522 1 a1522 1 + bank <= uvm_physmem_get_last(); d1548 1 a1548 1 + bank <= uvm_physmem_get_last(); d1561 1 a1561 1 +++ sys/arch/mac68k/mac68k/machdep.c 30 Oct 2016 16:51:59 -0000 d1584 1 a1584 1 +++ sys/arch/mips/include/pmap.h 30 Oct 2016 16:51:59 -0000 d1617 2 a1618 2 +++ sys/arch/mips/mips/mips_machdep.c 30 Oct 2016 16:52:00 -0000 @@@@ -2008,37 +2008,49 @@@@ mips_init_msgbuf(void) d1637 2 a1638 2 + paddr_t avail_start = uvm_physmem_get_avail_start(bank); + paddr_t avail_end = uvm_physmem_get_avail_end(bank); d1643 2 a1644 2 + if ((avail_end - avail_start) < atop(sz)) + sz = ptoa(avail_end - avail_start); d1648 2 a1649 8 + paddr_t stolenpa; + int freelist = uvm_physmem_get_free_list(bank); + /* + * XXX: Query to portmaster. The original implementation + * frees from the back of the segment. + * uvm_page_physunload_force() unloads from the front. + * Not sure if this is a problem + */ a1650 1 + uvm_page_physunload_force(bank, freelist, &stolenpa); d1653 1 a1653 1 + msgbufaddr = (void *) MIPS_PHYS_TO_XKPHYS_CACHED(stolenpa); d1656 1 a1656 1 + msgbufaddr = (void *) MIPS_PHYS_TO_KSEG0(stolenpa); d1658 1 a1658 1 - initmsgbuf(msgbufaddr, sz); d1666 1 a1666 10 + /* XXX: This loop assumes linear pa allocation */ + while(((vaddr_t) msgbufaddr + sz) > +#ifdef _LP64 + (vaddr_t) MIPS_PHYS_TO_XKPHYS_CACHED(stolenpa)) +#else + (vaddr_t) MIPS_PHYS_TO_KSEG0(stolenpa)) + uvm_page_physunload_force(bank, freelist, &stolenpa); +#endif + initmsgbuf(msgbufaddr, sz); d1669 1 d1676 1 a1676 1 +++ sys/arch/mips/mips/pmap_machdep.c 30 Oct 2016 16:52:00 -0000 d1711 1 a1711 1 +++ sys/arch/mipsco/mipsco/machdep.c 30 Oct 2016 16:52:00 -0000 d1736 1 a1736 1 +++ sys/arch/mmeye/mmeye/machdep.c 30 Oct 2016 16:52:00 -0000 d1759 1 a1759 1 +++ sys/arch/mvme68k/mvme68k/machdep.c 30 Oct 2016 16:52:01 -0000 d1774 1 a1774 1 +++ sys/arch/netwinder/netwinder/netwinder_machdep.c 30 Oct 2016 16:52:01 -0000 d1807 1 a1807 1 +++ sys/arch/news68k/news68k/machdep.c 30 Oct 2016 16:52:01 -0000 d1830 1 a1830 1 +++ sys/arch/news68k/news68k/pmap_bootstrap.c 30 Oct 2016 16:52:01 -0000 d1847 1 a1847 1 +++ sys/arch/newsmips/newsmips/machdep.c 30 Oct 2016 16:52:02 -0000 d1872 1 a1872 1 +++ sys/arch/next68k/next68k/machdep.c 30 Oct 2016 16:52:02 -0000 d1895 1 a1895 1 +++ sys/arch/next68k/next68k/pmap_bootstrap.c 30 Oct 2016 16:52:02 -0000 d1912 1 a1912 1 +++ sys/arch/playstation2/playstation2/machdep.c 30 Oct 2016 16:52:02 -0000 d1928 1 a1928 1 +++ sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c 30 Oct 2016 16:52:02 -0000 d1945 1 a1945 1 +++ sys/arch/powerpc/ibm4xx/pmap.c 30 Oct 2016 16:52:03 -0000 d1962 1 a1962 1 +++ sys/arch/powerpc/isa/isadma_machdep.c 30 Oct 2016 16:52:03 -0000 d1999 1 a1999 1 +++ sys/arch/powerpc/oea/ofwoea_machdep.c 30 Oct 2016 16:52:03 -0000 d2016 1 a2016 1 +++ sys/arch/powerpc/oea/pmap.c 30 Oct 2016 16:52:04 -0000 d2032 2 a2033 2 + paddr_t avail_start, avail_end, pa = 0; + int i, npgs, freelist; d2053 2 a2054 2 + avail_start = uvm_physmem_get_avail_start(bank); + avail_end = uvm_physmem_get_avail_end(bank); d2056 3 a2058 3 + if (freelist == VM_FREELIST_FIRST256 && + (avail_end - avail_start) >= npgs) { + pa = ptoa(avail_start); d2062 1 a2062 1 @@@@ -2938,24 +2946,14 @@@@ pmap_steal_memory(vsize_t vsize, vaddr_t d2068 1 a2068 6 + /* XXX: assumes consecutive unload_force()s are contiguous */ + for (i = 0; i < npgs; i++) { + paddr_t tmppa; + if (uvm_page_physunload_force(bank, freelist, &tmppa) == false) + panic("unable to steal memory!"); d2079 1 a2079 1 + pa = pa ? pa : tmppa; d2088 1 a2088 1 @@@@ -2964,9 +2962,10 @@@@ pmap_steal_memory(vsize_t vsize, vaddr_t d2098 1 a2098 1 + cnt += uvm_physmem_get_avail_end(bank) - uvm_physmem_get_avail_start(bank); d2102 1 a2102 1 @@@@ -3446,15 +3445,18 @@@@ pmap_bootstrap(paddr_t kernelstart, padd d2133 1 a2133 1 +++ sys/arch/powerpc/oea/prep_machdep.c 30 Oct 2016 16:52:04 -0000 d2150 1 a2150 1 +++ sys/arch/powerpc/powerpc/bus_dma.c 30 Oct 2016 16:52:04 -0000 d2179 1 a2179 1 +++ sys/arch/sh3/sh3/pmap.c 30 Oct 2016 16:52:05 -0000 d2199 1 a2199 1 @@@@ -126,9 +127,9 @@@@ pmap_bootstrap(void) d2205 3 a2207 1 - paddr_t pa; a2208 3 + int i, npage, freelist; + paddr_t pa = 0; vaddr_t va; d2211 1 a2211 1 @@@@ -136,27 +137,24 @@@@ pmap_steal_memory(vsize_t size, vaddr_t d2222 1 a2222 1 + if (npage <= uvm_physmem_get_avail_end(bank) - uvm_physmem_get_avail_start(bank)) a2226 2 + + KDASSERT(uvm_physmem_valid(bank)); d2228 1 a2228 1 /* Steal pages */ d2240 2 a2241 9 + freelist = uvm_physmem_get_free_list(bank); + + for (i = 0; i < npage;i++) { + paddr_t tmppa; + if (uvm_page_physunload_force(bank, freelist, &tmppa) == false) + panic("%s: page steal failed\n", __func__); + + pa = pa ? pa : tmppa; } d2243 3 d2247 2 d2255 1 a2255 1 +++ sys/arch/sh3/sh3/vm_machdep.c 30 Oct 2016 16:52:05 -0000 d2279 1 a2279 1 +++ sys/arch/shark/ofw/ofw.c 30 Oct 2016 16:52:06 -0000 d2296 1 a2296 1 +++ sys/arch/sparc/sparc/pmap.c 30 Oct 2016 16:52:08 -0000 d2313 1 a2313 1 +++ sys/arch/sparc64/sparc64/pmap.c 30 Oct 2016 16:52:08 -0000 d2330 1 a2330 1 +++ sys/arch/sun2/sun2/pmap.c 30 Oct 2016 16:52:09 -0000 d2347 1 a2347 1 +++ sys/arch/sun3/sun3/pmap.c 30 Oct 2016 16:52:10 -0000 d2364 1 a2364 1 +++ sys/arch/sun3/sun3x/pmap.c 30 Oct 2016 16:52:11 -0000 d2381 1 a2381 1 +++ sys/arch/usermode/usermode/pmap.c 30 Oct 2016 16:52:11 -0000 d2397 1 a2397 1 +++ sys/arch/vax/vax/ka650.c 30 Oct 2016 16:52:12 -0000 d2413 1 a2413 1 +++ sys/arch/vax/vax/pmap.c 30 Oct 2016 16:52:12 -0000 d2422 1 a2422 2 @@@@ -474,8 +475,10 @@@@ vaddr_t pmap_steal_memory(vsize_t size, vaddr_t *vstartp, vaddr_t *vendp) d2425 1 a2425 1 - int npgs; a2426 2 + paddr_t pa = 0, tmppa; + int n, npgs, freelist; d2432 1 a2432 1 @@@@ -490,10 +493,19 @@@@ pmap_steal_memory(vsize_t size, vaddr_t a2436 9 + freelist = uvm_physmem_get_free_list(bank); + + for (n = 0; n < npgs; n++) { + if (uvm_page_physunload_force(bank, freelist, &tmppa) == false) { + panic("%s: uvm_page_physunload_force() failed at %d\n", + __func__, n); + } + + pa = pa ? pa : tmppa; d2441 2 a2442 2 + } + v = (pa << PGSHIFT) | KERNBASE; d2452 1 a2452 1 +++ sys/arch/x68k/x68k/machdep.c 30 Oct 2016 16:52:12 -0000 d2483 1 a2483 1 + for (uvm_physmem_get_next(i); i <= uvm_physmem_get_last(); i = uvm_physmem_get_next(i)) { d2506 1 a2506 1 + for (i = uvm_physmem_get_first(); i <= uvm_physmem_get_last(); i = uvm_physmem_get_next(i)) { d2524 1 a2524 1 +++ sys/arch/x68k/x68k/pmap_bootstrap.c 30 Oct 2016 16:52:12 -0000 d2541 1 a2541 1 +++ sys/arch/x86/x86/x86_machdep.c 30 Oct 2016 16:52:13 -0000 d2550 85 d2641 1 a2641 1 +++ sys/arch/zaurus/zaurus/machdep.c 30 Oct 2016 16:52:13 -0000 @ 1.3 log @Chop off unknown file listings in the diff. @ text @d7 1 a7 1 +++ sys/arch/acorn26/acorn26/pmap.c 28 Oct 2016 08:21:26 -0000 d50 1 a50 1 +++ sys/arch/acorn26/acorn26/start.c 28 Oct 2016 08:21:26 -0000 d59 8 d73 1 a73 1 +++ sys/arch/acorn26/vidc/arcvideo.c 28 Oct 2016 08:21:27 -0000 d82 32 d120 1 a120 1 +++ sys/arch/alpha/alpha/machdep.c 28 Oct 2016 08:21:28 -0000 d137 11 a147 1 @@@@ -611,23 +611,34 @@@@ nobootinfo: d198 1 a198 1 +++ sys/arch/alpha/alpha/pmap.c 28 Oct 2016 08:21:30 -0000 d292 1 a292 1 +++ sys/arch/amd64/amd64/machdep.c 28 Oct 2016 08:21:31 -0000 d407 11 a417 1 @@@@ -1827,7 +1816,9 @@@@ cpu_reset(void) d434 1 a434 1 +++ sys/arch/amiga/amiga/machdep.c 28 Oct 2016 08:21:32 -0000 d444 17 d467 1 a467 1 +++ sys/arch/arc/arc/machdep.c 28 Oct 2016 08:21:33 -0000 d476 10 d492 1 a492 1 +++ sys/arch/arm/arm32/arm32_boot.c 28 Oct 2016 08:21:33 -0000 d501 10 d517 1 a517 1 +++ sys/arch/arm/arm32/bus_dma.c 28 Oct 2016 08:21:34 -0000 d539 1 a539 1 +++ sys/arch/arm/arm32/pmap.c 28 Oct 2016 08:21:39 -0000 d551 32 d589 1 a589 1 +++ sys/arch/cesfic/cesfic/machdep.c 28 Oct 2016 08:21:41 -0000 d607 8 d621 1 a621 1 +++ sys/arch/cobalt/cobalt/machdep.c 28 Oct 2016 08:21:41 -0000 d630 10 d646 1 a646 1 +++ sys/arch/dreamcast/dreamcast/machdep.c 28 Oct 2016 08:21:42 -0000 d656 8 d670 1 a670 1 +++ sys/arch/emips/emips/machdep.c 28 Oct 2016 08:21:42 -0000 d679 441 d1126 1 a1126 1 +++ sys/arch/i386/i386/machdep.c 28 Oct 2016 08:21:47 -0000 d1204 10 d1220 1 a1220 1 +++ sys/arch/ia64/ia64/machdep.c 28 Oct 2016 08:21:48 -0000 d1250 10 d1266 1 a1266 1 +++ sys/arch/ia64/ia64/pmap.c 28 Oct 2016 08:21:49 -0000 d1406 1 a1406 1 +++ sys/arch/iyonix/iyonix/iyonix_machdep.c 28 Oct 2016 08:21:49 -0000 d1415 8 d1429 1 a1429 1 +++ sys/arch/landisk/landisk/machdep.c 28 Oct 2016 08:21:50 -0000 d1438 8 d1452 1 a1452 1 +++ sys/arch/luna68k/luna68k/machdep.c 28 Oct 2016 08:21:50 -0000 d1461 8 d1475 1 a1475 1 +++ sys/arch/luna68k/luna68k/pmap_bootstrap.c 28 Oct 2016 08:21:50 -0000 d1492 1 a1492 1 +++ sys/arch/m68k/m68k/pmap_motorola.c 28 Oct 2016 08:21:52 -0000 d1577 1 a1577 1 +++ sys/arch/mac68k/mac68k/machdep.c 28 Oct 2016 08:21:54 -0000 d1586 8 d1600 1 a1600 1 +++ sys/arch/mips/include/pmap.h 28 Oct 2016 08:21:54 -0000 d1633 1 a1633 1 +++ sys/arch/mips/mips/mips_machdep.c 28 Oct 2016 08:21:55 -0000 d1707 1 a1707 1 +++ sys/arch/mips/mips/pmap_machdep.c 28 Oct 2016 08:21:56 -0000 d1742 1 a1742 1 +++ sys/arch/mipsco/mipsco/machdep.c 28 Oct 2016 08:21:56 -0000 d1751 10 d1767 1 a1767 1 +++ sys/arch/mmeye/mmeye/machdep.c 28 Oct 2016 08:21:57 -0000 d1776 23 d1805 1 a1805 1 +++ sys/arch/netwinder/netwinder/netwinder_machdep.c 28 Oct 2016 08:21:58 -0000 d1823 9 d1838 1 a1838 1 +++ sys/arch/news68k/news68k/machdep.c 28 Oct 2016 08:21:59 -0000 d1847 8 d1861 1 a1861 1 +++ sys/arch/news68k/news68k/pmap_bootstrap.c 28 Oct 2016 08:21:59 -0000 d1878 1 a1878 1 +++ sys/arch/newsmips/newsmips/machdep.c 28 Oct 2016 08:21:59 -0000 d1887 10 d1903 1 a1903 1 +++ sys/arch/next68k/next68k/machdep.c 28 Oct 2016 08:22:00 -0000 d1912 8 d1926 1 a1926 1 +++ sys/arch/next68k/next68k/pmap_bootstrap.c 28 Oct 2016 08:22:00 -0000 d1937 50 d1993 1 a1993 1 +++ sys/arch/powerpc/isa/isadma_machdep.c 28 Oct 2016 08:22:01 -0000 d2024 17 d2047 1 a2047 1 +++ sys/arch/powerpc/oea/pmap.c 28 Oct 2016 08:22:03 -0000 d2163 17 d2186 1 a2186 1 +++ sys/arch/powerpc/powerpc/bus_dma.c 28 Oct 2016 08:22:03 -0000 d2215 1 a2215 1 +++ sys/arch/sh3/sh3/pmap.c 28 Oct 2016 08:22:05 -0000 d2296 1 a2296 1 +++ sys/arch/sh3/sh3/vm_machdep.c 28 Oct 2016 08:22:05 -0000 d2314 118 d2438 1 a2438 1 +++ sys/arch/vax/vax/ka650.c 28 Oct 2016 08:22:07 -0000 d2454 10 a2463 2 +++ sys/arch/vax/vax/pmap.c 28 Oct 2016 08:22:08 -0000 @@@@ -474,8 +474,10 @@@@ vaddr_t d2476 1 a2476 1 @@@@ -490,10 +492,19 @@@@ pmap_steal_memory(vsize_t size, vaddr_t d2505 11 a2515 2 +++ sys/arch/x68k/x68k/machdep.c 28 Oct 2016 08:22:08 -0000 @@@@ -553,7 +553,7 @@@@ cpu_init_kcore_hdr(void) d2524 1 a2524 1 @@@@ -604,11 +604,22 @@@@ cpu_init_kcore_hdr(void) d2552 1 a2552 1 @@@@ -1240,11 +1251,14 @@@@ cpu_intr_p(void) d2577 1 a2577 1 +++ sys/arch/x68k/x68k/pmap_bootstrap.c 28 Oct 2016 08:22:09 -0000 d2594 1 a2594 1 +++ sys/arch/x86/x86/x86_machdep.c 28 Oct 2016 08:22:09 -0000 d2603 15 @ 1.2 log @Immutable uvm_physmem_t test, shakedown of tests to make sure that the semantics are clear. Tested on amd64 @ text @a0 36 ? sys/arch/amd64/conf/kern.ldscript.2MB ? sys/arch/amd64/conf/largepages.inc ? sys/arch/amiga/dev/grfws.h ? sys/arch/arm/nvidia/tegra_car.c ? sys/arch/arm/nvidia/tegra_carreg.h ? sys/arch/arm/nvidia/tegra_dc.c ? sys/arch/arm/nvidia/tegra_ehcireg.h ? sys/arch/arm/nvidia/tegra_genfb.c ? sys/arch/arm/nvidia/tegra_hdmi.c ? sys/arch/arm/nvidia/tegra_host1x.c ? sys/arch/arm/nvidia/tegra_io.c ? sys/arch/arm/samsung/exynos4_loc.c ? sys/arch/arm/samsung/exynos4_reg.h ? sys/arch/arm/samsung/exynos5_loc.c ? sys/arch/arm/samsung/exynos_dma.c ? sys/arch/arm/samsung/exynos_io.c ? sys/arch/arm/samsung/exynos_io.h ? sys/arch/arm/samsung/exynos_space.c ? sys/arch/arm/samsung/exynos_usb.c ? sys/arch/evbarm/odroid ? sys/arch/evbarm/conf/JETSONTK1 ? sys/arch/evbarm/conf/JETSONTK1_INSTALL ? sys/arch/evbarm/conf/NYAN-BIG ? sys/arch/evbarm/conf/files.odroid ? sys/arch/evbarm/conf/mk.odroid ? sys/arch/evbarm/conf/std.odroid ? sys/arch/ia64/include/acpi_func.h ? sys/arch/ia64/stand/efi/include ? sys/arch/ia64/stand/ia64/efi/efi ? sys/arch/ia64/stand/ia64/efi/lib ? sys/arch/ia64/stand/ia64/ski/lib ? sys/arch/mips/mips/pmap.c ? sys/arch/mips/mips/pmap_segtab.c ? sys/arch/mips/mips/pmap_tlb.c ? sys/arch/x68k/stand/netboot/conf.c ? sys/arch/x68k/stand/netboot/version @ 1.1 log @Initial revision @ text @d1 36 d43 1 a43 1 +++ sys/arch/acorn26/acorn26/pmap.c 20 Oct 2016 14:14:36 -0000 d86 1 a86 1 +++ sys/arch/acorn26/acorn26/start.c 20 Oct 2016 14:14:36 -0000 d101 1 a101 1 +++ sys/arch/acorn26/vidc/arcvideo.c 20 Oct 2016 14:14:37 -0000 d116 1 a116 1 +++ sys/arch/alpha/alpha/machdep.c 20 Oct 2016 14:14:38 -0000 d184 1 a184 1 +++ sys/arch/alpha/alpha/pmap.c 20 Oct 2016 14:14:40 -0000 d278 1 a278 1 +++ sys/arch/amd64/amd64/machdep.c 20 Oct 2016 14:14:41 -0000 d410 1 a410 1 +++ sys/arch/amiga/amiga/machdep.c 20 Oct 2016 14:14:42 -0000 d426 1 a426 1 +++ sys/arch/arc/arc/machdep.c 20 Oct 2016 14:14:43 -0000 d441 1 a441 1 +++ sys/arch/arm/arm32/arm32_boot.c 20 Oct 2016 14:14:43 -0000 d456 1 a456 1 +++ sys/arch/arm/arm32/bus_dma.c 20 Oct 2016 14:14:44 -0000 d478 1 a478 1 +++ sys/arch/arm/arm32/pmap.c 20 Oct 2016 14:14:48 -0000 d496 1 a496 1 +++ sys/arch/cesfic/cesfic/machdep.c 20 Oct 2016 14:14:50 -0000 d520 1 a520 1 +++ sys/arch/cobalt/cobalt/machdep.c 20 Oct 2016 14:14:51 -0000 d535 1 a535 1 +++ sys/arch/dreamcast/dreamcast/machdep.c 20 Oct 2016 14:14:51 -0000 d551 1 a551 1 +++ sys/arch/emips/emips/machdep.c 20 Oct 2016 14:14:52 -0000 d566 1 a566 1 +++ sys/arch/i386/i386/machdep.c 20 Oct 2016 14:14:56 -0000 d650 1 a650 1 +++ sys/arch/ia64/ia64/machdep.c 20 Oct 2016 14:14:57 -0000 d686 1 a686 1 +++ sys/arch/ia64/ia64/pmap.c 20 Oct 2016 14:14:58 -0000 d826 1 a826 1 +++ sys/arch/iyonix/iyonix/iyonix_machdep.c 20 Oct 2016 14:14:59 -0000 d841 1 a841 1 +++ sys/arch/landisk/landisk/machdep.c 20 Oct 2016 14:14:59 -0000 d856 1 a856 1 +++ sys/arch/luna68k/luna68k/machdep.c 20 Oct 2016 14:15:00 -0000 d871 1 a871 1 +++ sys/arch/luna68k/luna68k/pmap_bootstrap.c 20 Oct 2016 14:15:00 -0000 d888 1 a888 1 +++ sys/arch/m68k/m68k/pmap_motorola.c 20 Oct 2016 14:15:01 -0000 d973 1 a973 1 +++ sys/arch/mac68k/mac68k/machdep.c 20 Oct 2016 14:15:03 -0000 d988 1 a988 1 +++ sys/arch/mips/include/pmap.h 20 Oct 2016 14:15:04 -0000 d1021 1 a1021 1 +++ sys/arch/mips/mips/mips_machdep.c 20 Oct 2016 14:15:05 -0000 d1095 1 a1095 1 +++ sys/arch/mips/mips/pmap_machdep.c 20 Oct 2016 14:15:05 -0000 d1130 1 a1130 1 +++ sys/arch/mipsco/mipsco/machdep.c 20 Oct 2016 14:15:06 -0000 d1145 1 a1145 1 +++ sys/arch/mmeye/mmeye/machdep.c 20 Oct 2016 14:15:06 -0000 d1160 1 a1160 1 +++ sys/arch/netwinder/netwinder/netwinder_machdep.c 20 Oct 2016 14:15:08 -0000 d1184 1 a1184 1 +++ sys/arch/news68k/news68k/machdep.c 20 Oct 2016 14:15:08 -0000 d1199 1 a1199 1 +++ sys/arch/news68k/news68k/pmap_bootstrap.c 20 Oct 2016 14:15:08 -0000 d1216 1 a1216 1 +++ sys/arch/newsmips/newsmips/machdep.c 20 Oct 2016 14:15:09 -0000 d1231 1 a1231 1 +++ sys/arch/next68k/next68k/machdep.c 20 Oct 2016 14:15:09 -0000 d1246 1 a1246 1 +++ sys/arch/next68k/next68k/pmap_bootstrap.c 20 Oct 2016 14:15:09 -0000 d1263 1 a1263 1 +++ sys/arch/powerpc/isa/isadma_machdep.c 20 Oct 2016 14:15:10 -0000 d1300 1 a1300 1 +++ sys/arch/powerpc/oea/pmap.c 20 Oct 2016 14:15:12 -0000 d1422 1 a1422 1 +++ sys/arch/powerpc/powerpc/bus_dma.c 20 Oct 2016 14:15:13 -0000 d1451 1 a1451 1 +++ sys/arch/sh3/sh3/pmap.c 20 Oct 2016 14:15:14 -0000 d1532 1 a1532 1 +++ sys/arch/sh3/sh3/vm_machdep.c 20 Oct 2016 14:15:14 -0000 d1556 1 a1556 1 +++ sys/arch/vax/vax/ka650.c 20 Oct 2016 14:15:16 -0000 d1572 1 a1572 1 +++ sys/arch/vax/vax/pmap.c 20 Oct 2016 14:15:17 -0000 d1615 1 a1615 1 +++ sys/arch/x68k/x68k/machdep.c 20 Oct 2016 14:15:18 -0000 d1678 1 a1678 1 +++ sys/arch/x68k/x68k/pmap_bootstrap.c 20 Oct 2016 14:15:19 -0000 d1695 1 a1695 1 +++ sys/arch/x86/x86/x86_machdep.c 20 Oct 2016 14:15:19 -0000 @