VirtualBox

Changeset 67994 in vbox


Ignore:
Timestamp:
Jul 17, 2017 12:57:08 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
117003
Message:

PGMR0,GVMMR0: Ditto for large page alloc.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/gmm.h

    r67993 r67994  
    406406                                        uint32_t cPagesToAlloc, PGMMPAGEDESC paPages);
    407407GMMR0DECL(int)  GMMR0AllocatePages(PVM pVM, VMCPUID idCpu, uint32_t cPages, PGMMPAGEDESC paPages, GMMACCOUNT enmAccount);
    408 GMMR0DECL(int)  GMMR0AllocateLargePage(PVM pVM, VMCPUID idCpu, uint32_t cbPage, uint32_t *pIdPage, RTHCPHYS *pHCPhys);
     408GMMR0DECL(int)  GMMR0AllocateLargePage(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint32_t cbPage, uint32_t *pIdPage, RTHCPHYS *pHCPhys);
    409409GMMR0DECL(int)  GMMR0FreePages(PVM pVM, VMCPUID idCpu, uint32_t cPages, PGMMFREEPAGEDESC paPages, GMMACCOUNT enmAccount);
    410410GMMR0DECL(int)  GMMR0FreeLargePage(PVM pVM, VMCPUID idCpu, uint32_t idPage);
  • trunk/include/VBox/vmm/pgm.h

    r67993 r67994  
    694694VMMR0_INT_DECL(int) PGMR0PhysAllocateHandyPages(PGVM pGVM, PVM pVM, VMCPUID idCpu);
    695695VMMR0_INT_DECL(int) PGMR0PhysFlushHandyPages(PGVM pGVM, PVM pVM, VMCPUID idCpu);
    696 VMMR0_INT_DECL(int) PGMR0PhysAllocateLargeHandyPage(PVM pVM, PVMCPU pVCpu);
     696VMMR0_INT_DECL(int) PGMR0PhysAllocateLargeHandyPage(PGVM pGVM, PVM pVM, VMCPUID idCpu);
    697697VMMR0_INT_DECL(int) PGMR0PhysSetupIommu(PVM pVM);
    698698VMMR0DECL(int)      PGMR0SharedModuleCheck(PVM pVM, PGVM pGVM, VMCPUID idCpu, PGMMSHAREDMODULE pModule, PCRTGCPTR64 paRegionsGCPtrs);
  • trunk/src/VBox/VMM/VMMR0/GMMR0.cpp

    r67993 r67994  
    30203020 * @returns see GMMR0AllocatePages.
    30213021 *
     3022 * @param   pGVM        The global (ring-0) VM structure.
    30223023 * @param   pVM         The cross context VM structure.
    30233024 * @param   idCpu       The VCPU id.
     
    30263027 * @param   pHCPhys     Where to return the host physical address of the page.
    30273028 */
    3028 GMMR0DECL(int)  GMMR0AllocateLargePage(PVM pVM, VMCPUID idCpu, uint32_t cbPage, uint32_t *pIdPage, RTHCPHYS *pHCPhys)
    3029 {
    3030     LogFlow(("GMMR0AllocateLargePage: pVM=%p cbPage=%x\n", pVM, cbPage));
     3029GMMR0DECL(int)  GMMR0AllocateLargePage(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint32_t cbPage, uint32_t *pIdPage, RTHCPHYS *pHCPhys)
     3030{
     3031    LogFlow(("GMMR0AllocateLargePage: pGVM=%p pVM=%p cbPage=%x\n", pGVM, pVM, cbPage));
    30313032
    30323033    AssertReturn(cbPage == GMM_CHUNK_SIZE, VERR_INVALID_PARAMETER);
     
    30393040    PGMM pGMM;
    30403041    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    3041     PGVM pGVM;
    3042     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     3042    int rc = GVMMR0ValidateGVMandVMandEMT(pGVM, pVM, idCpu);
    30433043    if (RT_FAILURE(rc))
    30443044        return rc;
  • trunk/src/VBox/VMM/VMMR0/PGMR0.cpp

    r67993 r67994  
    228228 * @retval  VINF_EM_NO_MEMORY if we're out of memory.
    229229 *
     230 * @param   pGVM        The global (ring-0) VM structure.
    230231 * @param   pVM         The cross context VM structure.
    231  * @param   pVCpu       The cross context virtual CPU structure.
     232 * @param   idCpu       The ID of the calling EMT.
     233 *
     234 * @thread  EMT(idCpu)
    232235 *
    233236 * @remarks Must be called from within the PGM critical section. The caller
    234237 *          must clear the new pages.
    235238 */
    236 VMMR0_INT_DECL(int) PGMR0PhysAllocateLargeHandyPage(PVM pVM, PVMCPU pVCpu)
    237 {
     239VMMR0_INT_DECL(int) PGMR0PhysAllocateLargeHandyPage(PGVM pGVM, PVM pVM, VMCPUID idCpu)
     240{
     241    /*
     242     * Validate inputs.
     243     */
     244    AssertReturn(idCpu < pGVM->cCpus, VERR_INVALID_CPU_ID); /* caller already checked this, but just to be sure. */
     245    AssertReturn(pGVM->aCpus[idCpu].hEMT == RTThreadNativeSelf(), VERR_NOT_OWNER);
     246    PVMCPU pVCpu = &pVM->aCpus[idCpu];
     247
    238248    PGM_LOCK_ASSERT_OWNER_EX(pVM, pVCpu);
     249
    239250    Assert(!pVM->pgm.s.cLargeHandyPages);
    240251
    241     int rc = GMMR0AllocateLargePage(pVM, pVCpu->idCpu, _2M,
     252    /*
     253     * Do the job.
     254     */
     255    int rc = GMMR0AllocateLargePage(pGVM, pVM, idCpu, _2M,
    242256                                    &pVM->pgm.s.aLargeHandyPage[0].idPage,
    243257                                    &pVM->pgm.s.aLargeHandyPage[0].HCPhysGCPhys);
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r67993 r67994  
    16481648            if (idCpu == NIL_VMCPUID)
    16491649                return VERR_INVALID_CPU_ID;
    1650             rc = PGMR0PhysAllocateLargeHandyPage(pVM, &pVM->aCpus[idCpu]);
     1650            rc = PGMR0PhysAllocateLargeHandyPage(pGVM, pVM, idCpu);
    16511651            VMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING);
    16521652            break;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette