Changeset 105805 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Aug 21, 2024 11:52:56 PM (5 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllThrdRecompiler.cpp
r105718 r105805 2119 2119 } 2120 2120 2121 2122 2121 #ifdef IEM_WITH_INTRA_TB_JUMPS 2122 2123 2123 /** 2124 2124 * Emits the necessary tail calls for a full TB loop-jump. … … 2171 2171 return false; 2172 2172 } 2173 2174 /** 2175 * Called by IEM_MC2_BEGIN_EMIT_CALLS when it detects that we're back at the 2176 * first instruction and we didn't just branch to it (that's handled below). 2177 * 2178 * This will emit a loop iff everything is compatible with that. 2179 */ 2180 DECLHIDDEN(int) iemThreadedCompileBackAtFirstInstruction(PVMCPU pVCpu, PIEMTB pTb) RT_NOEXCEPT 2181 { 2182 /* Check if the mode matches. */ 2183 if ( (pVCpu->iem.s.fExec & IEMTB_F_IEM_F_MASK & IEMTB_F_KEY_MASK) 2184 == (pTb->fFlags & IEMTB_F_KEY_MASK & ~IEMTB_F_CS_LIM_CHECKS)) 2185 { 2186 STAM_REL_COUNTER_INC(&pVCpu->iem.s.StatTbLoopFullTbDetected2); 2187 iemThreadedCompileFullTbJump(pVCpu, pTb); 2188 } 2189 return VINF_IEM_RECOMPILE_END_TB; 2190 } 2191 2173 2192 #endif /* IEM_WITH_INTRA_TB_JUMPS */ 2174 2193 -
trunk/src/VBox/VMM/VMMAll/IEMAllThrdTables.h
r105673 r105805 174 174 175 175 176 #ifndef IEM_WITH_INTRA_TB_JUMPS 177 /** 178 * Stub for a no-jumps config, see IEMAllThrdRecompiler.cpp for the real thing. 179 */ 180 DECL_FORCE_INLINE(int) iemThreadedCompileBackAtFirstInstruction(PVMCPU pVCpu, PIEMTB pTb) 181 { 182 RT_NOREF(pTb); 183 STAM_REL_COUNTER_INC(&pVCpu->iem.s.StatTbLoopFullTbDetected2); 184 return VINF_IEM_RECOMPILE_END_TB; 185 } 186 #endif 187 188 176 189 /* 177 190 * Emit call macros. … … 205 218 && !(pTb->fFlags & IEMTB_F_CS_LIM_CHECKS)) \ 206 219 { \ 207 /** @todo Custom copy function, given range is 1 thru 15 bytes. */ \ 208 memcpy(&pTb->pabOpcodes[offOpcodeMc2], pVCpu->iem.s.abOpcode, pVCpu->iem.s.offOpcode); \ 209 pTb->cbOpcodes = offOpcodeMc2 + pVCpu->iem.s.offOpcode; \ 210 pTb->aRanges[idxRangeMc2].cbOpcodes += cbInstrMc2; \ 211 Assert(pTb->cbOpcodes <= pVCpu->iem.s.cbOpcodesAllocated); \ 220 /* Break/loop if we're back to the first instruction in the TB again. */ \ 221 if ( pTb->aRanges[idxRangeMc2].idxPhysPage != 0 \ 222 || (unsigned)pTb->aRanges[idxRangeMc2].offPhysPage + (unsigned)pTb->aRanges[idxRangeMc2].cbOpcodes \ 223 != (pTb->GCPhysPc & GUEST_PAGE_OFFSET_MASK) \ 224 || offOpcodeMc2 == 0) \ 225 { \ 226 /** @todo Custom copy function, given range is 1 thru 15 bytes. */ \ 227 memcpy(&pTb->pabOpcodes[offOpcodeMc2], pVCpu->iem.s.abOpcode, pVCpu->iem.s.offOpcode); \ 228 pTb->cbOpcodes = offOpcodeMc2 + pVCpu->iem.s.offOpcode; \ 229 pTb->aRanges[idxRangeMc2].cbOpcodes += cbInstrMc2; \ 230 Assert(pTb->cbOpcodes <= pVCpu->iem.s.cbOpcodesAllocated); \ 231 } \ 232 else \ 233 return iemThreadedCompileBackAtFirstInstruction(pVCpu, pTb); \ 212 234 } \ 213 235 else if (iemThreadedCompileBeginEmitCallsComplications(pVCpu, pTb)) \ -
trunk/src/VBox/VMM/VMMR3/IEMR3.cpp
r105718 r105805 686 686 STAMR3RegisterF(pVM, (void *)&pVCpu->iem.s.StatTbLoopFullTbDetected, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, 687 687 "Detected loop full TB", "/IEM/CPU%u/re/LoopFullTbDetected", idCpu); 688 STAMR3RegisterF(pVM, (void *)&pVCpu->iem.s.StatTbLoopFullTbDetected2, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, 689 "Detected loop full TB but looping back to before the first TB instruction", 690 "/IEM/CPU%u/re/LoopFullTbDetected2", idCpu); 688 691 STAMR3RegisterF(pVM, (void *)&pVCpu->iem.s.StatTbLoopInTbDetected, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, 689 692 "Detected loop within TB", "/IEM/CPU%u/re/LoopInTbDetected", idCpu); -
trunk/src/VBox/VMM/include/IEMInternal.h
r105718 r105805 2295 2295 /** Statistics: Times a loop back to the start of the TB was detected. */ 2296 2296 STAMCOUNTER StatTbLoopFullTbDetected; 2297 /** Statistics: Times a loop back to the start of the TB was detected, var 2. */ 2298 STAMCOUNTER StatTbLoopFullTbDetected2; 2297 2299 /** Exec memory allocator statistics: Number of times allocaintg executable memory failed. */ 2298 2300 STAMCOUNTER StatNativeExecMemInstrBufAllocFailed; … … 2517 2519 2518 2520 #ifdef IEM_WITH_TLB_TRACE 2519 uint64_t au64Padding[ 7];2521 uint64_t au64Padding[6]; 2520 2522 #else 2521 uint64_t au64Padding[1];2523 //uint64_t au64Padding[0]; 2522 2524 #endif 2523 2525 … … 6884 6886 bool iemThreadedCompileEmitIrqCheckBefore(PVMCPUCC pVCpu, PIEMTB pTb); 6885 6887 bool iemThreadedCompileBeginEmitCallsComplications(PVMCPUCC pVCpu, PIEMTB pTb); 6888 #ifdef IEM_WITH_INTRA_TB_JUMPS 6889 DECLHIDDEN(int) iemThreadedCompileBackAtFirstInstruction(PVMCPU pVCpu, PIEMTB pTb) RT_NOEXCEPT; 6890 #endif 6886 6891 6887 6892 /* Native recompiler public bits: */
Note:
See TracChangeset
for help on using the changeset viewer.