Date: Mon, 1 May 2006 01:35:35 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96462 for review Message-ID: <200605010135.k411ZZov047615@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96462 Change 96462 by kmacy@kmacy_storage:sun4v_rwbuf on 2006/05/01 01:35:27 dependencies for bucket locking support Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/include/asmacros.h#13 edit .. //depot/projects/kmacy_sun4v/src/sys/sun4v/include/cpu.h#5 edit .. //depot/projects/kmacy_sun4v/src/sys/sun4v/include/pcpu.h#11 edit .. //depot/projects/kmacy_sun4v/src/sys/sun4v/include/trap.h#7 edit .. //depot/projects/kmacy_sun4v/src/sys/sun4v/include/tte_hash.h#10 edit .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/tte_hash.c#15 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/include/asmacros.h#13 (text+ko) ==== @@ -167,8 +167,6 @@ - - #define GET_TSB_SCRATCH_USER(reg) \ mov SCRATCH_REG_TSB_USER, reg; \ ldxa [%g0 + reg]ASI_SCRATCHPAD, reg; @@ -234,6 +232,7 @@ ldx [TF + TF_O6], %i6; \ ldx [TF + TF_O7], %i7; + #define SAVE_WINDOW(SBP) \ stx %l0, [SBP + (0*8)]; \ stx %l1, [SBP + (1*8)]; \ @@ -270,6 +269,26 @@ stxa %i6, [SBP + (14*8)]%asi; \ stxa %i7, [SBP + (15*8)]%asi; +#define SAVE_LOCALS_ASI(SBP) \ + stxa %l0, [SBP + (0*8)]%asi; \ + stxa %l1, [SBP + (1*8)]%asi; \ + stxa %l2, [SBP + (2*8)]%asi; \ + stxa %l3, [SBP + (3*8)]%asi; \ + stxa %l4, [SBP + (4*8)]%asi; \ + stxa %l5, [SBP + (5*8)]%asi; \ + stxa %l6, [SBP + (6*8)]%asi; \ + stxa %l7, [SBP + (7*8)]%asi; + +#define RESTORE_LOCALS_ASI(SBP) \ + ldxa [SBP + (0*8)]%asi, %l0; \ + ldxa [SBP + (1*8)]%asi, %l1; \ + ldxa [SBP + (2*8)]%asi, %l2; \ + ldxa [SBP + (3*8)]%asi, %l3; \ + ldxa [SBP + (4*8)]%asi, %l4; \ + ldxa [SBP + (5*8)]%asi, %l5; \ + ldxa [SBP + (6*8)]%asi, %l6; \ + ldxa [SBP + (7*8)]%asi, %l7; + #endif /* LOCORE */ #endif /* _KERNEL */ ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/include/cpu.h#5 (text+ko) ==== @@ -39,13 +39,16 @@ #include <machine/frame.h> #include <machine/tstate.h> +extern void cpu_yield(void); #define TRAPF_PC(tfp) ((tfp)->tf_tpc) #define TRAPF_USERMODE(tfp) (((tfp)->tf_tstate & TSTATE_PRIV) == 0) #define cpu_getstack(td) ((td)->td_frame->tf_sp) #define cpu_setstack(td, sp) ((td)->td_frame->tf_sp = (sp)) -#define cpu_spinwait() hv_cpu_yield(); +#define cpu_spinwait() + + /* * CTL_MACHDEP definitions. ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/include/pcpu.h#11 (text+ko) ==== @@ -71,9 +71,9 @@ u_long pc_tickref; \ u_long pc_tickadj; \ u_int pc_mid; \ - struct rwindow pc_kwbuf; \ - u_long pc_kwbuf_sp; \ - u_int pc_kwbuf_full; \ + struct rwindow pc_kwbuf[2]; \ + u_long pc_kwbuf_sp[2]; \ + u_int pc_kwbuf_full[2]; \ u_int pc_node; \ uint16_t pc_cpulist[MAXCPU] ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/include/trap.h#7 (text+ko) ==== @@ -31,9 +31,11 @@ #ifdef _KERNEL + #define T_DATA_MISS 0x31 #define T_ALIGNMENT 0x34 #define T_DATA_PROTECTION 0x6c +#define T_MEM_ADDRESS_NOT_ALIGNED T_ALIGNMENT #define T_RESERVED 0 #define T_INSTRUCTION_EXCEPTION 1 @@ -44,49 +46,51 @@ #define T_PRIVILEGED_OPCODE 6 #define T_FP_DISABLED 7 #define T_FP_EXCEPTION_IEEE_754 8 -#define T_FP_EXCEPTION_OTHER 9 -#define T_TAG_OVERFLOW 10 -#define T_DIVISION_BY_ZERO 11 -#define T_DATA_EXCEPTION 12 -#define T_DATA_ERROR 13 + +#define T_INSTRUCTION_MISS 0x09 +#define T_TAG_OVERFLOW 0x0a +#define T_DIVISION_BY_ZERO 0x0b +#define T_DATA_EXCEPTION 0x0c +#define T_DATA_ERROR 0x0d + + +#define T_PRIVILEGED_ACTION 0x10 +#define T_ASYNC_DATA_ERROR 0x11 +#define T_TRAP_INSTRUCTION_16 0x12 +#define T_TRAP_INSTRUCTION_17 0x13 +#define T_TRAP_INSTRUCTION_18 0x14 +#define T_TRAP_INSTRUCTION_19 0x15 +#define T_TRAP_INSTRUCTION_20 0x16 +#define T_TRAP_INSTRUCTION_21 0x17 +#define T_TRAP_INSTRUCTION_22 0x18 +#define T_TRAP_INSTRUCTION_23 0x19 +#define T_TRAP_INSTRUCTION_24 0x1a +#define T_TRAP_INSTRUCTION_25 0x1b +#define T_TRAP_INSTRUCTION_26 0x1c +#define T_TRAP_INSTRUCTION_27 0x1d +#define T_TRAP_INSTRUCTION_28 0x1e +#define T_TRAP_INSTRUCTION_29 0x1f +#define T_TRAP_INSTRUCTION_30 0x20 +#define T_TRAP_INSTRUCTION_31 0x21 +#define T_FP_EXCEPTION_OTHER 0x22 -#define T_MEM_ADDRESS_NOT_ALIGNED 15 -#define T_PRIVILEGED_ACTION 16 -#define T_ASYNC_DATA_ERROR 17 -#define T_TRAP_INSTRUCTION_16 18 -#define T_TRAP_INSTRUCTION_17 19 -#define T_TRAP_INSTRUCTION_18 20 -#define T_TRAP_INSTRUCTION_19 21 -#define T_TRAP_INSTRUCTION_20 22 -#define T_TRAP_INSTRUCTION_21 23 -#define T_TRAP_INSTRUCTION_22 24 -#define T_TRAP_INSTRUCTION_23 25 -#define T_TRAP_INSTRUCTION_24 26 -#define T_TRAP_INSTRUCTION_25 27 -#define T_TRAP_INSTRUCTION_26 28 -#define T_TRAP_INSTRUCTION_27 29 -#define T_TRAP_INSTRUCTION_28 30 -#define T_TRAP_INSTRUCTION_29 31 -#define T_TRAP_INSTRUCTION_30 32 -#define T_TRAP_INSTRUCTION_31 33 -#define T_INSTRUCTION_MISS 34 -#define T_INTERRUPT 36 -#define T_PA_WATCHPOINT 37 -#define T_VA_WATCHPOINT 38 -#define T_CORRECTED_ECC_ERROR 39 -#define T_SPILL 40 -#define T_FILL 41 -#define T_FILL_RET 42 -#define T_BREAKPOINT 43 -#define T_CLEAN_WINDOW 44 -#define T_RANGE_CHECK 45 -#define T_FIX_ALIGNMENT 46 -#define T_INTEGER_OVERFLOW 47 -#define T_SYSCALL 48 -#define T_RSTRWP_PHYS 49 -#define T_RSTRWP_VIRT 50 +#define T_INTERRUPT 0x24 +#define T_PA_WATCHPOINT 0x25 +#define T_VA_WATCHPOINT 0x26 +#define T_CORRECTED_ECC_ERROR 0x27 +#define T_SPILL 0x28 +#define T_FILL 0x29 +#define T_FILL_RET 0x2a +#define T_BREAKPOINT 0x2b +#define T_CLEAN_WINDOW 0x2c +#define T_RANGE_CHECK 0x2d +#define T_FIX_ALIGNMENT 0x2e +#define T_INTEGER_OVERFLOW 0x2f +#define T_SYSCALL 0x30 +#define T_RSTRWP_PHYS +#define T_RSTRWP_VIRT #define T_KSTACK_FAULT 51 #define T_RESUMABLE_ERROR 52 #define T_NONRESUMABLE_ERROR 53 ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/include/tte_hash.h#10 (text+ko) ==== @@ -14,6 +14,8 @@ tte_hash_t tte_hash_create(uint64_t context, uint64_t *scratchval); +void tte_hash_bucket_unlock(tte_hash_t hash, vm_offset_t va); + void tte_hash_destroy(tte_hash_t th); int tte_hash_delete(tte_hash_t hash, vm_offset_t va, int locked); ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/tte_hash.c#15 (text+ko) ==== @@ -130,8 +130,27 @@ } +void +tte_hash_bucket_unlock(tte_hash_t th, vm_offset_t va) +{ + uint64_t hash_shift, hash_index; + tte_hash_field_t fields; + + /* XXX - only handle 8K pages for now */ + hash_shift = PAGE_SHIFT; + hash_index = (va >> hash_shift) & HASH_MASK(th); + fields = (th->th_hashtable[hash_index].the_fields); + +#ifdef DEBUG + if ((fields[0].tte.data & VTD_LOCK) == 0) + panic("trying to unlock bucket that isn't locked"); +#endif + fields[0].tte.data &= ~VTD_LOCK; + membar(StoreLoad); +} + static __inline void -hash_bucket_unlock(tte_hash_field_t fields) +hash_bucket_unlock_inline(tte_hash_field_t fields) { #ifdef DEBUG if ((fields[0].tte.data & VTD_LOCK) == 0) @@ -281,7 +300,7 @@ fields[lastindex].tte.data = 0; if (lastindex != 0) - hash_bucket_unlock(fields); + hash_bucket_unlock_inline(fields); return (vaindex < 4); } @@ -327,7 +346,7 @@ panic("collision handling unimplemented - please re-consider"); done: - hash_bucket_unlock(fields); + hash_bucket_unlock_inline(fields); th->th_entries++; } @@ -360,7 +379,7 @@ } } if (entry == NULL || leave_locked == FALSE) - hash_bucket_unlock(fields); + hash_bucket_unlock_inline(fields); /* * XXX handle the case of collisions > 3
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605010135.k411ZZov047615>