Changeset 26577 in vbox
- Timestamp:
- Feb 16, 2010 12:57:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/gmm.h
r26563 r26577 271 271 GMMR0DECL(int) GMMR0AllocateHandyPages(PVM pVM, VMCPUID idCpu, uint32_t cPagesToUpdate, uint32_t cPagesToAlloc, PGMMPAGEDESC paPages); 272 272 GMMR0DECL(int) GMMR0AllocatePages(PVM pVM, VMCPUID idCpu, uint32_t cPages, PGMMPAGEDESC paPages, GMMACCOUNT enmAccount); 273 GMMR0DECL(int) GMMR0AllocateLargePage(PVM pVM, VMCPUID idCpu, uint 64_t cbPage, uint32_t *pidPage);273 GMMR0DECL(int) GMMR0AllocateLargePage(PVM pVM, VMCPUID idCpu, uint32_t cbPage, uint32_t *pidPage, RTHCPHYS *pHCPhys); 274 274 GMMR0DECL(int) GMMR0FreePages(PVM pVM, VMCPUID idCpu, uint32_t cPages, PGMMFREEPAGEDESC paPages, GMMACCOUNT enmAccount); 275 275 GMMR0DECL(int) GMMR0FreeLargePage(PVM pVM, VMCPUID idCpu, uint32_t idPage); … … 419 419 */ 420 420 uint32_t idPage; 421 /* Host physical address of the large page. */ 422 RTHCPHYS HCPhys; 421 423 } GMMALLOCLARGEPAGEREQ; 422 424 /** Pointer to a GMMR0AllocateLargePageReq / VMMR0_DO_GMM_ALLOC_LARGE_PAGE request buffer. */ … … 459 461 GMMR3DECL(void) GMMR3FreePagesCleanup(PGMMFREEPAGESREQ pReq); 460 462 GMMR3DECL(void) GMMR3FreeAllocatedPages(PVM pVM, GMMALLOCATEPAGESREQ const *pAllocReq); 463 GMMR3DECL(int) GMMR3AllocateLargePage(PVM pVM, uint32_t cbPage, uint32_t *pidPage, RTHCPHYS *pHCPhys); 464 GMMR3DECL(int) GMMR3FreeLargePage(PVM pVM, uint32_t idPage); 461 465 GMMR3DECL(int) GMMR3DeflatedBalloon(PVM pVM, uint32_t cPages); 462 466 GMMR3DECL(int) GMMR3MapUnmapChunk(PVM pVM, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3); -
trunk/include/VBox/pgm.h
r26330 r26577 533 533 VMMR3DECL(void) PGMR3PhysChunkInvalidateTLB(PVM pVM); 534 534 VMMR3DECL(int) PGMR3PhysAllocateHandyPages(PVM pVM); 535 535 VMMR3DECL(int) PGMR3PhysAllocateLargePage(PVM pVM); 536 536 537 537 VMMR3DECL(void) PGMR3ReleaseOwnedLocks(PVM pVM); -
trunk/include/VBox/vmm.h
r26563 r26577 95 95 /** Allocates more handy pages. */ 96 96 VMMCALLRING3_PGM_ALLOCATE_HANDY_PAGES, 97 /** Allocates a large (2MB) page. */ 98 VMMCALLRING3_PGM_ALLOCATE_LARGE_PAGE, 97 99 /** Acquire the MM hypervisor heap lock. */ 98 100 VMMCALLRING3_MMHYPER_LOCK, -
trunk/src/VBox/VMM/GMM.cpp
r20864 r26577 314 314 } 315 315 316 /** 317 * @see GMMR0AllocateLargePage 318 */ 319 GMMR3DECL(int) GMMR3AllocateLargePage(PVM pVM, uint32_t cbPage, uint32_t *pidPage, RTHCPHYS *pHCPhys) 320 { 321 GMMALLOCLARGEPAGEREQ Req; 322 Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 323 Req.Hdr.cbReq = sizeof(Req); 324 Req.cbPage = cbPage; 325 Req.idPage = NIL_GMM_PAGEID; 326 int rc = VMMR3CallR0(pVM, VMMR0_DO_GMM_ALLOC_LARGE_PAGE, 0, &Req.Hdr); 327 if (RT_SUCCESS(rc) && pidPage) 328 *pidPage = Req.idPage; 329 330 if (RT_SUCCESS(rc) && pHCPhys) 331 *pHCPhys = Req.HCPhys; 332 return rc; 333 } 334 335 /** 336 * @see GMMR0FreeLargePage 337 */ 338 GMMR3DECL(int) GMMR3FreeLargePage(PVM pVM, uint32_t idPage) 339 { 340 GMMFREELARGEPAGEREQ Req; 341 Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 342 Req.Hdr.cbReq = sizeof(Req); 343 Req.idPage = idPage; 344 return VMMR3CallR0(pVM, VMMR0_DO_GMM_FREE_LARGE_PAGE, 0, &Req.Hdr); 345 } 316 346 317 347 /** -
trunk/src/VBox/VMM/PGMInternal.h
r26491 r26577 2650 2650 /** The GC mapping of the zero page. */ 2651 2651 RTGCPTR pvZeroPgRC; 2652 #if GC_ARCH_BITS != 322653 uint32_t u32ZeroAlignment; /**< Alignment padding. */2654 #endif2655 2652 /** @}*/ 2656 2653 2657 2654 /** The number of handy pages. */ 2658 2655 uint32_t cHandyPages; 2656 2657 /** The number of large handy pages. */ 2658 uint32_t cLargeHandyPages; 2659 2659 2660 /** 2660 2661 * Array of handy pages. … … 2668 2669 */ 2669 2670 GMMPAGEDESC aHandyPages[PGM_HANDY_PAGES]; 2671 2672 /** 2673 * Array of large handy pages. (currently size 1) 2674 * 2675 * This array is used in a two way communication between pgmPhysAllocLargePage 2676 * and GMMR0AllocateLargePage, with PGMR3PhysAllocateLargePage serving as 2677 * an intermediary. 2678 */ 2679 GMMPAGEDESC aLargeHandyPage[1]; 2670 2680 2671 2681 /** -
trunk/src/VBox/VMM/PGMPhys.cpp
r26364 r26577 3165 3165 3166 3166 /** 3167 * Response to VMMCALLRING3_PGM_ALLOCATE_LARGE_PAGE to allocate a large (2MB) page 3168 * for use with a nested paging PDE. 3169 * 3170 * @returns The following VBox status codes. 3171 * @retval VINF_SUCCESS on success. 3172 * @retval VINF_EM_NO_MEMORY if we're out of memory. 3173 * 3174 * @param pVM The VM handle. 3175 */ 3176 VMMR3DECL(int) PGMR3PhysAllocateLargePage(PVM pVM) 3177 { 3178 int rc = VINF_SUCCESS; 3179 uint32_t idPage; 3180 RTHCPHYS HCPhys; 3181 void *pvDummy; 3182 3183 pgmLock(pVM); 3184 3185 rc = GMMR3AllocateLargePage(pVM, _2M, &idPage, &HCPhys); 3186 if (RT_SUCCESS(rc)) 3187 { 3188 /* Map the large page into our address space. */ 3189 rc = pgmPhysPageMapByPageID(pVM, idPage, HCPhys, &pvDummy); 3190 } 3191 3192 pgmUnlock(pVM); 3193 return rc; 3194 } 3195 3196 3197 /** 3167 3198 * Response to VM_FF_PGM_NEED_HANDY_PAGES and VMMCALLRING3_PGM_ALLOCATE_HANDY_PAGES. 3168 3199 * -
trunk/src/VBox/VMM/VMM.cpp
r26437 r26577 2071 2071 2072 2072 /* 2073 * Allocates a large page. 2074 */ 2075 case VMMCALLRING3_PGM_ALLOCATE_LARGE_PAGE: 2076 { 2077 pVCpu->vmm.s.rcCallRing3 = PGMR3PhysAllocateLargePage(pVM); 2078 break; 2079 } 2080 2081 /* 2073 2082 * Acquire the PGM lock. 2074 2083 */ -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r26570 r26577 2937 2937 Assert(!PdeDst.n.u1Present); /* We're only supposed to call SyncPT on PDE!P and conflicts.*/ 2938 2938 2939 # if PGM_SHW_TYPE == PGM_TYPE_EPT 2940 2941 # endif 2942 2939 2943 GSTPDE PdeSrc; 2940 2944 PdeSrc.au32[0] = 0; /* faked so we don't have to #ifdef everything */ -
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r26564 r26577 2291 2291 * @param cbPage Large page size 2292 2292 * @param pidPage Id of the page (out) 2293 */ 2294 GMMR0DECL(int) GMMR0AllocateLargePage(PVM pVM, VMCPUID idCpu, uint32_t cbPage, uint32_t *pidPage) 2293 * @param HCPhys Host physical address of the page (out) 2294 */ 2295 GMMR0DECL(int) GMMR0AllocateLargePage(PVM pVM, VMCPUID idCpu, uint32_t cbPage, uint32_t *pidPage, RTHCPHYS *pHCPhys) 2295 2296 { 2296 2297 LogFlow(("GMMR0AllocateLargePage: pVM=%p cbPage=%x\n", pVM, cbPage)); 2297 2298 2298 2299 AssertReturn(cbPage == GMM_CHUNK_SIZE, VERR_INVALID_PARAMETER); 2300 AssertPtrReturn(pidPage, VERR_INVALID_PARAMETER); 2301 AssertPtrReturn(pHCPhys, VERR_INVALID_PARAMETER); 2299 2302 2300 2303 /* … … 2313 2316 2314 2317 *pidPage = NIL_GMM_PAGEID; 2318 *pHCPhys = NIL_RTHCPHYS; 2315 2319 2316 2320 rc = RTSemFastMutexRequest(pGMM->Mtx); … … 2345 2349 /* Return the first page as we'll use the whole chunk as one big page. */ 2346 2350 *pidPage = PageDesc.idPage; 2351 *pHCPhys = PageDesc.HCPhysGCPhys; 2347 2352 2348 2353 for (unsigned i = 1; i < cPages; i++) … … 2384 2389 VERR_INVALID_PARAMETER); 2385 2390 2386 return GMMR0AllocateLargePage(pVM, idCpu, pReq->cbPage, &pReq->idPage );2391 return GMMR0AllocateLargePage(pVM, idCpu, pReq->cbPage, &pReq->idPage, &pReq->HCPhys); 2387 2392 } 2388 2393
Note:
See TracChangeset
for help on using the changeset viewer.