From owner-svn-src-all@freebsd.org Mon Aug 22 10:50:31 2016 Return-Path: Delivered-To: svn-src-all@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 7E170BC0D41; Mon, 22 Aug 2016 10:50:31 +0000 (UTC) (envelope-from andrew@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 415411B07; Mon, 22 Aug 2016 10:50:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MAoU3p081132; Mon, 22 Aug 2016 10:50:30 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MAoUuS081131; Mon, 22 Aug 2016 10:50:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608221050.u7MAoUuS081131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 22 Aug 2016 10:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304598 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 10:50:31 -0000 Author: andrew Date: Mon Aug 22 10:50:30 2016 New Revision: 304598 URL: https://svnweb.freebsd.org/changeset/base/304598 Log: Add a size argument to pmap_update_entry. Make use of this in pmap_promote_l2. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Aug 22 10:21:25 2016 (r304597) +++ head/sys/arm64/arm64/pmap.c Mon Aug 22 10:50:30 2016 (r304598) @@ -2258,7 +2258,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv */ static void pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_entry_t newpte, - vm_offset_t va) + vm_offset_t va, vm_size_t size) { register_t intr; @@ -2275,7 +2275,7 @@ pmap_update_entry(pmap_t pmap, pd_entry_ /* Clear the old mapping */ pmap_load_clear(pte); PTE_SYNC(pte); - pmap_invalidate_page(pmap, va); + pmap_invalidate_range(pmap, va, size); /* Create the new mapping */ pmap_load_store(pte, newpte); @@ -2297,11 +2297,12 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t struct rwlock **lockp) { pt_entry_t *firstl3, *l3, newl2, oldl3, pa; - register_t intr; + vm_offset_t sva; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - firstl3 = (pt_entry_t *)PHYS_TO_DMAP(pmap_load(l2) & ~ATTR_MASK); + sva = va & ~L2_OFFSET; + firstl3 = pmap_l2_to_l3(l2, sva); newl2 = pmap_load(firstl3); /* Ignore managed pages for now */ if ((newl2 & ATTR_SW_MANAGED) != 0) @@ -2322,26 +2323,7 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t newl2 &= ~ATTR_DESCR_MASK; newl2 |= L2_BLOCK; - /* - * Ensure we don't get switched out with the page table in an - * inconsistent state. We also need to ensure no interrupts fire - * as they may make use of an address we are about to invalidate. - */ - intr = intr_disable(); - critical_enter(); - - /* Clear the old mapping */ - pmap_load_clear(l2); - PTE_SYNC(l2); - pmap_invalidate_range(pmap, rounddown2(va, L2_SIZE), - roundup2(va, L2_SIZE)); - - /* Create the new mapping */ - pmap_load_store(l2, newl2); - PTE_SYNC(l2); - - critical_exit(); - intr_restore(intr); + pmap_update_entry(pmap, l2, newl2, sva, L2_SIZE); } /* @@ -3621,7 +3603,8 @@ pmap_change_attr_locked(vm_offset_t va, l3 &= ~ATTR_IDX_MASK; l3 |= ATTR_IDX(mode); - pmap_update_entry(kernel_pmap, pte, l3, tmpva); + pmap_update_entry(kernel_pmap, pte, l3, tmpva, + PAGE_SIZE); /* * If moving to a non-cacheable entry flush @@ -3693,7 +3676,7 @@ pmap_demote_l1(pmap_t pmap, pt_entry_t * l1 = (pt_entry_t *)(tmpl1 + ((vm_offset_t)l1 & PAGE_MASK)); } - pmap_update_entry(pmap, l1, l2phys | L1_TABLE, va); + pmap_update_entry(pmap, l1, l2phys | L1_TABLE, va, PAGE_SIZE); if (tmpl1 != 0) { pmap_kremove(tmpl1); @@ -3760,7 +3743,7 @@ pmap_demote_l2_locked(pmap_t pmap, pt_en l2 = (pt_entry_t *)(tmpl2 + ((vm_offset_t)l2 & PAGE_MASK)); } - pmap_update_entry(pmap, l2, l3phys | L2_TABLE, va); + pmap_update_entry(pmap, l2, l3phys | L2_TABLE, va, PAGE_SIZE); if (tmpl2 != 0) { pmap_kremove(tmpl2);