Changeset 29557 in vbox
- Timestamp:
- May 17, 2010 3:01:12 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/gmm.h
r29458 r29557 298 298 GMMR0DECL(int) GMMR0UnregisterSharedModule(PVM pVM, VMCPUID idCpu, char *pszModuleName, char *pszVersion, RTGCPTR GCBaseAddr, uint32_t cbModule); 299 299 GMMR0DECL(int) GMMR0UnregisterAllSharedModules(PVM pVM, VMCPUID idCpu); 300 GMMR0DECL(int) GMMR0CheckSharedModules(PVM pVM, VMCPUID idCpu);300 GMMR0DECL(int) GMMR0CheckSharedModules(PVM pVM, PVMCPU pVCpu); 301 301 GMMR0DECL(int) GMMR0ResetSharedModules(PVM pVM, VMCPUID idCpu); 302 302 #ifdef LOG_ENABLED 303 GMMR0DECL(int) GMMR0CheckSharedModulesStart(PVM pVM); 304 GMMR0DECL(int) GMMR0CheckSharedModulesEnd(PVM pVM); 305 #endif 303 306 304 307 -
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r29554 r29557 151 151 *******************************************************************************/ 152 152 #define LOG_GROUP LOG_GROUP_GMM 153 #include <VBox/vm.h> 153 154 #include <VBox/gmm.h> 154 155 #include "GMMR0Internal.h" … … 3993 3994 #endif 3994 3995 3995 /** 3996 * Check all shared modules for the specified VM 3996 #ifdef DEBUG_sandervl 3997 /** 3998 * Setup for a GMMR0CheckSharedModules call (to allow log flush jumps back to ring 3) 3997 3999 * 3998 4000 * @returns VBox status code. 3999 4001 * @param pVM VM handle 4000 * @param idCpu VCPU id 4001 */ 4002 GMMR0DECL(int) GMMR0CheckSharedModules(PVM pVM, VMCPUID idCpu) 4002 */ 4003 GMMR0DECL(int) GMMR0CheckSharedModulesStart(PVM pVM) 4004 { 4005 /* 4006 * Validate input and get the basics. 4007 */ 4008 PGMM pGMM; 4009 GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR); 4010 4011 /* 4012 * Take the sempahore and do some more validations. 4013 */ 4014 int rc = RTSemFastMutexRequest(pGMM->Mtx); 4015 AssertRC(rc); 4016 if (!GMM_CHECK_SANITY_UPON_ENTERING(pGMM)) 4017 rc = VERR_INTERNAL_ERROR_5; 4018 else 4019 rc = VINF_SUCCESS; 4020 4021 return rc; 4022 } 4023 4024 /** 4025 * Clean up after a GMMR0CheckSharedModules call (to allow log flush jumps back to ring 3) 4026 * 4027 * @returns VBox status code. 4028 * @param pVM VM handle 4029 */ 4030 GMMR0DECL(int) GMMR0CheckSharedModulesEnd(PVM pVM) 4031 { 4032 /* 4033 * Validate input and get the basics. 4034 */ 4035 PGMM pGMM; 4036 GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR); 4037 4038 RTSemFastMutexRelease(pGMM->Mtx); 4039 return VINF_SUCCESS; 4040 } 4041 #endif 4042 4043 /** 4044 * Check all shared modules for the specified VM 4045 * 4046 * @returns VBox status code. 4047 * @param pVM VM handle 4048 * @param pVCpu VMCPU handle 4049 */ 4050 GMMR0DECL(int) GMMR0CheckSharedModules(PVM pVM, PVMCPU pVCpu) 4003 4051 { 4004 4052 #ifdef VBOX_WITH_PAGE_SHARING … … 4009 4057 GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR); 4010 4058 PGVM pGVM; 4011 int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);4059 int rc = GVMMR0ByVMAndEMT(pVM, pVCpu->idCpu, &pGVM); 4012 4060 if (RT_FAILURE(rc)) 4013 4061 return rc; 4014 4062 4063 # ifndef DEBUG_sandervl 4015 4064 /* 4016 4065 * Take the sempahore and do some more validations. … … 4018 4067 rc = RTSemFastMutexRequest(pGMM->Mtx); 4019 4068 AssertRC(rc); 4069 # endif 4020 4070 if (GMM_CHECK_SANITY_UPON_ENTERING(pGMM)) 4021 4071 { … … 4024 4074 Log(("GMMR0CheckSharedModules\n")); 4025 4075 Info.pGVM = pGVM; 4026 Info.idCpu = idCpu;4076 Info.idCpu = pVCpu->idCpu; 4027 4077 4028 4078 RTAvlGCPtrDoWithAll(&pGVM->gmm.s.pSharedModuleTree, true /* fFromLeft */, gmmR0CheckSharedModule, &Info); … … 4035 4085 rc = VERR_INTERNAL_ERROR_5; 4036 4086 4087 # ifndef DEBUG_sandervl 4037 4088 RTSemFastMutexRelease(pGMM->Mtx); 4089 # endif 4038 4090 return rc; 4039 4091 #else -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r29521 r29557 969 969 ASMAtomicWriteU32(&pVCpu->idHostCpu, RTMpCpuId()); 970 970 971 int rc = GMMR0CheckSharedModules(pVM, idCpu); 971 # ifdef DEBUG_sandervl 972 /* Make sure that log flushes can jump back to ring-3; annoying to get an incomplete log (this is risky though as the code doesn't take this into account). */ 973 int rc = GMMR0CheckSharedModulesStart(pVM); 974 if (rc == VINF_SUCCESS) 975 { 976 rc = vmmR0CallRing3SetJmp(&pVCpu->vmm.s.CallRing3JmpBufR0, GMMR0CheckSharedModules, pVM, pVCpu); /* this may resume code. */ 977 GMMR0CheckSharedModulesEnd(pVM); 978 } 979 # else 980 int rc = GMMR0CheckSharedModules(pVM, pVCpu); 981 # endif 972 982 973 983 /* Clear the VCPU context. */
Note:
See TracChangeset
for help on using the changeset viewer.