From owner-svn-src-head@freebsd.org Wed Nov 22 14:11:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FEF9DEC89B; Wed, 22 Nov 2017 14:11:00 +0000 (UTC) (envelope-from br@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 mx1.freebsd.org (Postfix) with ESMTPS id CDF1E7BAB6; Wed, 22 Nov 2017 14:10:59 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAMEAwUr007789; Wed, 22 Nov 2017 14:10:58 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMEAw7k007788; Wed, 22 Nov 2017 14:10:58 GMT (envelope-from br@FreeBSD.org) Message-Id: <201711221410.vAMEAw7k007788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 22 Nov 2017 14:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326092 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 326092 X-SVN-Commit-Repository: base 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.25 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: Wed, 22 Nov 2017 14:11:00 -0000 Author: br Date: Wed Nov 22 14:10:58 2017 New Revision: 326092 URL: https://svnweb.freebsd.org/changeset/base/326092 Log: o Invalidate the correct page in pmap_protect(). With this bug fix we don't need to invalidate all the entries. o Remove a call to pmap_invalidate_all(). This was never called as the anyvalid variable is never set. Obtained from: arm64/pmap.c (r322797, r322800) Sponsored by: DARPA, AFRL Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Wed Nov 22 14:06:40 2017 (r326091) +++ head/sys/riscv/riscv/pmap.c Wed Nov 22 14:10:58 2017 (r326092) @@ -1804,7 +1804,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t pd_entry_t *l1, *l2; pt_entry_t l3_pte, *l3; struct spglist free; - int anyvalid; /* * Perform an unsynchronized read. This is, however, safe. @@ -1812,7 +1811,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t if (pmap->pm_stats.resident_count == 0) return; - anyvalid = 0; SLIST_INIT(&free); rw_rlock(&pvh_global_lock); @@ -1885,8 +1883,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t } if (lock != NULL) rw_wunlock(lock); - if (anyvalid) - pmap_invalidate_all(pmap); rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); pmap_free_zero_pages(&free); @@ -2014,14 +2010,11 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t pmap_load_store(l3p, entry); PTE_SYNC(l3p); /* XXX: Use pmap_invalidate_range */ - pmap_invalidate_page(pmap, va); + pmap_invalidate_page(pmap, sva); } } } PMAP_UNLOCK(pmap); - - /* TODO: Only invalidate entries we are touching */ - pmap_invalidate_all(pmap); } /*