Changeset 29091 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- May 5, 2010 4:12:10 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 61150
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r29024 r29091 3399 3399 if (GMM_CHECK_SANITY_UPON_ENTERING(pGMM)) 3400 3400 { 3401 bool fNewModule = false; 3402 3401 3403 /* Check if this module is already locally registered. */ 3402 3404 PGMMSHAREDMODULEPERVM pRecVM = (PGMMSHAREDMODULEPERVM)RTAvlGCPtrGet(&pGVM->gmm.s.pSharedModuleTree, GCBaseAddr); … … 3415 3417 bool ret = RTAvlGCPtrInsert(&pGVM->gmm.s.pSharedModuleTree, &pRecVM->Core); 3416 3418 Assert(ret); 3419 3420 fNewModule = true; 3417 3421 } 3418 3422 else … … 3423 3427 if (!pRec) 3424 3428 { 3425 Assert( rc != VINF_PGM_SHARED_MODULE_ALREADY_REGISTERED);3429 Assert(fNewModule); 3426 3430 Assert(!pRecVM->fCollision); 3427 3431 … … 3466 3470 pRecVM->pSharedModule = pRec; 3467 3471 pRecVM->fCollision = false; 3468 pRec->cUsers++; 3472 if (fNewModule) 3473 pRec->cUsers++; 3469 3474 rc = VINF_SUCCESS; 3470 3475 } -
trunk/src/VBox/VMM/VMMR0/PGMR0.cpp
r28800 r29091 300 300 } 301 301 302 #ifdef VBOX_WITH_PAGE_SHARING 303 /** 304 * Check a registered module for shared page changes 305 * 306 * @returns The following VBox status codes. 307 * 308 * @param pVM The VM handle. 309 * @param pVCpu The VMCPU handle. 310 * @param pReq Module request packet 311 */ 312 VMMR0DECL(int) PGMR0SharedModuleCheck(PVM pVM, PVMCPU pVCpu, PGMMREGISTERSHAREDMODULEREQ pReq) 313 { 314 int rc = VINF_SUCCESS; 315 316 /* 317 * Validate input. 318 */ 319 AssertPtrReturn(pReq, VERR_INVALID_POINTER); 320 AssertMsgReturn(pReq->Hdr.cbReq >= sizeof(*pReq) && pReq->Hdr.cbReq == RT_UOFFSETOF(GMMREGISTERSHAREDMODULEREQ, aRegions[pReq->cRegions]), ("%#x != %#x\n", pReq->Hdr.cbReq, sizeof(*pReq)), VERR_INVALID_PARAMETER); 321 322 pgmLock(pVM); 323 324 /* Check every region of the shared module. */ 325 for (unsigned i = 0; i < pReq->cRegions; i++) 326 { 327 Assert((pReq->aRegions[i].cbRegion & 0xfff) == 0); 328 Assert((pReq->aRegions[i].GCRegionAddr & 0xfff) == 0); 329 330 RTGCPTR GCRegion = pReq->aRegions[i].GCRegionAddr; 331 uint32_t cbRegion = pReq->aRegions[i].cbRegion & ~0xfff; 332 333 while (cbRegion) 334 { 335 RTGCPHYS GCPhys; 336 uint64_t fFlags; 337 338 rc = PGMGstGetPage(pVCpu, GCRegion, &GCPhys, &fFlags); 339 if ( rc == VINF_SUCCESS 340 && !(fFlags & X86_PTE_RW)) 341 { 342 PPGMPAGE pPage = pgmPhysGetPage(&pVM->pgm.s, GCPhys); 343 if ( pPage 344 && !PGM_PAGE_IS_SHARED(pPage)) 345 { 346 } 347 } 348 349 GCRegion += PAGE_SIZE; 350 cbRegion -= PAGE_SIZE; 351 } 352 } 353 354 pgmUnlock(pVM); 355 return rc; 356 } 357 #endif -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r28974 r29091 877 877 return PGMR0PhysAllocateLargeHandyPage(pVM, &pVM->aCpus[idCpu]); 878 878 879 #ifdef VBOX_WITH_PAGE_SHARING 880 case VMMR0_DO_PGM_CHECK_SHARED_MODULE: 881 { 882 if (idCpu == NIL_VMCPUID) 883 return VERR_INVALID_CPU_ID; 884 885 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 886 887 /* Select a valid VCPU context. */ 888 ASMAtomicWriteU32(&pVCpu->idHostCpu, RTMpCpuId()); 889 890 int rc = PGMR0SharedModuleCheck(pVM, pVCpu, (PGMMREGISTERSHAREDMODULEREQ)pReqHdr); 891 892 /* Clear the VCPU context. */ 893 ASMAtomicWriteU32(&pVCpu->idHostCpu, NIL_RTCPUID); 894 return rc; 895 } 896 #endif 897 879 898 /* 880 899 * GMM wrappers.
Note:
See TracChangeset
for help on using the changeset viewer.