Date: Tue, 19 Sep 2006 23:16:34 GMT From: Suleiman Souhlal <ssouhlal@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 106367 for review Message-ID: <200609192316.k8JNGYZ7020860@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609192316.k8JNGYZ7020860>