Date: Thu, 16 Mar 2006 08:53:30 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 93387 for review Message-ID: <200603160853.k2G8rUnJ050033@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=93387 Change 93387 by kmacy@kmacy_storage:sun4v_work on 2006/03/16 08:52:30 implement fault handling for a couple of register spill / fill handlers make sure that the others cause us to exit Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/wbuf.S#4 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/wbuf.S#4 (text+ko) ==== @@ -9,24 +9,46 @@ #include "assym.s" ENTRY(fault_32bit_sn0) + MAGIC_TRAP_ON + MAGIC_EXIT END(fault_32bit_sn0) ENTRY(fault_32bit_sn1) + MAGIC_TRAP_ON + MAGIC_EXIT END(fault_32bit_sn1) ENTRY(fault_32bit_so0) + MAGIC_TRAP_ON + MAGIC_EXIT END(fault_32bit_so0) ENTRY(fault_32bit_so1) + MAGIC_TRAP_ON + MAGIC_EXIT END(fault_32bit_so1) ENTRY(fault_64bit_sn0) + MAGIC_TRAP_ON + MAGIC_EXIT END(fault_64bit_sn0) ENTRY(fault_64bit_sn1) + /* XXX need to use physical addresses here */ + GET_PCB(%g6) + stx %sp, [%g6 + PCB_RWSP] + SPILL(stx, %g6 + PCB_RW, 8) + mov 1, %g5 + stx %g5, [%g6 + PCB_NSAVED] + saved + set tl0_trap, %g5 + wrpr %g5, %tnpc + done END(fault_64bit_sn1) ENTRY(fault_32bit_sk) + MAGIC_TRAP_ON + MAGIC_EXIT END(fault_32bit_sk) ENTRY(fault_64bit_sk) @@ -42,41 +64,85 @@ ENTRY(fault_64bit_so0) + GET_PCB(%g6) + ld [%g6 + PCB_NSAVED], %g2 + add %g2, 1, %g3 + stx %g3, [%g6 + PCB_NSAVED] + + sll %g2, PTR_SHIFT, %g4 + add %g6, PCB_RWSP, %g3 + stx %sp, [%g3 + %g4] + sll %g2, RW_SHIFT, %g4 + add %g4, %g6, %g4 + add %g4, PCB_RW, %g3 + SAVE_WINDOW(%g3) + saved + retry END(fault_64bit_so0) ENTRY(fault_64bit_so1) + MAGIC_TRAP_ON + MAGIC_EXIT END(fault_64bit_so1) ENTRY(fault_32bit_fn0) - + MAGIC_TRAP_ON + MAGIC_EXIT fault_fn0_common: END(fault_32bit_fn0) - + MAGIC_TRAP_ON + MAGIC_EXIT ENTRY(fault_32bit_fn1) + MAGIC_TRAP_ON + MAGIC_EXIT +fault_fn1_common: + rdpr %tstate, %g1 + and %g1, TSTATE_CWP_MASK, %g1 + wrpr %g0, %g1, %cwp + ! + ! fake tl1 traps regs so that after pagefault runs, we + ! re-execute at user_rtt. + ! + wrpr %g0, 1, %tl + set TSTATE_KERNEL | TSTATE_IE, %g1 + GET_PCPU_SCRATCH + wrpr %g0, %g1, %tstate + set user_rtt, %g1 + wrpr %g0, %g1, %tpc + add %g1, 4, %g1 + wrpr %g0, %g1, %tnpc -fault_fn1_common: -illtrap + set trap, %g1 + mov T_DATA_MISS, %g2 ! XXX is this always true? + mov %g6, %g3 + cmp %g5, T_ALIGNMENT + bne %icc, 1f + nop +1: + sub %g0, 1, %g4 + rdpr %wstate, %l1 + sllx %l1, WSTATE_SHIFT, %l1 + wrpr %l1, WSTATE_K64, %wstate + mov KCONTEXT, %g5 + mov MMU_CID_P, %g6 + SET_MMU_CONTEXT(%g6, %g5) + membar #Sync + b tl0_ktrap + nop END(fault_32bit_fn1) ENTRY(fault_64bit_fn0) - b fault_fn0_common - nop + MAGIC_TRAP_ON + MAGIC_EXIT END(fault_64bit_fn0) ENTRY(fault_64bit_fn1) -#ifdef notyet - /* gas doesn't recognize %gl */ - wrpr %g0, 1, %gl -#endif - b fault_fn1_common - nop + MAGIC_TRAP_ON + MAGIC_EXIT END(fault_64bit_fn1) ENTRY(fault_rtt_fn1) -#ifdef notyet - wrpr %g0, 1, %gl -#endif b fault_fn1_common nop END(fault_rtt_fn1)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603160853.k2G8rUnJ050033>