Date: Mon, 6 Mar 2006 23:02:35 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 92883 for review Message-ID: <200603062302.k26N2ZoP013012@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=92883 Change 92883 by kmacy@kmacy_storage:sun4v_work on 2006/03/06 23:01:35 move data protection fault TLB flush inline Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#19 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#19 (text+ko) ==== @@ -261,8 +261,10 @@ .macro insn_miss GET_MMFSA_SCRATCH(%g1) ! insn 1 - GET_HASH_SCRATCH(%g2) ! insn 2,3 - ba,pt %xcc, tsb_miss + ldda [%g0 + %g1]ASI_LDTD_REAL, %g4 + addx %g1, 0x10, %g1 + ldda [%g0 + %g1]ASI_LDTD_REAL, %g6 + ba,pt %xcc, tsb_miss_handler mov VTD_REF, %g3 .align 32 .endm @@ -274,19 +276,25 @@ .endm .macro data_miss - GET_MMFSA_SCRATCH(%g1) ! insn 1 - GET_HASH_SCRATCH(%g2) ! insn 2,3 - add %g1, MMFSA_D_, %g1 ! set fsa to data - ba,pt %xcc, tsb_miss + GET_MMFSA_SCRATCH(%g1) ! insn 1 + add %g1, MMFSA_D_, %g1 ! set fsa to data + ldda [%g0 + %g1]ASI_LDTD_REAL, %g4 + addx %g1, 0x10, %g1 + ldda [%g0 + %g1]ASI_LDTD_REAL, %g6 + ba,pt %xcc, tsb_miss_handler mov VTD_REF, %g3 .align 32 .endm .macro data_prot GET_MMFSA_SCRATCH(%g1) ! insn 1 - GET_HASH_SCRATCH(%g2) ! insn 2,3 add %g1, MMFSA_D_, %g1 ! set fsa to data - ba,pt %xcc, tsb_miss + ldda [%g0 + %g1]ASI_LDTD_REAL, %g4 + addx %g1, 0x10, %g1 + ldda [%g0 + %g1]ASI_LDTD_REAL, %g6 + ! XXX patch this to branch to the tsb_miss_handler + ! on fixed revs of the HV + ba,pt %xcc, data_prot_handler mov VTD_W, %g3 .align 32 .endm @@ -1025,69 +1033,44 @@ END(tl0_intr) -! The HV documentation is wrong -! mappings are not already flushed befor taking a -! data protection trap -! IN: -! %g2 == hash base -! %g3 == flags -! %g5 == fault addr -! %g6 == context -! %g1,%g4,%g7 temps -! OUT: -! %g6 <- TAG -ontario_unmap_addr_errata_begin: - ! do the unmap call - mov %o0, %g1 - mov %o1, %g4 - mov %o2, %g7 - mov %g5, %o0 - mov %g6, %o1 - mov MAP_ITLB|MAP_DTLB, %o2 - ta MMU_UNMAP_ADDR - mov %g1, %o0 - mov %g4, %o1 - mov %g7, %o2 - srlx %g5, TTARGET_VA_SHIFT, %g4 - sllx %g6, TTARGET_CTX_SHIFT, %g6 - ba,pt %xcc, tsb_miss_fault_handler - or %g6, %g4, %g6 -ontario_unmap_addr_errata_end: + -! %g1==mmfsa (RA) -! %g2==hash base (VA) ! %g3==TTE flags +! %g4==fault type (if data miss) +! %g5==fault addr +! %g6==context ! internal usage: ! %g1==absolute index -! %g2==pointer to hash entry +! %g2==hash base, pointer to hash entry ! %g3==flag bits, TSB (RA) ! %g4==fault type,entry tag ! %g5==tag ! %g6==hash size, temp ! %g7 temp -ENTRY(tsb_miss) - ldda [%g0 + %g1]ASI_LDTD_REAL, %g4 - addx %g1, 0x10, %g1 - ldda [%g0 + %g1]ASI_LDTD_REAL, %g6 +ENTRY(data_prot_handler) +! The HV documentation is wrong mappings are not already +! flushed before taking a data protection trap + mov %o0, %g1 + mov %o1, %g4 ! fault type not set on prot fault + mov %o2, %g7 + mov %g5, %o0 + mov %g6, %o1 + mov MAP_ITLB|MAP_DTLB, %o2 + ta MMU_UNMAP_ADDR + mov %g1, %o0 + mov %g4, %o1 + mov %g7, %o2 +ENTRY(tsb_miss_handler) MAGIC_TRAP_ON -/* these two instructions will be patched - * at some point - */ -#ifdef ONTARIO_UNMAP_ERRATA - cmp %g3, VTD_W - be,pn %xcc, ontario_unmap_addr_errata_begin -#endif - srlx %g5, TTARGET_VA_SHIFT, %g1 + + srlx %g5, TTARGET_VA_SHIFT, %g1 sllx %g6, TTARGET_CTX_SHIFT, %g6 or %g6, %g1, %g6 ! %g6 == search tag - -tsb_miss_fault_handler: - ! %g4 == fault type %g5 == fault addr %g6 == tag - ! XXX only handle normal miss for now + ! XXX only handle normal miss for now (look at fault type in the future) #ifdef PMAP_DEBUG cmp %g6, %g0 ! NULL ptr deref in kernel bne,pt %xcc, 4f @@ -1096,10 +1079,11 @@ illtrap ! give up 4: #endif - mov 1, %g7 + mov 1, %g7 sllx %g7, PAGE_SHIFT, %g7 sub %g7, 1, %g7 ! %g7==PAGE_MASK + GET_HASH_SCRATCH(%g2) ! insn 2,3 and %g2, %g7, %g4 ! size stored in lower 13 bits andn %g2, %g7, %g2 ! actual VA of hash @@ -1209,7 +1193,8 @@ MAGIC_TRAP_OFF retry -END(tsb_miss) +END(tsb_miss_handler) +END(data_prot_handler) /* * Write to read-only page
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603062302.k26N2ZoP013012>