Index: /trunk/include/VBox/vmm/vmm.h
===================================================================
--- /trunk/include/VBox/vmm/vmm.h	(revision 92390)
+++ /trunk/include/VBox/vmm/vmm.h	(revision 92391)
@@ -57,7 +57,4 @@
     /** Signal a ring 0 assertion. */
     VMMCALLRING3_VM_R0_ASSERTION,
-
-    /** Allocates more handy pages. */
-    VMMCALLRING3_PGM_ALLOCATE_HANDY_PAGES,
     /** The usual 32-bit hack. */
     VMMCALLRING3_32BIT_HACK = 0x7fffffff
Index: /trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp	(revision 92390)
+++ /trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp	(revision 92391)
@@ -759,5 +759,5 @@
             int rc = PGMR3PhysAllocateHandyPages(pVM);
 #else
-            int rc = VMMRZCallRing3NoCpu(pVM, VMMCALLRING3_PGM_ALLOCATE_HANDY_PAGES, 0);
+            int rc = pgmR0PhysAllocateHandyPages(pVM, VMMGetCpuId(pVM), false /*fRing3*/);
 #endif
             if (RT_UNLIKELY(rc != VINF_SUCCESS))
@@ -798,5 +798,4 @@
     return VINF_SUCCESS;
 }
-
 
 
Index: /trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/GMMR0.cpp	(revision 92390)
+++ /trunk/src/VBox/VMM/VMMR0/GMMR0.cpp	(revision 92391)
@@ -2942,5 +2942,5 @@
 
     /*
-     * Validate, get basics and take the semaphore.
+     * Validate & get basics.
      * (This is a relatively busy path, so make predictions where possible.)
      */
@@ -2983,6 +2983,15 @@
     }
 
-    gmmR0MutexAcquire(pGMM);
-    if (GMM_CHECK_SANITY_UPON_ENTERING(pGMM))
+    /*
+     * Take the semaphore
+     */
+    VMMR0EMTBLOCKCTX Ctx;
+    PGVMCPU          pGVCpu = &pGVM->aCpus[idCpu];
+    rc = VMMR0EmtPrepareToBlock(pGVCpu, VINF_SUCCESS, "GMMR0AllocateHandyPages", pGMM, &Ctx);
+    AssertRCReturn(rc, rc);
+
+    rc = gmmR0MutexAcquire(pGMM);
+    if (   RT_SUCCESS(rc)
+        && GMM_CHECK_SANITY_UPON_ENTERING(pGMM))
     {
         /* No allocations before the initial reservation has been made! */
@@ -3105,8 +3114,13 @@
             rc = VERR_WRONG_ORDER;
         GMM_CHECK_SANITY_UPON_LEAVING(pGMM);
-    }
-    else
+        gmmR0MutexRelease(pGMM);
+    }
+    else if (RT_SUCCESS(rc))
+    {
+        gmmR0MutexRelease(pGMM);
         rc = VERR_GMM_IS_NOT_SANE;
-    gmmR0MutexRelease(pGMM);
+    }
+    VMMR0EmtResumeAfterBlocking(pGVCpu, &Ctx);
+
     LogFlow(("GMMR0AllocateHandyPages: returns %Rrc\n", rc));
     return rc;
