Changeset 67993 in vbox
- Timestamp:
- Jul 17, 2017 12:50:13 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 117002
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/gmm.h
r62476 r67993 403 403 GMMOCPOLICY enmPolicy, GMMPRIORITY enmPriority); 404 404 GMMR0DECL(int) GMMR0UpdateReservation(PVM pVM, VMCPUID idCpu, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages); 405 GMMR0DECL(int) GMMR0AllocateHandyPages(PVM pVM, VMCPUID idCpu, uint32_t cPagesToUpdate, uint32_t cPagesToAlloc, PGMMPAGEDESC paPages); 405 GMMR0DECL(int) GMMR0AllocateHandyPages(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint32_t cPagesToUpdate, 406 uint32_t cPagesToAlloc, PGMMPAGEDESC paPages); 406 407 GMMR0DECL(int) GMMR0AllocatePages(PVM pVM, VMCPUID idCpu, uint32_t cPages, PGMMPAGEDESC paPages, GMMACCOUNT enmAccount); 407 408 GMMR0DECL(int) GMMR0AllocateLargePage(PVM pVM, VMCPUID idCpu, uint32_t cbPage, uint32_t *pIdPage, RTHCPHYS *pHCPhys); -
trunk/include/VBox/vmm/pgm.h
r66023 r67993 692 692 * @{ 693 693 */ 694 VMMR0_INT_DECL(int) PGMR0PhysAllocateHandyPages(P VM pVM, PVMCPU pVCpu);695 VMMR0_INT_DECL(int) PGMR0PhysFlushHandyPages(P VM pVM, PVMCPU pVCpu);694 VMMR0_INT_DECL(int) PGMR0PhysAllocateHandyPages(PGVM pGVM, PVM pVM, VMCPUID idCpu); 695 VMMR0_INT_DECL(int) PGMR0PhysFlushHandyPages(PGVM pGVM, PVM pVM, VMCPUID idCpu); 696 696 VMMR0_INT_DECL(int) PGMR0PhysAllocateLargeHandyPage(PVM pVM, PVMCPU pVCpu); 697 697 VMMR0_INT_DECL(int) PGMR0PhysSetupIommu(PVM pVM); -
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r66439 r67993 2729 2729 * @param paPages The array of page descriptors. 2730 2730 * See GMMPAGEDESC for details on what is expected on input. 2731 * @thread EMT. 2732 */ 2733 GMMR0DECL(int) GMMR0AllocateHandyPages(PVM pVM, VMCPUID idCpu, uint32_t cPagesToUpdate, uint32_t cPagesToAlloc, PGMMPAGEDESC paPages) 2734 { 2735 LogFlow(("GMMR0AllocateHandyPages: pVM=%p cPagesToUpdate=%#x cPagesToAlloc=%#x paPages=%p\n", 2736 pVM, cPagesToUpdate, cPagesToAlloc, paPages)); 2731 * @thread EMT(idCpu) 2732 */ 2733 GMMR0DECL(int) GMMR0AllocateHandyPages(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint32_t cPagesToUpdate, 2734 uint32_t cPagesToAlloc, PGMMPAGEDESC paPages) 2735 { 2736 LogFlow(("GMMR0AllocateHandyPages: pGVM=%p pVM=%p cPagesToUpdate=%#x cPagesToAlloc=%#x paPages=%p\n", 2737 pGVM, pVM, cPagesToUpdate, cPagesToAlloc, paPages)); 2737 2738 2738 2739 /* … … 2742 2743 PGMM pGMM; 2743 2744 GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE); 2744 PGVM pGVM; 2745 int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM); 2745 int rc = GVMMR0ValidateGVMandVMandEMT(pGVM, pVM, idCpu); 2746 2746 if (RT_FAILURE(rc)) 2747 2747 return rc; -
trunk/src/VBox/VMM/VMMR0/PGMR0.cpp
r63560 r67993 61 61 * @retval VINF_EM_NO_MEMORY if we're out of memory. The FF is set in this case. 62 62 * 63 * @param pGVM The global (ring-0) VM structure. 63 64 * @param pVM The cross context VM structure. 64 * @param pVCpu The cross context virtual CPU structure. 65 * @param idCpu The ID of the calling EMT. 66 * 67 * @thread EMT(idCpu) 65 68 * 66 69 * @remarks Must be called from within the PGM critical section. The caller 67 70 * must clear the new pages. 68 71 */ 69 VMMR0_INT_DECL(int) PGMR0PhysAllocateHandyPages(PVM pVM, PVMCPU pVCpu) 70 { 72 VMMR0_INT_DECL(int) PGMR0PhysAllocateHandyPages(PGVM pGVM, PVM pVM, VMCPUID idCpu) 73 { 74 /* 75 * Validate inputs. 76 */ 77 AssertReturn(idCpu < pGVM->cCpus, VERR_INVALID_CPU_ID); /* caller already checked this, but just to be sure. */ 78 AssertReturn(pGVM->aCpus[idCpu].hEMT == RTThreadNativeSelf(), VERR_NOT_OWNER); 79 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 80 71 81 PGM_LOCK_ASSERT_OWNER_EX(pVM, pVCpu); 72 82 … … 85 95 if (!cPages) 86 96 return VINF_SUCCESS; 87 int rc = GMMR0AllocateHandyPages(p VM, pVCpu->idCpu, cPages, cPages, &pVM->pgm.s.aHandyPages[iFirst]);97 int rc = GMMR0AllocateHandyPages(pGVM, pVM, idCpu, cPages, cPages, &pVM->pgm.s.aHandyPages[iFirst]); 88 98 if (RT_SUCCESS(rc)) 89 99 { … … 127 137 if (cPages + iFirst < PGM_HANDY_PAGES_MIN) 128 138 cPages = PGM_HANDY_PAGES_MIN - iFirst; 129 rc = GMMR0AllocateHandyPages(p VM, pVCpu->idCpu, 0, cPages, &pVM->pgm.s.aHandyPages[iFirst]);139 rc = GMMR0AllocateHandyPages(pGVM, pVM, idCpu, 0, cPages, &pVM->pgm.s.aHandyPages[iFirst]); 130 140 } while ( ( rc == VERR_GMM_HIT_GLOBAL_LIMIT 131 141 || rc == VERR_GMM_HIT_VM_ACCOUNT_LIMIT) … … 177 187 * @retval VINF_SUCCESS on success. FF cleared. 178 188 * 189 * @param pGVM The global (ring-0) VM structure. 179 190 * @param pVM The cross context VM structure. 180 * @param pVCpu The cross context virtual CPU structure. 191 * @param idCpu The ID of the calling EMT. 192 * 193 * @thread EMT(idCpu) 181 194 * 182 195 * @remarks Must be called from within the PGM critical section. 183 196 */ 184 VMMR0_INT_DECL(int) PGMR0PhysFlushHandyPages(PVM pVM, PVMCPU pVCpu) 185 { 197 VMMR0_INT_DECL(int) PGMR0PhysFlushHandyPages(PGVM pGVM, PVM pVM, VMCPUID idCpu) 198 { 199 /* 200 * Validate inputs. 201 */ 202 AssertReturn(idCpu < pGVM->cCpus, VERR_INVALID_CPU_ID); /* caller already checked this, but just to be sure. */ 203 AssertReturn(pGVM->aCpus[idCpu].hEMT == RTThreadNativeSelf(), VERR_NOT_OWNER); 204 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 205 186 206 PGM_LOCK_ASSERT_OWNER_EX(pVM, pVCpu); 187 207 … … 194 214 if (!cPages) 195 215 return VINF_SUCCESS; 196 int rc = GMMR0AllocateHandyPages(p VM, pVCpu->idCpu, cPages, 0, &pVM->pgm.s.aHandyPages[iFirst]);216 int rc = GMMR0AllocateHandyPages(pGVM, pVM, idCpu, cPages, 0, &pVM->pgm.s.aHandyPages[iFirst]); 197 217 198 218 LogFlow(("PGMR0PhysFlushHandyPages: cPages=%d rc=%Rrc\n", cPages, rc)); -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r67991 r67993 1634 1634 if (idCpu == NIL_VMCPUID) 1635 1635 return VERR_INVALID_CPU_ID; 1636 rc = PGMR0PhysAllocateHandyPages(p VM, &pVM->aCpus[idCpu]);1636 rc = PGMR0PhysAllocateHandyPages(pGVM, pVM, idCpu); 1637 1637 VMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 1638 1638 break; … … 1641 1641 if (idCpu == NIL_VMCPUID) 1642 1642 return VERR_INVALID_CPU_ID; 1643 rc = PGMR0PhysFlushHandyPages(p VM, &pVM->aCpus[idCpu]);1643 rc = PGMR0PhysFlushHandyPages(pGVM, pVM, idCpu); 1644 1644 VMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 1645 1645 break;
Note:
See TracChangeset
for help on using the changeset viewer.