From owner-svn-src-head@FreeBSD.ORG Tue Feb 11 22:02:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D991FCDD; Tue, 11 Feb 2014 22:02:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B76FD1779; Tue, 11 Feb 2014 22:02:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1BM2fgs009392; Tue, 11 Feb 2014 22:02:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1BM2eaL009384; Tue, 11 Feb 2014 22:02:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402112202.s1BM2eaL009384@svn.freebsd.org> From: John Baldwin Date: Tue, 11 Feb 2014 22:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261781 - in head/sys: amd64/amd64 i386/i386 i386/include i386/xen pc98/pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Feb 2014 22:02:41 -0000 Author: jhb Date: Tue Feb 11 22:02:40 2014 New Revision: 261781 URL: http://svnweb.freebsd.org/changeset/base/261781 Log: Don't waste a page of KVA for the boot-time memory test on x86. For amd64, reuse the first page of the crashdumpmap as CMAP1/CADDR1. For i386, remove CMAP1/CADDR1 entirely and reuse CMAP3/CADDR3 for the memory test. Reviewed by: alc, peter MFC after: 2 weeks Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/machdep.c head/sys/i386/i386/pmap.c head/sys/i386/include/pmap.h head/sys/i386/xen/pmap.c head/sys/pc98/pc98/machdep.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Feb 11 21:57:37 2014 (r261780) +++ head/sys/amd64/amd64/pmap.c Tue Feb 11 22:02:40 2014 (r261781) @@ -812,7 +812,7 @@ void pmap_bootstrap(vm_paddr_t *firstaddr) { vm_offset_t va; - pt_entry_t *pte, *unused; + pt_entry_t *pte; /* * Create an initial set of page tables to run the kernel in. @@ -858,14 +858,11 @@ pmap_bootstrap(vm_paddr_t *firstaddr) pte = vtopte(va); /* - * CMAP1 is only used for the memory test. - */ - SYSMAP(caddr_t, CMAP1, CADDR1, 1) - - /* - * Crashdump maps. + * Crashdump maps. The first page is reused as CMAP1 for the + * memory test. */ - SYSMAP(caddr_t, unused, crashdumpmap, MAXDUMPPGS) + SYSMAP(caddr_t, CMAP1, crashdumpmap, MAXDUMPPGS) + CADDR1 = crashdumpmap; virtual_avail = va; Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Feb 11 21:57:37 2014 (r261780) +++ head/sys/i386/i386/machdep.c Tue Feb 11 22:02:40 2014 (r261781) @@ -2403,7 +2403,7 @@ physmap_done: phys_avail[pa_indx++] = physmap[0]; phys_avail[pa_indx] = physmap[0]; dump_avail[da_indx] = physmap[0]; - pte = CMAP1; + pte = CMAP3; /* * Get dcons buffer address @@ -2425,7 +2425,7 @@ physmap_done: end = trunc_page(physmap[i + 1]); for (pa = round_page(physmap[i]); pa < end; pa += PAGE_SIZE) { int tmp, page_bad, full; - int *ptr = (int *)CADDR1; + int *ptr = (int *)CADDR3; full = FALSE; /* Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Tue Feb 11 21:57:37 2014 (r261780) +++ head/sys/i386/i386/pmap.c Tue Feb 11 22:02:40 2014 (r261781) @@ -256,11 +256,10 @@ struct sysmaps { caddr_t CADDR2; }; static struct sysmaps sysmaps_pcpu[MAXCPU]; -pt_entry_t *CMAP1 = 0; -static pt_entry_t *CMAP3; +pt_entry_t *CMAP3; static pd_entry_t *KPTD; -caddr_t CADDR1 = 0, ptvmmap = 0; -static caddr_t CADDR3; +caddr_t ptvmmap = 0; +caddr_t CADDR3; struct msgbuf *msgbufp = 0; /* @@ -434,7 +433,6 @@ pmap_bootstrap(vm_paddr_t firstaddr) SYSMAP(caddr_t, sysmaps->CMAP1, sysmaps->CADDR1, 1) SYSMAP(caddr_t, sysmaps->CMAP2, sysmaps->CADDR2, 1) } - SYSMAP(caddr_t, CMAP1, CADDR1, 1) SYSMAP(caddr_t, CMAP3, CADDR3, 1) /* Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Tue Feb 11 21:57:37 2014 (r261780) +++ head/sys/i386/include/pmap.h Tue Feb 11 22:02:40 2014 (r261781) @@ -420,8 +420,8 @@ struct pv_chunk { #ifdef _KERNEL -extern caddr_t CADDR1; -extern pt_entry_t *CMAP1; +extern caddr_t CADDR3; +extern pt_entry_t *CMAP3; extern vm_paddr_t phys_avail[]; extern vm_paddr_t dump_avail[]; extern int pseflag; Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Tue Feb 11 21:57:37 2014 (r261780) +++ head/sys/i386/xen/pmap.c Tue Feb 11 22:02:40 2014 (r261781) @@ -249,9 +249,9 @@ struct sysmaps { caddr_t CADDR2; }; static struct sysmaps sysmaps_pcpu[MAXCPU]; -static pt_entry_t *CMAP3; +pt_entry_t *CMAP3; caddr_t ptvmmap = 0; -static caddr_t CADDR3; +caddr_t CADDR3; struct msgbuf *msgbufp = 0; /* Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Tue Feb 11 21:57:37 2014 (r261780) +++ head/sys/pc98/pc98/machdep.c Tue Feb 11 22:02:40 2014 (r261781) @@ -1961,7 +1961,7 @@ getmemsize(int first) phys_avail[pa_indx++] = physmap[0]; phys_avail[pa_indx] = physmap[0]; dump_avail[da_indx] = physmap[0]; - pte = CMAP1; + pte = CMAP3; /* * Get dcons buffer address @@ -1982,7 +1982,7 @@ getmemsize(int first) end = trunc_page(physmap[i + 1]); for (pa = round_page(physmap[i]); pa < end; pa += PAGE_SIZE) { int tmp, page_bad, full; - int *ptr = (int *)CADDR1; + int *ptr = (int *)CADDR3; full = FALSE; /*