From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 18:24:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88AFD106564A; Mon, 22 Mar 2010 18:24:43 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B96B8FC16; Mon, 22 Mar 2010 18:24:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MIOhWf003186; Mon, 22 Mar 2010 18:24:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MIOh2q003185; Mon, 22 Mar 2010 18:24:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003221824.o2MIOh2q003185@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 22 Mar 2010 18:24:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205454 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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, 22 Mar 2010 18:24:43 -0000 Author: marcel Date: Mon Mar 22 18:24:42 2010 New Revision: 205454 URL: http://svn.freebsd.org/changeset/base/205454 Log: o Remove the pmap argument to pmap_invalidate_all() as it's not used other than in a potentially dangerous KASSERT. o Hand-inline pmap_remove_page() as it's only called from 1 place and the abstraction that pmap_remove_page() provides is not enough to warrant the obfuscation. Eliminate the dangerous KASSERT in the process. o In pmap_remove_pte(), remove the KASSERT for pmap being the current one as it's not safe in the face of CPU migration. Modified: head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Mon Mar 22 17:57:00 2010 (r205453) +++ head/sys/ia64/ia64/pmap.c Mon Mar 22 18:24:42 2010 (r205454) @@ -238,7 +238,7 @@ static pv_entry_t get_pv_entry(pmap_t lo static void pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot); static void pmap_free_pte(struct ia64_lpte *pte, vm_offset_t va); -static void pmap_invalidate_all(pmap_t pmap); +static void pmap_invalidate_all(void); static int pmap_remove_pte(pmap_t pmap, struct ia64_lpte *pte, vm_offset_t va, pv_entry_t pv, int freepte); static int pmap_remove_vhpt(vm_offset_t va); @@ -475,7 +475,7 @@ pmap_bootstrap() /* * Clear out any random TLB entries left over from booting. */ - pmap_invalidate_all(kernel_pmap); + pmap_invalidate_all(); map_gateway_page(); } @@ -575,16 +575,14 @@ pmap_invalidate_all_1(void *arg) } static void -pmap_invalidate_all(pmap_t pmap) +pmap_invalidate_all(void) { - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), - ("invalidating TLB for non-current pmap")); - #ifdef SMP - if (mp_ncpus > 1) + if (mp_ncpus > 1) { smp_rendezvous(NULL, pmap_invalidate_all_1, NULL, NULL); - else + return; + } #endif pmap_invalidate_all_1(NULL); } @@ -1158,9 +1156,6 @@ pmap_remove_pte(pmap_t pmap, struct ia64 int error; vm_page_t m; - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), - ("removing pte for non-current pmap")); - /* * First remove from the VHPT. */ @@ -1319,23 +1314,6 @@ pmap_map(vm_offset_t *virt, vm_offset_t } /* - * Remove a single page from a process address space - */ -static void -pmap_remove_page(pmap_t pmap, vm_offset_t va) -{ - struct ia64_lpte *pte; - - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), - ("removing page for non-current pmap")); - - pte = pmap_find_vhpt(va); - if (pte != NULL) - pmap_remove_pte(pmap, pte, va, 0, 1); - return; -} - -/* * Remove the given range of addresses from the specified map. * * It is assumed that the start and end are properly @@ -1362,7 +1340,9 @@ pmap_remove(pmap_t pmap, vm_offset_t sva * code. */ if (sva + PAGE_SIZE == eva) { - pmap_remove_page(pmap, sva); + pte = pmap_find_vhpt(sva); + if (pte != NULL) + pmap_remove_pte(pmap, pte, sva, 0, 1); goto out; } @@ -1927,7 +1907,8 @@ pmap_remove_pages(pmap_t pmap) pv_entry_t pv, npv; if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) { - printf("warning: pmap_remove_pages called with non-current pmap\n"); + printf("warning: %s called with non-current pmap\n", + __func__); return; }