From owner-p4-projects@FreeBSD.ORG Tue Sep 19 23:16:35 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4C44816A47C; Tue, 19 Sep 2006 23:16:35 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0630E16A407 for ; Tue, 19 Sep 2006 23:16:35 +0000 (UTC) (envelope-from ssouhlal@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C2CDA43D53 for ; Tue, 19 Sep 2006 23:16:34 +0000 (GMT) (envelope-from ssouhlal@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8JNGYqI020863 for ; Tue, 19 Sep 2006 23:16:34 GMT (envelope-from ssouhlal@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8JNGYZ7020860 for perforce@freebsd.org; Tue, 19 Sep 2006 23:16:34 GMT (envelope-from ssouhlal@freebsd.org) Date: Tue, 19 Sep 2006 23:16:34 GMT Message-Id: <200609192316.k8JNGYZ7020860@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ssouhlal@freebsd.org using -f From: Suleiman Souhlal To: Perforce Change Reviews Cc: Subject: PERFORCE change 106367 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Sep 2006 23:16:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=106367 Change 106367 by ssouhlal@ssouhlal-maho on 2006/09/19 23:15:45 Make the TLB Modified exception handler work for !kernel. Affected files ... .. //depot/projects/mips2/src/sys/mips/include/tlb.h#4 edit .. //depot/projects/mips2/src/sys/mips/mips/tlb.c#8 edit .. //depot/projects/mips2/src/sys/mips/mips/trap.c#7 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/include/tlb.h#4 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/mips2/src/sys/mips/include/tlb.h#3 $ + * $P4: //depot/projects/mips2/src/sys/mips/include/tlb.h#4 $ */ #ifndef _MACHINE_TLB_H_ @@ -40,7 +40,7 @@ void tlb_invalidate_all(void); void tlb_invalidate_one(int); void tlb_invalidate_page(vm_offset_t); -void tlb_modified(void *); +void tlb_modified(pmap_t, void *); void tlb_remove(pmap_t, vm_offset_t); void tlb_remove_pages(pmap_t, vm_offset_t, int); void tlb_remove_range(pmap_t, vm_offset_t, vm_offset_t); ==== //depot/projects/mips2/src/sys/mips/mips/tlb.c#8 (text+ko) ==== @@ -246,13 +246,13 @@ * PTE was not dirty and is being written to. XXX kernel only for now. */ void -tlb_modified(void *badvaddr) +tlb_modified(pmap_t pmap, void *badvaddr) { pt_entry_t *pte; vm_offset_t va; va = (vm_offset_t) badvaddr; - pte = tlb_pte_find(kernel_pmap->pm_lev1, va); + pte = pmap_pte(pmap, va); /* * Do we really want to dirty this page? ==== //depot/projects/mips2/src/sys/mips/mips/trap.c#7 (text+ko) ==== @@ -122,8 +122,12 @@ */ switch (code) { case TrMod: - /* XXX Kernel only. */ - tlb_modified(badvaddr); + va = trunc_page(badvaddr); + if (va >= KERNBASE) + tlb_modified(kernel_pmap, (void *)va); + else + tlb_modified(&curthread->td_proc->p_vmspace->vm_pmap, + (void *)va); goto done; case TrTLBL: case TrTLBS: