From owner-svn-src-all@freebsd.org Wed Dec 16 13:44:40 2015 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 19415A48D64; Wed, 16 Dec 2015 13:44:40 +0000 (UTC) (envelope-from skra@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 BF25C1E17; Wed, 16 Dec 2015 13:44:14 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGAtK6o079810; Wed, 16 Dec 2015 10:55:20 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGAtJI2079809; Wed, 16 Dec 2015 10:55:19 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201512161055.tBGAtJI2079809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Wed, 16 Dec 2015 10:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292334 - head/sys/arm/arm 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.20 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: Wed, 16 Dec 2015 13:44:40 -0000 Author: skra Date: Wed Dec 16 10:55:19 2015 New Revision: 292334 URL: https://svnweb.freebsd.org/changeset/base/292334 Log: Adopt assert from amd64 in pmap_remove_pages(). Suggested by: kib Approved by: kib (mentor) Modified: head/sys/arm/arm/pmap-v6-new.c Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Wed Dec 16 10:14:16 2015 (r292333) +++ head/sys/arm/arm/pmap-v6-new.c Wed Dec 16 10:55:19 2015 (r292334) @@ -4153,10 +4153,25 @@ pmap_remove_pages(pmap_t pmap) uint32_t inuse, bitmask; boolean_t allfree; - if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) { - printf("warning: %s called with non-current pmap\n", __func__); - return; + /* + * Assert that the given pmap is only active on the current + * CPU. Unfortunately, we cannot block another CPU from + * activating the pmap while this function is executing. + */ + KASSERT(pmap == vmspace_pmap(curthread->td_proc->p_vmspace), + ("%s: non-current pmap %p", __func__, pmap)); +#if defined(SMP) && defined(INVARIANTS) + { + cpuset_t other_cpus; + + sched_pin(); + other_cpus = pmap->pm_active; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); + sched_unpin(); + KASSERT(CPU_EMPTY(&other_cpus), + ("%s: pmap %p active on other cpus", __func__, pmap)); } +#endif SLIST_INIT(&free); rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap);