From owner-svn-src-all@freebsd.org Tue Aug 30 16:45:17 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 2DE6BBC8336; Tue, 30 Aug 2016 16:45:17 +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 EC541A16; Tue, 30 Aug 2016 16:45:16 +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 u7UGjGK2059228; Tue, 30 Aug 2016 16:45:16 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UGjGtF059227; Tue, 30 Aug 2016 16:45:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608301645.u7UGjGtF059227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 30 Aug 2016 16:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305071 - 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: Tue, 30 Aug 2016 16:45:17 -0000 Author: andrew Date: Tue Aug 30 16:45:15 2016 New Revision: 305071 URL: https://svnweb.freebsd.org/changeset/base/305071 Log: Because we need to use a break-before-make sequence when promoting pages there is a short period where functions that walk the kernel page table without locking them may see an invalid entry. One solution would be to add locking to these functions, however some may be called from locations where we are unable to sleep. Until a better solution can be found stop promoting pages in the kernel pmap so these functions work as expected. 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 Tue Aug 30 16:43:24 2016 (r305070) +++ head/sys/arm64/arm64/pmap.c Tue Aug 30 16:45:15 2016 (r305071) @@ -2936,14 +2936,17 @@ validate: PTE_SYNC(l3); pmap_invalidate_page(pmap, va); - if ((pmap != pmap_kernel()) && (pmap == &curproc->p_vmspace->vm_pmap)) - cpu_icache_sync_range(va, PAGE_SIZE); - - if ((mpte == NULL || mpte->wire_count == NL3PG) && - pmap_superpages_enabled() && (m->flags & PG_FICTITIOUS) == 0 && - vm_reserv_level_iffullpop(m) == 0) { - KASSERT(lvl == 2, ("Invalid pde level %d", lvl)); - pmap_promote_l2(pmap, pde, va, &lock); + if (pmap != pmap_kernel()) { + if (pmap == &curproc->p_vmspace->vm_pmap) + cpu_icache_sync_range(va, PAGE_SIZE); + + if ((mpte == NULL || mpte->wire_count == NL3PG) && + pmap_superpages_enabled() && + (m->flags & PG_FICTITIOUS) == 0 && + vm_reserv_level_iffullpop(m) == 0) { + KASSERT(lvl == 2, ("Invalid pde level %d", lvl)); + pmap_promote_l2(pmap, pde, va, &lock); + } } if (lock != NULL)