Changeset 20749 in vbox
- Timestamp:
- Jun 21, 2009 8:57:37 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 48865
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/REMInternal.h
r20747 r20749 165 165 166 166 /** Number of recorded invlpg instructions. */ 167 uint32_t 167 uint32_t volatile cInvalidatedPages; 168 168 #if HC_ARCH_BITS == 32 169 169 uint32_t uPadding2; -
trunk/src/VBox/VMM/VMMAll/REMAll.cpp
r20747 r20749 47 47 VMMDECL(int) REMNotifyInvalidatePage(PVM pVM, RTGCPTR GCPtrPage) 48 48 { 49 if ( pVM->rem.s.cInvalidatedPages < RT_ELEMENTS(pVM->rem.s.aGCPtrInvalidatedPages) 50 && EMTryEnterRemLock(pVM) == VINF_SUCCESS) /* if this fails, then we'll just flush the tlb as we don't want to waste time here. */ 51 { 52 /* 53 * We sync them back in REMR3State. 54 */ 55 pVM->rem.s.aGCPtrInvalidatedPages[pVM->rem.s.cInvalidatedPages++] = GCPtrPage; 49 /* 50 * Try take the REM lock and push the address onto the array. 51 */ 52 if ( pVM->rem.s.cInvalidatedPages < RT_ELEMENTS(pVM->rem.s.aGCPtrInvalidatedPages) 53 && EMTryEnterRemLock(pVM) == VINF_SUCCESS) 54 { 55 uint32_t iPage = pVM->rem.s.cInvalidatedPages; 56 if (iPage < RT_ELEMENTS(pVM->rem.s.aGCPtrInvalidatedPages)) 57 { 58 ASMAtomicWriteU32(&pVM->rem.s.cInvalidatedPages, iPage + 1); 59 pVM->rem.s.aGCPtrInvalidatedPages[iPage] = GCPtrPage; 60 61 EMRemUnlock(pVM); 62 return VINF_SUCCESS; 63 } 64 65 CPUMSetChangedFlags(VMMGetCpu(pVM), CPUM_CHANGED_GLOBAL_TLB_FLUSH); /** @todo this should be flagged globally, not locally! ... this array should be per-cpu technically speaking. */ 66 ASMAtomicWriteU32(&pVM->rem.s.cInvalidatedPages, 0); /** @todo leave this alone? Optimize this code? */ 67 56 68 EMRemUnlock(pVM); 57 69 } 58 70 else 59 71 { 60 /* Tell the recompiler to flush its TLB. */72 /* Fallback: Simply tell the recompiler to flush its TLB. */ 61 73 CPUMSetChangedFlags(VMMGetCpu(pVM), CPUM_CHANGED_GLOBAL_TLB_FLUSH); 62 pVM->rem.s.cInvalidatedPages = 0;74 ASMAtomicWriteU32(&pVM->rem.s.cInvalidatedPages, 0); /** @todo leave this alone?! Optimize this code? */ 63 75 } 64 76
Note:
See TracChangeset
for help on using the changeset viewer.