Changeset 19903 in vbox
- Timestamp:
- May 22, 2009 9:41:32 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/hwacc_svm.h
r14366 r19903 669 669 #ifdef IN_RING0 670 670 VMMR0DECL(int) SVMR0InvalidatePage(PVM pVM, PVMCPU pVCpu, RTGCPTR GCVirt); 671 VMMR0DECL(int) SVMR0InvalidatePhysPage(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys);672 671 #endif /* IN_RING0 */ 673 672 -
trunk/include/VBox/hwaccm.h
r19816 r19903 81 81 #ifndef IN_RC 82 82 VMMDECL(int) HWACCMFlushTLB(PVMCPU pVCpu); 83 VMMDECL(int) HWACCMFlushAllTLBs(PVM pVM); 84 VMMDECL(int) HWACCMInvalidatePhysPage(PVMCPU pVCpu, RTGCPHYS GCPhys); 83 VMMDECL(int) HWACCMFlushTLBOnAllVCpus(PVM pVM); 84 VMMDECL(int) HWACCMInvalidatePageOnAllVCpus(PVM pVM, RTGCPTR GCVirt); 85 VMMDECL(int) HWACCMInvalidatePhysPage(PVM pVM, RTGCPHYS GCPhys); 85 86 VMMDECL(bool) HWACCMIsNestedPagingActive(PVM pVM); 86 87 VMMDECL(PGMMODE) HWACCMGetShwPagingMode(PVM pVM); … … 89 90 # define HWACCMFlushTLB(pVCpu) do { } while (0) 90 91 # define HWACCMIsNestedPagingActive(pVM) false 91 # define HWACCMFlush AllTLBs(pVM)do { } while (0)92 # define HWACCMFlushTLBOnAllVCpus(pVM) do { } while (0) 92 93 #endif 93 94 -
trunk/src/VBox/VMM/PGMInternal.h
r19872 r19903 327 327 328 328 /** @def PGM_INVL_PG 329 * Invalidates a page when in GC does nothing in HC. 330 * 329 * Invalidates a page. 330 * 331 * @param pVCpu The VMCPU handle. 331 332 * @param GCVirt The virtual address of the page to invalidate. 332 333 */ … … 339 340 #endif 340 341 342 /** @def PGM_INVL_PG 343 * Invalidates a page on all VCPUs 344 * 345 * @param pVM The VM handle. 346 * @param GCVirt The virtual address of the page to invalidate. 347 */ 348 #ifdef IN_RC 349 # define PGM_INVL_ALL_VCPU_PG(pVM, GCVirt) ASMInvalidatePage((void *)(GCVirt)) 350 #elif defined(IN_RING0) 351 # define PGM_INVL_ALL_VCPU_PG(pVM, GCVirt) HWACCMInvalidatePageOnAllVCpus(pVM, (RTGCPTR)(GCVirt)) 352 #else 353 # define PGM_INVL_ALL_VCPU_PG(pVM, GCVirt) HWACCMInvalidatePageOnAllVCpus(pVM, (RTGCPTR)(GCVirt)) 354 #endif 355 341 356 /** @def PGM_INVL_BIG_PG 342 * Invalidates a 4MB page directory entry when in GC does nothing in HC. 343 * 357 * Invalidates a 4MB page directory entry. 358 * 359 * @param pVCpu The VMCPU handle. 344 360 * @param GCVirt The virtual address within the page directory to invalidate. 345 361 */ … … 354 370 /** @def PGM_INVL_VCPU_TLBS() 355 371 * Invalidates the TLBs of the specified VCPU 372 * 373 * @param pVCpu The VMCPU handle. 356 374 */ 357 375 #ifdef IN_RC … … 365 383 /** @def PGM_INVL_ALL_VCPU_TLBS() 366 384 * Invalidates the TLBs of all VCPUs 385 * 386 * @param pVM The VM handle. 367 387 */ 368 388 #ifdef IN_RC 369 389 # define PGM_INVL_ALL_VCPU_TLBS(pVM) ASMReloadCR3() 370 390 #elif defined(IN_RING0) 371 # define PGM_INVL_ALL_VCPU_TLBS(pVM) HWACCMFlush AllTLBs(pVM)391 # define PGM_INVL_ALL_VCPU_TLBS(pVM) HWACCMFlushTLBOnAllVCpus(pVM) 372 392 #else 373 # define PGM_INVL_ALL_VCPU_TLBS(pVM) HWACCMFlush AllTLBs(pVM)393 # define PGM_INVL_ALL_VCPU_TLBS(pVM) HWACCMFlushTLBOnAllVCpus(pVM) 374 394 #endif 375 395 -
trunk/src/VBox/VMM/VMMAll/HWACCMAll.cpp
r19848 r19903 75 75 LogFlow(("HWACCMFlushTLB\n")); 76 76 77 pVCpu->hwaccm.s.fForceTLBFlush = true;77 VMCPU_FF_SET(pVCpu, VMCPU_FF_TLB_FLUSH); 78 78 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatFlushTLBManual); 79 79 return VINF_SUCCESS; … … 82 82 #ifndef IN_RC 83 83 /** 84 * Invalidates a guest page on all VCPUs. 85 * 86 * @returns VBox status code. 87 * @param pVM The VM to operate on. 88 * @param GCVirt Page to invalidate 89 */ 90 VMMDECL(int) HWACCMInvalidatePageOnAllVCpus(PVM pVM, RTGCPTR GCPtr) 91 { 92 /* @todo */ 93 HWACCMInvalidatePage(VMMGetCpu(pVM), GCPtr); 94 return VINF_SUCCESS; 95 } 96 97 /** 84 98 * Flush the TLBs of all VCPUs 85 99 * … … 87 101 * @param pVM The VM to operate on. 88 102 */ 89 VMMDECL(int) HWACCMFlush AllTLBs(PVM pVM)103 VMMDECL(int) HWACCMFlushTLBOnAllVCpus(PVM pVM) 90 104 { 91 105 if (pVM->cCPUs == 1) … … 153 167 * 154 168 * @returns VBox status code. 155 * @param pV Cpu The VMCPUto operate on.169 * @param pVM The VM to operate on. 156 170 * @param GCPhys Page to invalidate 157 171 */ 158 VMMDECL(int) HWACCMInvalidatePhysPage(PVMCPU pVCpu, RTGCPHYS GCPhys) 159 { 160 PVM pVM = pVCpu->CTX_SUFF(pVM); 161 172 VMMDECL(int) HWACCMInvalidatePhysPage(PVM pVM, RTGCPHYS GCPhys) 173 { 162 174 if (!HWACCMIsNestedPagingActive(pVM)) 163 175 return VINF_SUCCESS; 164 176 177 PVMCPU pVCpu = VMMGetCpu(pVM); 165 178 #ifdef IN_RING0 166 179 if (pVM->hwaccm.s.vmx.fSupported) 180 { 181 /* @todo for all vcpus */ 167 182 return VMXR0InvalidatePhysPage(pVM, pVCpu, GCPhys); 183 } 168 184 169 185 Assert(pVM->hwaccm.s.svm.fSupported); 170 SVMR0InvalidatePhysPage(pVM, pVCpu, GCPhys);186 HWACCMFlushTLBOnAllVCpus(pVM); 171 187 #else 172 HWACCMFlushTLB (pVCpu);188 HWACCMFlushTLBOnAllVCpus(pVM); 173 189 #endif 174 190 return VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
r19833 r19903 169 169 pVM->pgm.s.fPhysCacheFlushPending = true; 170 170 pgmUnlock(pVM); 171 HWACCMFlush AllTLBs(pVM);171 HWACCMFlushTLBOnAllVCpus(pVM); 172 172 #ifndef IN_RING3 173 173 REMNotifyHandlerPhysicalRegister(pVM, enmType, GCPhys, GCPhysLast - GCPhys + 1, !!pfnHandlerR3); … … 271 271 pgmHandlerPhysicalDeregisterNotifyREM(pVM, pCur); 272 272 pgmUnlock(pVM); 273 HWACCMFlush AllTLBs(pVM);273 HWACCMFlushTLBOnAllVCpus(pVM); 274 274 MMHyperFree(pVM, pCur); 275 275 return VINF_SUCCESS; … … 417 417 PGM_INVL_VCPU_TLBS(VMMGetCpu0(pVM)); 418 418 # else 419 HWACCMFlush AllTLBs(pVM);419 HWACCMFlushTLBOnAllVCpus(pVM); 420 420 # endif 421 421 pVM->pgm.s.fPhysCacheFlushPending = true; … … 553 553 #endif 554 554 pgmUnlock(pVM); 555 HWACCMFlush AllTLBs(pVM);555 HWACCMFlushTLBOnAllVCpus(pVM); 556 556 Log(("PGMHandlerPhysicalModify: GCPhysCurrent=%RGp -> GCPhys=%RGp GCPhysLast=%RGp\n", 557 557 GCPhysCurrent, GCPhys, GCPhysLast)); … … 848 848 rc = pgmHandlerPhysicalSetRamFlagsAndFlushShadowPTs(pVM, pCur, pRam); 849 849 pVM->pgm.s.fPhysCacheFlushPending = true; 850 HWACCMFlush AllTLBs(pVM);850 HWACCMFlushTLBOnAllVCpus(pVM); 851 851 } 852 852 … … 920 920 PGM_PAGE_SET_HNDL_PHYS_STATE(pPage, PGM_PAGE_HNDL_PHYS_STATE_DISABLED); 921 921 #ifndef IN_RC 922 HWACCMInvalidatePhysPage( VMMGetCpu(pVM), GCPhysPage);922 HWACCMInvalidatePhysPage(pVM, GCPhysPage); 923 923 #endif 924 924 return VINF_SUCCESS; … … 1037 1037 1038 1038 #ifndef IN_RC 1039 HWACCMInvalidatePhysPage( VMMGetCpu(pVM), GCPhysPage);1039 HWACCMInvalidatePhysPage(pVM, GCPhysPage); 1040 1040 #endif 1041 1041 return VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r19872 r19903 1297 1297 */ 1298 1298 int rc = pgmPoolFlushPage(pPool, pPage); 1299 /* This flush was initiated by us and not the guest, so explicitly flush the TLB. */ 1299 1300 if (rc == VINF_SUCCESS) 1300 PGM_INVL_ VCPU_TLBS(VMMGetCpu(pVM)); /* see PT handler. */1301 PGM_INVL_ALL_VCPU_TLBS(pVM); 1301 1302 return rc; 1302 1303 } … … 3963 3964 static int pgmPoolMakeMoreFreePages(PPGMPOOL pPool, PGMPOOLKIND enmKind, uint16_t iUser) 3964 3965 { 3966 PVM pVM = pPool->CTX_SUFF(pVM); 3967 3965 3968 LogFlow(("pgmPoolMakeMoreFreePages: iUser=%#x\n", iUser)); 3966 3969 … … 3978 3981 STAM_PROFILE_ADV_SUSPEND(&pPool->StatAlloc, a); 3979 3982 #ifdef IN_RING3 3980 int rc = PGMR3PoolGrow(p Pool->pVMR3);3983 int rc = PGMR3PoolGrow(pVM); 3981 3984 #else 3982 int rc = CTXALLMID(VMM, CallHost)(p Pool->CTX_SUFF(pVM), VMMCALLHOST_PGM_POOL_GROW, 0);3985 int rc = CTXALLMID(VMM, CallHost)(pVM, VMMCALLHOST_PGM_POOL_GROW, 0); 3983 3986 #endif 3984 3987 if (RT_FAILURE(rc)) -
trunk/src/VBox/VMM/VMMAll/PGMAllShw.h
r19874 r19903 363 363 Assert(pPT->a[iPTE].n.u1Present); 364 364 # if PGM_SHW_TYPE == PGM_TYPE_EPT 365 HWACCMInvalidatePhysPage(pV Cpu, (RTGCPHYS)GCPtr);365 HWACCMInvalidatePhysPage(pVM, (RTGCPHYS)GCPtr); 366 366 # else 367 PGM_INVL_ PG(pVCpu, GCPtr);367 PGM_INVL_ALL_VCPU_PG(pVM, GCPtr); 368 368 # endif 369 369 } -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r19829 r19903 2352 2352 2353 2353 2354 #if 0 /* obsolete, but left here for clarification. */ 2354 2355 /** 2355 2356 * Invalidates a guest page by physical address … … 2368 2369 return VINF_SUCCESS; 2369 2370 } 2371 #endif 2370 2372 2371 2373 #if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
Note:
See TracChangeset
for help on using the changeset viewer.