From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 9 12:14:49 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4A06106566C; Wed, 9 Mar 2011 12:14:49 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2CDE8FC1B; Wed, 9 Mar 2011 12:14:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p29CEnGg008509; Wed, 9 Mar 2011 12:14:49 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29CEnsA008505; Wed, 9 Mar 2011 12:14:49 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201103091214.p29CEnsA008505@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 9 Mar 2011 12:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219425 - in stable/8/sys: amd64/amd64 vm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2011 12:14:50 -0000 Author: pluknet Date: Wed Mar 9 12:14:49 2011 New Revision: 219425 URL: http://svn.freebsd.org/changeset/base/219425 Log: MFC r202897,r208164,r212174: msgbufp mapping changes on amd64. r202897 by alc: Simplify the mapping of the system message buffer. Use the direct map just like ia64 does. r208164 by alc: Correct an error of omission in r202897: Now that amd64 uses the direct map to access the message buffer, we must explicitly request that the underlying physical pages are included in a crash dump. r212174 by avg: vm_page.c: include opt_msgbuf.h for MSGBUF_SIZE use in vm_page_startup Approved by: alc, kib (mentor), avg (mentor) Modified: stable/8/sys/amd64/amd64/machdep.c stable/8/sys/amd64/amd64/pmap.c stable/8/sys/vm/vm_page.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Wed Mar 9 07:43:51 2011 (r219424) +++ stable/8/sys/amd64/amd64/machdep.c Wed Mar 9 12:14:49 2011 (r219425) @@ -157,6 +157,8 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, extern vm_offset_t ksym_start, ksym_end; #endif +struct msgbuf *msgbufp; + /* Intel ICH registers */ #define ICH_PMBASE 0x400 #define ICH_SMI_EN ICH_PMBASE + 0x30 @@ -1288,7 +1290,7 @@ add_smap_entry(struct bios_smap *smap, v static void getmemsize(caddr_t kmdp, u_int64_t first) { - int i, off, physmap_idx, pa_indx, da_indx; + int i, physmap_idx, pa_indx, da_indx; vm_paddr_t pa, physmap[PHYSMAP_SIZE]; u_long physmem_tunable; pt_entry_t *pte; @@ -1521,9 +1523,7 @@ do_next: phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); /* Map the message buffer. */ - for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) - pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + - off); + msgbufp = (struct msgbuf *)PHYS_TO_DMAP(phys_avail[pa_indx]); } u_int64_t Modified: stable/8/sys/amd64/amd64/pmap.c ============================================================================== --- stable/8/sys/amd64/amd64/pmap.c Wed Mar 9 07:43:51 2011 (r219424) +++ stable/8/sys/amd64/amd64/pmap.c Wed Mar 9 12:14:49 2011 (r219425) @@ -105,7 +105,6 @@ __FBSDID("$FreeBSD$"); * and to when physical maps must be made correct. */ -#include "opt_msgbuf.h" #include "opt_pmap.h" #include "opt_vm.h" @@ -116,7 +115,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -211,7 +209,6 @@ static int shpgperproc = PMAP_SHPGPERPRO */ pt_entry_t *CMAP1 = 0; caddr_t CADDR1 = 0; -struct msgbuf *msgbufp = 0; /* * Crashdump maps. @@ -578,11 +575,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr) */ SYSMAP(caddr_t, unused, crashdumpmap, MAXDUMPPGS) - /* - * msgbufp is used to map the system message buffer. - */ - SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(MSGBUF_SIZE))) - virtual_avail = va; *CMAP1 = 0; Modified: stable/8/sys/vm/vm_page.c ============================================================================== --- stable/8/sys/vm/vm_page.c Wed Mar 9 07:43:51 2011 (r219424) +++ stable/8/sys/vm/vm_page.c Wed Mar 9 12:14:49 2011 (r219425) @@ -100,6 +100,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_msgbuf.h" #include "opt_vm.h" #include @@ -108,6 +109,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -313,6 +315,19 @@ vm_page_startup(vm_offset_t vaddr) new_end + vm_page_dump_size, VM_PROT_READ | VM_PROT_WRITE); bzero((void *)vm_page_dump, vm_page_dump_size); #endif +#ifdef __amd64__ + /* + * Request that the physical pages underlying the message buffer be + * included in a crash dump. Since the message buffer is accessed + * through the direct map, they are not automatically included. + */ + pa = DMAP_TO_PHYS((vm_offset_t)msgbufp->msg_ptr); + last_pa = pa + round_page(MSGBUF_SIZE); + while (pa < last_pa) { + dump_add_page(pa); + pa += PAGE_SIZE; + } +#endif /* * Compute the number of pages of memory that will be available for * use (taking into account the overhead of a page structure per