Changeset 30027 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Jun 4, 2010 11:06:02 AM (15 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r29983 r30027 3546 3546 if (!pRecVM) 3547 3547 { 3548 pRecVM = (PGMMSHAREDMODULEPERVM)RTMemAllocZ( sizeof(*pRecVM));3548 pRecVM = (PGMMSHAREDMODULEPERVM)RTMemAllocZ(RT_OFFSETOF(GMMSHAREDMODULEPERVM, aRegions[cRegions])); 3549 3549 if (!pRecVM) 3550 3550 { … … 3554 3554 } 3555 3555 pRecVM->Core.Key = GCBaseAddr; 3556 pRecVM->cRegions = cRegions; 3557 3558 /* Save the region data as they can differ between VMs (address space scrambling or simply different loading order) */ 3559 for (unsigned i = 0; i < cRegions; i++) 3560 { 3561 pRecVM->aRegions[i].GCRegionAddr = pRegions[i].GCRegionAddr; 3562 pRecVM->aRegions[i].cbRegion = RT_ALIGN_T(pRegions[i].cbRegion, PAGE_SIZE, uint32_t); 3563 pRecVM->aRegions[i].u32Alignment = 0; 3564 pRecVM->aRegions[i].paHCPhysPageID = NULL; /* unused */ 3565 } 3556 3566 3557 3567 bool ret = RTAvlGCPtrInsert(&pGVM->gmm.s.pSharedModuleTree, &pRecVM->Core); … … 4053 4063 typedef struct 4054 4064 { 4055 PGVM pGVM;4056 VMCPUID idCpu;4065 PGVM pGVM; 4066 VMCPUID idCpu; 4057 4067 } GMMCHECKSHAREDMODULEINFO, *PGMMCHECKSHAREDMODULEINFO; 4058 4068 … … 4070 4080 { 4071 4081 Log(("gmmR0CheckSharedModule: check %s %s base=%RGv size=%x collision=%d\n", pGlobalModule->szName, pGlobalModule->szVersion, pGlobalModule->Core.Key, pGlobalModule->cbModule, pLocalModule->fCollision)); 4072 PGMR0SharedModuleCheck(pInfo->pGVM->pVM, pInfo-> idCpu, pGlobalModule, pInfo->pGVM);4082 PGMR0SharedModuleCheck(pInfo->pGVM->pVM, pInfo->pGVM, pInfo->idCpu, pGlobalModule, pLocalModule->cRegions, pLocalModule->aRegions); 4073 4083 } 4074 4084 return 0; … … 4155 4165 4156 4166 Log(("GMMR0CheckSharedModules\n")); 4157 Info.pGVM = pGVM;4158 Info.idCpu = pVCpu->idCpu;4167 Info.pGVM = pGVM; 4168 Info.idCpu = pVCpu->idCpu; 4159 4169 4160 4170 RTAvlGCPtrDoWithAll(&pGVM->gmm.s.pSharedModuleTree, true /* fFromLeft */, gmmR0CheckSharedModule, &Info); -
trunk/src/VBox/VMM/VMMR0/GMMR0Internal.h
r29424 r30027 38 38 typedef GMMVMSIZES *PGMMVMSIZES; 39 39 40 40 41 /** 41 42 * Shared module registration info (per VM) … … 52 53 bool fCollision; 53 54 /** Alignment. */ 54 bool bAlignment[7]; 55 bool bAlignment[3]; 56 57 /** Number of included region descriptors */ 58 uint32_t cRegions; 59 60 /** Shared region descriptor(s). */ 61 GMMSHAREDREGIONDESC aRegions[1]; 55 62 } GMMSHAREDMODULEPERVM; 56 63 /** Pointer to a GMMSHAREDMODULEPERVM. */ -
trunk/src/VBox/VMM/VMMR0/PGMR0SharedPage.cpp
r30013 r30027 40 40 * @param idCpu VCPU id 41 41 * @param pModule Module description 42 * @param cRegions Number of regions 43 * @param pRegions Region array 42 44 * @param pGVM Pointer to the GVM instance data. 43 45 */ 44 VMMR0DECL(int) PGMR0SharedModuleCheck(PVM pVM, VMCPUID idCpu, PGMMSHAREDMODULE pModule, PGVM pGVM)46 VMMR0DECL(int) PGMR0SharedModuleCheck(PVM pVM, PGVM pGVM, VMCPUID idCpu, PGMMSHAREDMODULE pModule, uint32_t cRegions, PGMMSHAREDREGIONDESC pRegions) 45 47 { 46 48 int rc = VINF_SUCCESS; … … 55 57 56 58 /* Check every region of the shared module. */ 57 for (unsigned idx Module = 0; idxModule < pModule->cRegions; idxModule++)59 for (unsigned idxRegion = 0; idxRegion < cRegions; idxRegion++) 58 60 { 59 Assert((p Module->aRegions[idxModule].cbRegion & 0xfff) == 0);60 Assert((p Module->aRegions[idxModule].GCRegionAddr & 0xfff) == 0);61 Assert((pRegions[idxRegion].cbRegion & 0xfff) == 0); 62 Assert((pRegions[idxRegion].GCRegionAddr & 0xfff) == 0); 61 63 62 RTGCPTR GCRegion = p Module->aRegions[idxModule].GCRegionAddr;63 unsigned cbRegion = p Module->aRegions[idxModule].cbRegion & ~0xfff;64 RTGCPTR GCRegion = pRegions[idxRegion].GCRegionAddr; 65 unsigned cbRegion = pRegions[idxRegion].cbRegion & ~0xfff; 64 66 unsigned idxPage = 0; 65 67 bool fValidChanges = false; … … 111 113 if (fValidChanges) 112 114 { 113 rc = GMMR0SharedModuleCheckRange(pGVM, pModule, idx Module, idxPage, paPageDesc);115 rc = GMMR0SharedModuleCheckRange(pGVM, pModule, idxRegion, idxPage, paPageDesc); 114 116 AssertRC(rc); 115 117 if (RT_FAILURE(rc)) … … 132 134 Assert(!PGM_PAGE_IS_SHARED(pPage)); 133 135 134 Log(("PGMR0SharedModuleCheck: shared page gc virt=%RGv phys %RGp host %RHp->%RHp\n", p Module->aRegions[idxModule].GCRegionAddr + i * PAGE_SIZE, paPageDesc[i].GCPhys, PGM_PAGE_GET_HCPHYS(pPage), paPageDesc[i].HCPhys));136 Log(("PGMR0SharedModuleCheck: shared page gc virt=%RGv phys %RGp host %RHp->%RHp\n", pRegions[idxRegion].GCRegionAddr + i * PAGE_SIZE, paPageDesc[i].GCPhys, PGM_PAGE_GET_HCPHYS(pPage), paPageDesc[i].HCPhys)); 135 137 if (paPageDesc[i].HCPhys != PGM_PAGE_GET_HCPHYS(pPage)) 136 138 {
Note:
See TracChangeset
for help on using the changeset viewer.