Date: Tue, 7 Mar 2006 22:16:10 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 92940 for review Message-ID: <200603072216.k27MGAuc037984@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=92940 Change 92940 by kmacy@kmacy_storage:sun4v_work on 2006/03/07 22:15:23 TLB demap needs to happen after the TSB has been updated to avoid a CMT race Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#20 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#20 (text+ko) ==== @@ -260,10 +260,12 @@ .endm .macro insn_miss - GET_MMFSA_SCRATCH(%g1) ! insn 1 - ldda [%g0 + %g1]ASI_LDTD_REAL, %g4 - addx %g1, 0x10, %g1 - ldda [%g0 + %g1]ASI_LDTD_REAL, %g6 + GET_MMFSA_SCRATCH(%g1) + mov MMFSA_D_TYPE, %g2 + mov MMFSA_D_ADDR, %g3 + mov MMFSA_D_CTX, %g7 + ldxa [%g1 + %g2]ASI_REAL, %g4 + ldxa [%g1 + %g3]ASI_REAL, %g5 ba,pt %xcc, tsb_miss_handler mov VTD_REF, %g3 .align 32 @@ -276,25 +278,23 @@ .endm .macro data_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 + GET_MMFSA_SCRATCH(%g1) + mov MMFSA_D_TYPE, %g2 + mov MMFSA_D_ADDR, %g3 + mov MMFSA_D_CTX, %g7 + ldxa [%g1 + %g2]ASI_REAL, %g4 + ldxa [%g1 + %g3]ASI_REAL, %g5 ba,pt %xcc, tsb_miss_handler mov VTD_REF, %g3 .align 32 .endm .macro data_prot - 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 - ! XXX patch this to branch to the tsb_miss_handler - ! on fixed revs of the HV - ba,pt %xcc, data_prot_handler + GET_MMFSA_SCRATCH(%g1) + mov MMFSA_D_ADDR, %g3 + mov MMFSA_D_CTX, %g7 + ldxa [%g1 + %g3]ASI_REAL, %g5 + ba,pt %xcc, tsb_miss_handler mov VTD_W, %g3 .align 32 .endm @@ -1040,30 +1040,17 @@ ! %g3==TTE flags ! %g4==fault type (if data miss) ! %g5==fault addr -! %g6==context ! internal usage: ! %g1==absolute index ! %g2==hash base, pointer to hash entry ! %g3==flag bits, TSB (RA) ! %g4==fault type,entry tag ! %g5==tag -! %g6==hash size, temp +! %g6==context,hash size, temp ! %g7 temp -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 + ldxa [%g1 + %g7]ASI_REAL, %g6 ! load in the context srlx %g5, TTARGET_VA_SHIFT, %g1 sllx %g6, TTARGET_CTX_SHIFT, %g6 @@ -1190,11 +1177,33 @@ #endif stxa %g4, [%g6]ASI_REAL ! store tag stxa %g5, [%g6 + %g7]ASI_REAL ! store data + + ! XXX the following intstruction should be replaced with a + ! retry on HVs that do auto-demap +ontario_demap_errata_patch: + andcc %g5, VTD_W, %g0 + bnz,pn %xcc, demap_begin + mov MMFSA_D_CTX, %g2 + retry +demap_begin: + GET_MMFSA_SCRATCH(%g1) + mov MMFSA_D_ADDR, %g3 + mov %o0, %g5 + mov %o1, %g6 + ldxa [%g1 + %g2]ASI_REAL, %g2 !%g2 == context + ldxa [%g1 + %g3]ASI_REAL, %g3 !%g3 == fault addr + mov %o2, %g7 + mov MAP_DTLB, %o2 + mov %g3, %o0 + mov %g2, %o1 + ta MMU_UNMAP_ADDR + mov %g5, %o0 + mov %g6, %o1 + mov %g7, %o2 MAGIC_TRAP_OFF - retry 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?200603072216.k27MGAuc037984>