- Timestamp:
- Oct 24, 2008 5:48:59 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 38439
- Location:
- trunk/src
- Files:
-
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/EM.cpp
r13542 r13565 748 748 * Switch to REM, step instruction, switch back. 749 749 */ 750 int rc = REMR3State(pVM , pVM->em.s.fREMFlushTBs);750 int rc = REMR3State(pVM); 751 751 if (VBOX_SUCCESS(rc)) 752 752 { 753 753 rc = REMR3Step(pVM); 754 754 REMR3StateBack(pVM); 755 pVM->em.s.fREMFlushTBs = false;756 755 } 757 756 LogFlow(("emR3RemStep: returns %Vrc cs:eip=%04x:%08x\n", rc, CPUMGetGuestCS(pVM), CPUMGetGuestEIP(pVM))); … … 808 807 { 809 808 STAM_PROFILE_START(&pVM->em.s.StatREMSync, b); 810 rc = REMR3State(pVM , pVM->em.s.fREMFlushTBs);809 rc = REMR3State(pVM); 811 810 STAM_PROFILE_STOP(&pVM->em.s.StatREMSync, b); 812 811 if (VBOX_FAILURE(rc)) 813 812 break; 814 813 fInREMState = true; 815 pVM->em.s.fREMFlushTBs = false;816 814 817 815 /* -
trunk/src/VBox/VMM/EMInternal.h
r13265 r13565 294 294 #endif 295 295 296 /* Set when the translation blocks in the recompiler cache need to be flushed. */ 297 bool fREMFlushTBs; 298 299 uint8_t u8Padding[GC_ARCH_BITS == 64 ? 5 : 1]; 296 uint8_t u8Padding[GC_ARCH_BITS == 64 ? 6 : 2]; 300 297 301 298 /** Inhibit interrupts for this instruction. Valid only when VM_FF_INHIBIT_INTERRUPTS is set. */ -
trunk/src/VBox/VMM/HWACCM.cpp
r13542 r13565 31 31 #include <VBox/trpm.h> 32 32 #include <VBox/dbgf.h> 33 #include <VBox/patm.h> 34 #include <VBox/csam.h> 35 #include <VBox/selm.h> 36 #include <VBox/rem.h> 33 37 #include <VBox/hwacc_vmx.h> 34 38 #include <VBox/hwacc_svm.h> … … 37 41 #include <VBox/err.h> 38 42 #include <VBox/param.h> 39 #include <VBox/patm.h>40 #include <VBox/csam.h>41 #include <VBox/selm.h>42 43 43 44 #include <iprt/assert.h> … … 604 605 *((unsigned char *)pVM->hwaccm.s.vmx.pRealModeTSS + HWACCM_VTX_TSS_SIZE - 2) = 0xff; 605 606 606 /* Construct a 1024 element page directory with 4 MB pages for the identity mapped page table used in 607 /* Construct a 1024 element page directory with 4 MB pages for the identity mapped page table used in 607 608 * real and protected mode without paging with EPT. 608 609 */ … … 616 617 /* We convert it here every time as pci regions could be reconfigured. */ 617 618 rc = PDMVMMDevHeapR3ToGCPhys(pVM, pVM->hwaccm.s.vmx.pRealModeTSS, &GCPhys); 618 AssertRC(rc); 619 AssertRC(rc); 619 620 LogRel(("HWACCM: Real Mode TSS guest physaddr = %VGp\n", GCPhys)); 620 621 621 622 rc = PDMVMMDevHeapR3ToGCPhys(pVM, pVM->hwaccm.s.vmx.pNonPagingModeEPTPageTable, &GCPhys); 622 AssertRC(rc); 623 AssertRC(rc); 623 624 LogRel(("HWACCM: Non-Paging Mode EPT CR3 = %VGp\n", GCPhys)); 624 625 … … 883 884 if (CPUMIsGuestInRealModeEx(pCtx)) 884 885 { 885 /* VT-x will not allow high selector bases in v86 mode; fall back to the recompiler in that case. 886 /* VT-x will not allow high selector bases in v86 mode; fall back to the recompiler in that case. 886 887 * The base must also be equal to (sel << 4). 887 888 */ … … 914 915 * changed (Fedora4 boot image, reset, boot iso) 915 916 */ 916 EMFlushREMTBs(pVM);917 REMFlushTBs(pVM); 917 918 return false; 918 919 } -
trunk/src/VBox/VMM/Makefile.kmk
r13375 r13565 110 110 VMMAll/PGMAllPhys.cpp \ 111 111 VMMAll/PGMAllPool.cpp \ 112 VMMAll/REMAll.cpp \ 112 113 VMMAll/SELMAll.cpp \ 113 114 VMMAll/EMAll.cpp \ -
trunk/src/VBox/VMM/PATM/VMMGC/CSAMGC.cpp
r12989 r13565 33 33 #include <VBox/sup.h> 34 34 #include <VBox/mm.h> 35 #include <VBox/rem.h> 35 36 #include <VBox/param.h> 36 37 #include <iprt/avl.h> … … 72 73 73 74 /* Flush the recompilers translation block cache as the guest seems to be modifying instructions. */ 74 EMFlushREMTBs(pVM);75 REMFlushTBs(pVM); 75 76 76 77 pPATMGCState = PATMQueryGCState(pVM); -
trunk/src/VBox/VMM/REMInternal.h
r13230 r13565 166 166 bool fInStateSync; 167 167 168 /** Set when the translation blocks cache need to be flushed. */ 169 bool fFlushTBs; 170 168 171 /** Ignore all that can be ignored. */ 169 172 bool fIgnoreAll; … … 245 248 #ifdef VBOX_WITH_NEW_RECOMPILER 246 249 #if GC_ARCH_BITS == 32 247 # define REM_ENV_SIZE (HC_ARCH_BITS == 32 ? 0xff00 : 0xff00)250 # define REM_ENV_SIZE (HC_ARCH_BITS == 32 ? 0xff00 : 0xff00) 248 251 #else 249 #define REM_ENV_SIZE (HC_ARCH_BITS == 32 ? 0xff00 : 0xff00) 250 #endif 252 # define REM_ENV_SIZE (HC_ARCH_BITS == 32 ? 0xff00 : 0xff00) 253 #endif 254 #else /* !VBOX_WITH_NEW_RECOMPILER */ 255 #if GC_ARCH_BITS == 32 256 # define REM_ENV_SIZE (HC_ARCH_BITS == 32 ? 0x6550 : 0xb4a0) 251 257 #else 252 #if GC_ARCH_BITS == 32 253 #define REM_ENV_SIZE (HC_ARCH_BITS == 32 ? 0x6550 : 0xb4a0) 254 #else 255 #define REM_ENV_SIZE (HC_ARCH_BITS == 32 ? 0x9440 : 0xd4a0) 256 #endif 257 #endif // VBOX_WITH_NEW_RECOMILER 258 # define REM_ENV_SIZE (HC_ARCH_BITS == 32 ? 0x9440 : 0xd4a0) 259 #endif 260 #endif /* !VBOX_WITH_NEW_RECOMILER */ 258 261 259 262 /** Recompiler CPU state. */ … … 265 268 char achPadding[REM_ENV_SIZE]; 266 269 } Env; 267 #endif 270 #endif /* !REM_INCLUDE_CPU_H */ 268 271 } REM; 269 272 … … 289 292 void remR3CpuId(CPUState *env, unsigned uOperator, void *pvEAX, void *pvEBX, void *pvECX, void *pvEDX); 290 293 void remR3RecordCall(CPUState *env); 291 #endif 294 #endif /* REM_INCLUDE_CPU_H */ 292 295 void remR3TrapClear(PVM pVM); 293 296 void remR3RaiseRC(PVM pVM, int rc); … … 304 307 #ifdef VBOX_WITH_STATISTICS 305 308 306 #define STATS_EMULATE_SINGLE_INSTR 1 307 #define STATS_QEMU_COMPILATION 2 308 #define STATS_QEMU_RUN_EMULATED_CODE 3 309 #define STATS_QEMU_TOTAL 4 310 #define STATS_QEMU_RUN_TIMERS 5 311 #define STATS_TLB_LOOKUP 6 312 #define STATS_IRQ_HANDLING 7 313 #define STATS_RAW_CHECK 8 314 309 # define STATS_EMULATE_SINGLE_INSTR 1 310 # define STATS_QEMU_COMPILATION 2 311 # define STATS_QEMU_RUN_EMULATED_CODE 3 312 # define STATS_QEMU_TOTAL 4 313 # define STATS_QEMU_RUN_TIMERS 5 314 # define STATS_TLB_LOOKUP 6 315 # define STATS_IRQ_HANDLING 7 316 # define STATS_RAW_CHECK 8 315 317 316 318 void remR3ProfileStart(int statcode); 317 319 void remR3ProfileStop(int statcode); 318 #else 319 #define remR3ProfileStart(c) 320 #define remR3ProfileStop(c) 321 #endif 320 321 #else /* !VBOX_WITH_STATISTICS */ 322 # define remR3ProfileStart(c) 323 # define remR3ProfileStop(c) 324 #endif /* !VBOX_WITH_STATISTICS */ 322 325 323 326 /** @} */ -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r13561 r13565 83 83 { 84 84 return pVM->em.s.enmState; 85 }86 87 88 /**89 * Flushes the REM translation blocks the next time we execute code there.90 *91 * @param pVM The VM handle.92 *93 * @todo This doesn't belong here, it should go in REMAll.cpp!94 */95 VMMDECL(void) EMFlushREMTBs(PVM pVM)96 {97 LogFlow(("EMFlushREMTBs\n"));98 pVM->em.s.fREMFlushTBs = true;99 85 } 100 86 -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r13186 r13565 20 20 */ 21 21 22 /******************************************************************************* 23 * Defined Constants And Macros * 24 *******************************************************************************/ 22 25 /** @def PGM_IGNORE_RAM_FLAGS_RESERVED 23 26 * Don't respect the MM_RAM_FLAGS_RESERVED flag when converting to HC addresses. … … 263 266 AssertFatalFailed(); 264 267 } 265 266 268 267 269 … … 1126 1128 pCache->Entry[iCacheIndex].pbR3 = pbR3; 1127 1129 } 1128 #endif 1130 #endif /* IN_RING3 */ 1129 1131 1130 1132 /** … … 1216 1218 void *pvSrc = PGMRAMRANGE_GETHCPTR(pRam, off) 1217 1219 1218 /* * @noteDangerous assumption that HC handlers don't do anything that really requires an EMT lock! */1220 /* Note! Dangerous assumption that HC handlers don't do anything that really requires an EMT lock! */ 1219 1221 rc = pNode->pfnHandlerR3(pVM, GCPhys, pvSrc, pvBuf, cb, PGMACCESSTYPE_READ, pNode->pvUserR3); 1220 1222 } … … 1264 1266 void *pvSrc = PGMRAMRANGE_GETHCPTR(pRam, off) 1265 1267 1266 /* Note :Dangerous assumption that HC handlers don't do anything that really requires an EMT lock! */1268 /* Note! Dangerous assumption that HC handlers don't do anything that really requires an EMT lock! */ 1267 1269 rc = pNode->pfnHandlerR3(pVM, (RTGCPTR)GCPtr, pvSrc, pvBuf, cb, PGMACCESSTYPE_READ, 0); 1268 1270 } … … 1385 1387 return; 1386 1388 } 1389 1387 1390 1388 1391 /** -
trunk/src/VBox/VMM/VMMAll/REMAll.cpp
r12989 r13565 34 34 #include <iprt/assert.h> 35 35 36 37 #ifndef IN_RING3 36 38 37 39 /** … … 157 159 } 158 160 161 #endif /* !IN_RING3 */ 162 163 /** 164 * Make REM flush all translation block upon the next call to REMR3State(). 165 * 166 * @param pVM Pointer to the shared VM structure. 167 */ 168 VMMDECL(void) REMFlushTBs(PVM pVM) 169 { 170 LogFlow(("REMFlushTBs: fFlushTBs=%RTbool fInREM=%RTbool fInStateSync=%RTbool\n", 171 pVM->rem.s.fFlushTBs, pVM->rem.s.fInREM, pVM->rem.s.fInStateSync)); 172 pVM->rem.s.fFlushTBs = true; 173 } 174 -
trunk/src/recompiler/VBoxREMWrapper.cpp
r13532 r13565 337 337 static DECLCALLBACKPTR(int, pfnREMR3EmulateInstruction)(PVM); 338 338 static DECLCALLBACKPTR(int, pfnREMR3Run)(PVM); 339 static DECLCALLBACKPTR(int, pfnREMR3State)(PVM , bool fFlushTBs);339 static DECLCALLBACKPTR(int, pfnREMR3State)(PVM); 340 340 static DECLCALLBACKPTR(int, pfnREMR3StateBack)(PVM); 341 341 static DECLCALLBACKPTR(void, pfnREMR3StateUpdate)(PVM); … … 988 988 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL } 989 989 }; 990 static const REMPARMDESC g_aArgsState[] =991 {992 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL },993 { REMPARMDESC_FLAGS_INT, sizeof(bool), NULL }994 };995 990 996 991 /** @} */ … … 1009 1004 { "REMR3EmulateInstruction", (void *)&pfnREMR3EmulateInstruction, &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1010 1005 { "REMR3Run", (void *)&pfnREMR3Run, &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1011 { "REMR3State", (void *)&pfnREMR3State, &g_aArgs State[0], RT_ELEMENTS(g_aArgsState),REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },1006 { "REMR3State", (void *)&pfnREMR3State, &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1012 1007 { "REMR3StateBack", (void *)&pfnREMR3StateBack, &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1013 1008 { "REMR3StateUpdate", (void *)&pfnREMR3StateUpdate, &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, … … 1991 1986 } 1992 1987 1993 REMR3DECL(int) REMR3State(PVM pVM , bool fFlushTBs)1988 REMR3DECL(int) REMR3State(PVM pVM) 1994 1989 { 1995 1990 #ifdef USE_REM_STUBS … … 1997 1992 #else 1998 1993 Assert(VALID_PTR(pfnREMR3State)); 1999 return pfnREMR3State(pVM , fFlushTBs);1994 return pfnREMR3State(pVM); 2000 1995 #endif 2001 1996 } -
trunk/src/recompiler/VBoxRecompiler.c
r13532 r13565 741 741 * Sync the state and enable single instruction / single stepping. 742 742 */ 743 int rc = REMR3State(pVM , false /* no need to flush the TBs; we always compile. */);743 int rc = REMR3State(pVM); 744 744 if (VBOX_SUCCESS(rc)) 745 745 { … … 1632 1632 * 1633 1633 * @param pVM VM Handle. 1634 * @param fFlushTBs Flush all translation blocks before executing code1635 1634 * 1636 1635 * @remark The caller has to check for important FFs before calling REMR3Run. REMR3State will … … 1638 1637 * pending that would immediatly interrupt execution. 1639 1638 */ 1640 REMR3DECL(int) REMR3State(PVM pVM , bool fFlushTBs)1639 REMR3DECL(int) REMR3State(PVM pVM) 1641 1640 { 1642 1641 Log2(("REMR3State:\n")); … … 1650 1649 pVM->rem.s.fInStateSync = true; 1651 1650 1652 if (fFlushTBs) 1651 /* 1652 * If we have to flush TBs, do that immediately. 1653 */ 1654 if (pVM->rem.s.fFlushTBs) 1653 1655 { 1654 1656 STAM_COUNTER_INC(&gStatFlushTBs); 1655 1657 tb_flush(&pVM->rem.s.Env); 1658 pVM->rem.s.fFlushTBs = false; 1656 1659 } 1657 1660
Note:
See TracChangeset
for help on using the changeset viewer.