Date: Thu, 18 May 2006 05:50:49 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 97393 for review Message-ID: <200605180550.k4I5onXv020539@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=97393 Change 97393 by kmacy@kmacy_storage:sun4v_rwbuf on 2006/05/18 05:50:23 fix case where we were trashing a register whose value we still needed whene were noting a duplicate TSB value remove dead code - use membar sync when locking until pmap is stable Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#53 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#53 (text+ko) ==== @@ -340,8 +340,8 @@ .endm .macro resumable_error - MAGIC_TRAP_ON - MAGIC_EXIT + !MAGIC_TRAP_ON + !MAGIC_EXIT clr %g3 sub %g0, 1, %g4 set trap, %g1 @@ -510,12 +510,14 @@ .endm .macro spill_mixed - MAGIC_EXIT +! MAGIC_EXIT + nop .align 128 .endm .macro fill_mixed - MAGIC_EXIT +! MAGIC_EXIT + nop .align 128 .endm @@ -525,7 +527,6 @@ .endm .macro tl0_pil_entry level, mask -#if 1 wrpr %g0, 1, %gl set \mask, %g1 clr %g2 @@ -533,25 +534,9 @@ wr %g1, 0, %clear_softint ba %xcc, tl0_intr mov \level, %g4 -#else - mov 1, %g2 - sllx %g2, \level, %g1 - sllx %g2, 16, %g3 - or %g1, %g3, %g3 - or %g2, %g3, %g2 - wr %g2, %g0, %clear_softint - retry -#endif .align 32 .endm - .macro tl1_pil_entry level, mask - set \mask, %g2 - ba %xcc, tl0_intr - mov \level, %g1 - .align 32 - .endm - #define INTR(level, traplvl) \ tl ## traplvl ## _pil_entry level, 1 << level @@ -931,14 +916,15 @@ nop call spinlock_enter nop - jmpl %l3, %o7 ! call trap handler +common_uintr: + jmpl %l3, %o7 ! call interrupt handler mov %l7, %o0 call spinlock_exit nop b user_rtt nop common_utrap: - jmpl %l3, %o7 ! call trap handler + jmpl %l3, %o7 ! call trap handler / syscall mov %l7, %o0 ldx [PCPU_REG + PC_CURPCB], %g6 @@ -1318,7 +1304,7 @@ bge,pt %xcc, 0f nop call panic - MAGIC_EXIT +! MAGIC_EXIT 0: #endif @@ -1340,7 +1326,15 @@ #define LOADLOAD #LoadLoad #define LOADSTORE #LoadStore #define STORESTORE #StoreStore - + +#ifdef WORKING +#define ENTER LOADLOAD +#define EXIT LOADSTORE|STORESTORE +#else +#define ENTER #Sync +#define EXIT #Sync +#endif + #define THE_LOCK_ENTER(addr, lock_bit, oldval, newval, label1) \ mov 1, lock_bit ; \ add addr, 8, addr ; \ @@ -1352,22 +1346,22 @@ casxa [addr]%asi, oldval, newval; \ cmp newval, oldval ; \ bne,pn %xcc, label1 ## b ; \ - membar LOADLOAD ; \ + membar ENTER ; \ sub addr, 8, addr ; #define THE_LOCK_EXIT(addr, lock_bit, tmp)\ - membar LOADSTORE | STORESTORE ; \ + membar EXIT ; \ ldxa [addr + 8]%asi, tmp ; \ andn tmp, lock_bit, tmp ; \ stxa tmp, [addr + 8]%asi ; #define HASH_LOOKUP(addr, tag, searchtag, faillabel, matchlabel) \ ldda [addr]%asi, tag ; \ - cmp tag, searchtag ; \ - be,pn %xcc, matchlabel ; \ - nop ; \ cmp tag, %g0 ; \ be,pn %xcc, faillabel ; \ + nop ; \ + cmp tag, searchtag ; \ + be,pn %xcc, matchlabel ;\ nop #define RESTORE_TRAPWIN(pcpu, cansave, label1, label2) \ @@ -1385,7 +1379,6 @@ label2: ENTRY(hash_bucket_lock) -! MAGIC_TRAP_ON wr %g0, ASI_N, %asi rdpr %pstate, %o1 and %o1, PSTATE_INTR_DISABLE, %o2 @@ -1585,7 +1578,7 @@ sllx %g3, TTE_SHIFT, %g3 ! masked byte offset add %g3, %l3, %g3 ! TTE RA - +#if 0 #ifdef PMAP_DEBUG ldxa [%g3]%asi, %l2 ldxa [%g3 + 8]%asi, %l3 @@ -1595,19 +1588,27 @@ bne,pt %xcc, 12f nop #ifndef SMP - MAGIC_TRAP_ON;MAGIC_TRAP_ON;MAGIC_EXIT ! die if all we're doing +! MAGIC_TRAP_ON;MAGIC_TRAP_ON;MAGIC_EXIT ! die if all we're doing ! is storing same data #else - mov %o0, %g1 + mov %o0, %l2 mov %o5, %g4 PUTCHAR(0x5a) - mov %g1, %o0 + lda [PCPU_REG + PC_CPUID]%asi, %o0 + add %o0, 0x30, %o0 + PUTCHAR(%o0) + PUTCHAR(0x5a) + mov %l2, %o0 mov %g4, %o5 - MAGIC_TRAP_ON; MAGIC_TRAP_OFF +! MAGIC_TRAP_ON; MAGIC_TRAP_OFF #endif 12: #endif - stxa %g0, [%g3 + 8]%asi ! invalidate data +#endif + stxa %g0, [%g3 + 8]%asi ! invalidate data +#ifndef WORKING + membar #Sync +#endif stxa %l6, [%g3]%asi ! store tag stxa %l7, [%g3 + 8]%asi ! store data stxa %l7, [%g2 + 8]%asi ! update TTE with ref bit @@ -1665,7 +1666,7 @@ PUTCHAR(0x5b) PUTCHAR(0x5b) PUTCHAR(0x5b) - MAGIC_TRAP_ON;MAGIC_TRAP_ON;MAGIC_EXIT +! MAGIC_TRAP_ON;MAGIC_TRAP_ON;MAGIC_EXIT END(unsupported_fault_trap)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605180550.k4I5onXv020539>