VirtualBox

Changeset 92391 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Nov 12, 2021 9:47:48 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148245
Message:

VMM/PGM,GMM: Made pgmR0PhysAllocateHandyPages & GMMR0AllocateHandyPages callable from ring-0 HM context, eliminating the need for the call-ring-3 fun. bugref:10093

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/GMMR0.cpp

    r92368 r92391  
    29422942
    29432943    /*
    2944      * Validate, get basics and take the semaphore.
     2944     * Validate & get basics.
    29452945     * (This is a relatively busy path, so make predictions where possible.)
    29462946     */
     
    29832983    }
    29842984
    2985     gmmR0MutexAcquire(pGMM);
    2986     if (GMM_CHECK_SANITY_UPON_ENTERING(pGMM))
     2985    /*
     2986     * Take the semaphore
     2987     */
     2988    VMMR0EMTBLOCKCTX Ctx;
     2989    PGVMCPU          pGVCpu = &pGVM->aCpus[idCpu];
     2990    rc = VMMR0EmtPrepareToBlock(pGVCpu, VINF_SUCCESS, "GMMR0AllocateHandyPages", pGMM, &Ctx);
     2991    AssertRCReturn(rc, rc);
     2992
     2993    rc = gmmR0MutexAcquire(pGMM);
     2994    if (   RT_SUCCESS(rc)
     2995        && GMM_CHECK_SANITY_UPON_ENTERING(pGMM))
    29872996    {
    29882997        /* No allocations before the initial reservation has been made! */
     
    31053114            rc = VERR_WRONG_ORDER;
    31063115        GMM_CHECK_SANITY_UPON_LEAVING(pGMM);
    3107     }
    3108     else
     3116        gmmR0MutexRelease(pGMM);
     3117    }
     3118    else if (RT_SUCCESS(rc))
     3119    {
     3120        gmmR0MutexRelease(pGMM);
    31093121        rc = VERR_GMM_IS_NOT_SANE;
    3110     gmmR0MutexRelease(pGMM);
     3122    }
     3123    VMMR0EmtResumeAfterBlocking(pGVCpu, &Ctx);
     3124
    31113125    LogFlow(("GMMR0AllocateHandyPages: returns %Rrc\n", rc));
    31123126    return rc;
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r92368 r92391  
    12941294            switch (pVCpu->vmm.s.enmCallRing3Operation)
    12951295            {
    1296                 case VMMCALLRING3_PGM_ALLOCATE_HANDY_PAGES:
    1297                     STAM_COUNTER_INC(&pVM->vmm.s.StatRZCallPGMAllocHandy);
    1298                     break;
    12991296                case VMMCALLRING3_VM_R0_ASSERTION:
    13001297                default:
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