Changeset 102365 in vbox
- Timestamp:
- Nov 28, 2023 2:19:35 PM (16 months ago)
- svn:sync-xref-src-repo-rev:
- 160501
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllThrdPython.py
r102072 r102365 1249 1249 aoStmts.append(iai.McCppCall('IEM_MC2_EMIT_CALL_%s' % (len(asCallArgs) - 1,), asCallArgs, cchIndent = cchIndent)); 1250 1250 1251 # For CIMPL stuff, we need to consult the associated IEM_CIMPL_F_XXX 1252 # mask and maybe emit additional checks. 1253 if ( 'IEM_CIMPL_F_MODE' in self.oParent.dsCImplFlags 1254 or 'IEM_CIMPL_F_XCPT' in self.oParent.dsCImplFlags 1255 or 'IEM_CIMPL_F_VMEXIT' in self.oParent.dsCImplFlags): 1256 aoStmts.append(iai.McCppCall('IEM_MC2_EMIT_CALL_1', ( 'kIemThreadedFunc_BltIn_CheckMode', 'pVCpu->iem.s.fExec', ), 1257 cchIndent = cchIndent)); 1251 # 2023-11-28: This has to be done AFTER the CIMPL call, so we have to 1252 # emit this mode check from the compilation loop. On the 1253 # plus side, this means we eliminate unnecessary call at 1254 # end of the TB. :-) 1255 ## For CIMPL stuff, we need to consult the associated IEM_CIMPL_F_XXX 1256 ## mask and maybe emit additional checks. 1257 #if ( 'IEM_CIMPL_F_MODE' in self.oParent.dsCImplFlags 1258 # or 'IEM_CIMPL_F_XCPT' in self.oParent.dsCImplFlags 1259 # or 'IEM_CIMPL_F_VMEXIT' in self.oParent.dsCImplFlags): 1260 # aoStmts.append(iai.McCppCall('IEM_MC2_EMIT_CALL_1', ( 'kIemThreadedFunc_BltIn_CheckMode', 'pVCpu->iem.s.fExec', ), 1261 # cchIndent = cchIndent)); 1258 1262 1259 1263 sCImplFlags = ' | '.join(self.oParent.dsCImplFlags.keys()); -
trunk/src/VBox/VMM/VMMAll/IEMAllThrdRecompiler.cpp
r102332 r102365 1999 1999 2000 2000 /** 2001 * Called by iemThreadedCompile when a block requires a mode check. 2002 * 2003 * @returns true if we should continue, false if we're out of call entries. 2004 * @param pVCpu The cross context virtual CPU structure of the calling 2005 * thread. 2006 * @param pTb The translation block being compiled. 2007 */ 2008 static bool iemThreadedCompileEmitCheckMode(PVMCPUCC pVCpu, PIEMTB pTb) 2009 { 2010 /* Emit the call. */ 2011 uint32_t const idxCall = pTb->Thrd.cCalls; 2012 AssertReturn(idxCall < pTb->Thrd.cAllocated, false); 2013 PIEMTHRDEDCALLENTRY pCall = &pTb->Thrd.paCalls[idxCall]; 2014 pTb->Thrd.cCalls = (uint16_t)(idxCall + 1); 2015 pCall->enmFunction = kIemThreadedFunc_BltIn_CheckMode; 2016 pCall->idxInstr = pTb->cInstructions - 1; 2017 pCall->uUnused0 = 0; 2018 pCall->offOpcode = 0; 2019 pCall->cbOpcode = 0; 2020 pCall->idxRange = 0; 2021 pCall->auParams[0] = pVCpu->iem.s.fExec; 2022 pCall->auParams[1] = 0; 2023 pCall->auParams[2] = 0; 2024 LogFunc(("%04x:%08RX64 fExec=%#x\n", pVCpu->cpum.GstCtx.cs.Sel, pVCpu->cpum.GstCtx.rip, pVCpu->iem.s.fExec)); 2025 return true; 2026 } 2027 2028 2029 /** 2001 2030 * Called by IEM_MC2_BEGIN_EMIT_CALLS() when IEM_CIMPL_F_CHECK_IRQ_BEFORE is 2002 2031 * set. … … 2168 2197 2169 2198 pVCpu->iem.s.cInstructions++; 2199 2200 /* Check for mode change _after_ certain CIMPL calls, so check that 2201 we continue executing with the same mode value. */ 2202 if (!(pVCpu->iem.s.fTbCurInstr & (IEM_CIMPL_F_MODE | IEM_CIMPL_F_XCPT | IEM_CIMPL_F_VMEXIT))) 2203 { /* probable */ } 2204 else if (RT_LIKELY(iemThreadedCompileEmitCheckMode(pVCpu, pTb))) 2205 { /* extremely likely */ } 2206 else 2207 break; 2170 2208 } 2171 2209 else
Note:
See TracChangeset
for help on using the changeset viewer.