From owner-svn-src-head@freebsd.org Mon Jan 7 23:17:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A39C514A27D1; Mon, 7 Jan 2019 23:17:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 092D9860CE; Mon, 7 Jan 2019 23:17:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB4F51ED24; Mon, 7 Jan 2019 23:17:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x07NH9tL032472; Mon, 7 Jan 2019 23:17:09 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x07NH98N032471; Mon, 7 Jan 2019 23:17:09 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901072317.x07NH98N032471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 7 Jan 2019 23:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342854 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 342854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 092D9860CE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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: Mon, 07 Jan 2019 23:17:10 -0000 Author: glebius Date: Mon Jan 7 23:17:09 2019 New Revision: 342854 URL: https://svnweb.freebsd.org/changeset/base/342854 Log: Fix regression in r331368, that broke dumping of UMA startup pages when WITNESS is present. Discussed with: markj Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Jan 7 22:10:48 2019 (r342853) +++ head/sys/vm/vm_page.c Mon Jan 7 23:17:09 2019 (r342854) @@ -553,6 +553,9 @@ vm_page_startup(vm_offset_t vaddr) vm_paddr_t biggestsize, last_pa, pa; u_long pagecount; int biggestone, i, segind; +#ifdef WITNESS + int witness_size; +#endif #if defined(__i386__) && defined(VM_PHYSSEG_DENSE) long ii; #endif @@ -620,11 +623,11 @@ vm_page_startup(vm_offset_t vaddr) uma_startup((void *)mapped, boot_pages); #ifdef WITNESS - end = new_end; - new_end = end - round_page(witness_startup_count()); - mapped = pmap_map(&vaddr, new_end, end, + witness_size = round_page(witness_startup_count()); + new_end -= witness_size; + mapped = pmap_map(&vaddr, new_end, new_end + witness_size, VM_PROT_READ | VM_PROT_WRITE); - bzero((void *)mapped, end - new_end); + bzero((void *)mapped, witness_size); witness_startup((void *)mapped); #endif @@ -656,9 +659,9 @@ vm_page_startup(vm_offset_t vaddr) #endif #if defined(__aarch64__) || defined(__amd64__) || defined(__mips__) /* - * Include the UMA bootstrap pages and vm_page_dump in a crash dump. - * When pmap_map() uses the direct map, they are not automatically - * included. + * Include the UMA bootstrap pages, witness pages and vm_page_dump + * in a crash dump. When pmap_map() uses the direct map, they are + * not automatically included. */ for (pa = new_end; pa < end; pa += PAGE_SIZE) dump_add_page(pa);