Index: /trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/VMMR0.cpp	(revision 92390)
+++ /trunk/src/VBox/VMM/VMMR0/VMMR0.cpp	(revision 92391)
@@ -1294,7 +1294,4 @@
             switch (pVCpu->vmm.s.enmCallRing3Operation)
             {
-                case VMMCALLRING3_PGM_ALLOCATE_HANDY_PAGES:
-                    STAM_COUNTER_INC(&pVM->vmm.s.StatRZCallPGMAllocHandy);
-                    break;
                 case VMMCALLRING3_VM_R0_ASSERTION:
                 default:
Index: /trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp	(revision 92390)
+++ /trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp	(revision 92391)
@@ -5815,9 +5815,9 @@
 
 /**
- * Response to VM_FF_PGM_NEED_HANDY_PAGES and VMMCALLRING3_PGM_ALLOCATE_HANDY_PAGES.
+ * Response to VM_FF_PGM_NEED_HANDY_PAGES and helper for pgmPhysEnsureHandyPage.
  *
  * This function will also work the VM_FF_PGM_NO_MEMORY force action flag, to
- * signal and clear the out of memory condition. When contracted, this API is
- * used to try clear the condition when the user wants to resume.
+ * signal and clear the out of memory condition.  When called, this API is used
+ * to try clear the condition when the user wants to resume.
  *
  * @returns The following VBox status codes.
Index: /trunk/src/VBox/VMM/VMMR3/VMM.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/VMM.cpp	(revision 92390)
+++ /trunk/src/VBox/VMM/VMMR3/VMM.cpp	(revision 92391)
@@ -430,5 +430,4 @@
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetPatchTPR,            STAMTYPE_COUNTER, "/VMM/RZRet/PatchTPR",            STAMUNIT_OCCURENCES, "Number of VINF_EM_HM_PATCH_TPR_INSTR returns.");
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetCallRing3,           STAMTYPE_COUNTER, "/VMM/RZCallR3/Misc",             STAMUNIT_OCCURENCES, "Number of Other ring-3 calls.");
-    STAM_REG(pVM, &pVM->vmm.s.StatRZCallPGMAllocHandy,      STAMTYPE_COUNTER, "/VMM/RZCallR3/PGMAllocHandy",    STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_PGM_ALLOCATE_HANDY_PAGES calls.");
 
     STAMR3Register(pVM, &pVM->vmm.s.StatLogFlusherFlushes,  STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, "/VMM/LogFlush/00-Flushes",  STAMUNIT_OCCURENCES, "Total number of buffer flushes");
@@ -2500,13 +2499,4 @@
     {
         /*
-         * Allocates more handy pages.
-         */
-        case VMMCALLRING3_PGM_ALLOCATE_HANDY_PAGES:
-        {
-            pVCpu->vmm.s.rcCallRing3 = PGMR3PhysAllocateHandyPages(pVM);
-            break;
-        }
-
-        /*
          * Signal a ring 0 hypervisor assertion.
          * Cancel the longjmp operation that's in progress.
@@ -2531,7 +2521,4 @@
             return VERR_VMM_UNKNOWN_RING3_CALL;
     }
-
-    pVCpu->vmm.s.enmCallRing3Operation = VMMCALLRING3_INVALID;
-    return VINF_SUCCESS;
 }
 
Index: /trunk/src/VBox/VMM/include/PGMInternal.h
===================================================================
--- /trunk/src/VBox/VMM/include/PGMInternal.h	(revision 92390)
+++ /trunk/src/VBox/VMM/include/PGMInternal.h	(revision 92391)
@@ -3812,4 +3812,5 @@
 int             pgmPhysAllocLargePage(PVMCC pVM, RTGCPHYS GCPhys);
 #ifdef IN_RING0
+int             pgmR0PhysAllocateHandyPages(PGVM pGVM, VMCPUID idCpu, bool fRing3);
 int             pgmR0PhysAllocateLargePage(PGVM pGVM, VMCPUID idCpu, RTGCPHYS GCPhys);
 #endif
Index: /trunk/src/VBox/VMM/include/VMMInternal.h
===================================================================
--- /trunk/src/VBox/VMM/include/VMMInternal.h	(revision 92390)
+++ /trunk/src/VBox/VMM/include/VMMInternal.h	(revision 92391)
@@ -414,5 +414,4 @@
     STAMCOUNTER                 StatRZRetPGMFlushPending;
     STAMCOUNTER                 StatRZRetPatchTPR;
-    STAMCOUNTER                 StatRZCallPGMAllocHandy;
     /** @} */
 } VMM;
