From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 26 21:08:10 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 10C4D1065670; Sat, 26 Feb 2011 21:08:10 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8CE48FC08; Sat, 26 Feb 2011 21:08:09 +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 p1QL89uR094984; Sat, 26 Feb 2011 21:08:09 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1QL89QW094982; Sat, 26 Feb 2011 21:08:09 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201102262108.p1QL89QW094982@svn.freebsd.org> From: Alan Cox Date: Sat, 26 Feb 2011 21:08:09 +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: r219063 - stable/8/sys/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: Sat, 26 Feb 2011 21:08:10 -0000 Author: alc Date: Sat Feb 26 21:08:09 2011 New Revision: 219063 URL: http://svn.freebsd.org/changeset/base/219063 Log: MFC r216090 Correct an error in the allocation of the vm_page_dump array in vm_page_startup(). Specifically, the dump_avail array should be used instead of the phys_avail array to calculate the size of vm_page_dump. Modified: 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/vm/vm_page.c ============================================================================== --- stable/8/sys/vm/vm_page.c Sat Feb 26 20:04:14 2011 (r219062) +++ stable/8/sys/vm/vm_page.c Sat Feb 26 21:08:09 2011 (r219063) @@ -220,7 +220,6 @@ vm_page_startup(vm_offset_t vaddr) vm_paddr_t new_end; int i; vm_paddr_t pa; - int nblocks; vm_paddr_t last_pa; char *list; @@ -232,7 +231,6 @@ vm_page_startup(vm_offset_t vaddr) biggestsize = 0; biggestone = 0; - nblocks = 0; vaddr = round_page(vaddr); for (i = 0; phys_avail[i + 1]; i += 2) { @@ -254,7 +252,6 @@ vm_page_startup(vm_offset_t vaddr) low_water = phys_avail[i]; if (phys_avail[i + 1] > high_water) high_water = phys_avail[i + 1]; - ++nblocks; } #ifdef XEN @@ -305,7 +302,11 @@ vm_page_startup(vm_offset_t vaddr) * minidump code. In theory, they are not needed on i386, but are * included should the sf_buf code decide to use them. */ - page_range = phys_avail[(nblocks - 1) * 2 + 1] / PAGE_SIZE; + last_pa = 0; + for (i = 0; dump_avail[i + 1] != 0; i += 2) + if (dump_avail[i + 1] > last_pa) + last_pa = dump_avail[i + 1]; + page_range = last_pa / PAGE_SIZE; vm_page_dump_size = round_page(roundup2(page_range, NBBY) / NBBY); new_end -= vm_page_dump_size; vm_page_dump = (void *)(uintptr_t)pmap_map(&vaddr, new_end,