Index: trunk/include/VBox/err.h
===================================================================
--- trunk/include/VBox/err.h	(revision 20405)
+++ trunk/include/VBox/err.h	(revision 20406)
@@ -690,8 +690,4 @@
 /** Recompiler execution was interrupted by forced action. */
 #define VINF_REM_INTERRUPED_FF              2302
-/** Reason for leaving GC: Must flush pending invlpg operations to REM.
- * Tell REM to flush page invalidations. Will temporary go to REM context
- * from REM and perform the flushes. */
-#define VERR_REM_FLUSHED_PAGES_OVERFLOW     (-2303)
 /** Too many similar traps. This is a very useful debug only
  * check (we don't do double/tripple faults in REM). */
Index: trunk/src/VBox/VMM/EM.cpp
===================================================================
--- trunk/src/VBox/VMM/EM.cpp	(revision 20405)
+++ trunk/src/VBox/VMM/EM.cpp	(revision 20406)
@@ -2505,15 +2505,4 @@
 
         /*
-         * REMGCNotifyInvalidatePage() failed because of overflow.
-         */
-        case VERR_REM_FLUSHED_PAGES_OVERFLOW:
-            Assert((pCtx->ss & X86_SEL_RPL) != 1);
-            EMR3RemLock(pVM);
-            REMR3ReplayInvalidatedPages(pVM, pVCpu);
-            EMR3RemUnlock(pVM);
-            rc = VINF_SUCCESS;
-            break;
-
-        /*
          * I/O Port access - emulate the instruction.
          */
Index: trunk/src/VBox/VMM/VMM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMM.cpp	(revision 20405)
+++ trunk/src/VBox/VMM/VMM.cpp	(revision 20406)
@@ -357,5 +357,4 @@
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetPatchGP,             STAMTYPE_COUNTER, "/VMM/RZRet/PatchGP",             STAMUNIT_OCCURENCES, "Number of VINF_PATM_PATCH_TRAP_GP returns.");
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetPatchIretIRQ,        STAMTYPE_COUNTER, "/VMM/RZRet/PatchIret",           STAMUNIT_OCCURENCES, "Number of VINF_PATM_PENDING_IRQ_AFTER_IRET returns.");
-    STAM_REG(pVM, &pVM->vmm.s.StatRZRetPageOverflow,        STAMTYPE_COUNTER, "/VMM/RZRet/InvlpgOverflow",      STAMUNIT_OCCURENCES, "Number of VERR_REM_FLUSHED_PAGES_OVERFLOW returns.");
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetRescheduleREM,       STAMTYPE_COUNTER, "/VMM/RZRet/ScheduleREM",         STAMUNIT_OCCURENCES, "Number of VINF_EM_RESCHEDULE_REM returns.");
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetToR3,                STAMTYPE_COUNTER, "/VMM/RZRet/ToR3",                STAMUNIT_OCCURENCES, "Number of VINF_EM_RAW_TO_R3 returns.");
Index: trunk/src/VBox/VMM/VMMAll/EMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/EMAll.cpp	(revision 20405)
+++ trunk/src/VBox/VMM/VMMAll/EMAll.cpp	(revision 20406)
@@ -1888,6 +1888,5 @@
         ||  rc == VINF_PGM_SYNC_CR3 /* we can rely on the FF */)
         return VINF_SUCCESS;
-    AssertMsgReturn(   rc == VERR_REM_FLUSHED_PAGES_OVERFLOW
-                    || rc == VINF_EM_RAW_EMULATE_INSTR,
+    AssertMsgReturn(rc == VINF_EM_RAW_EMULATE_INSTR,
                     ("%Rrc addr=%RGv\n", rc, pAddrGC),
                     VERR_EM_INTERPRETER);
@@ -1931,6 +1930,5 @@
         ||  rc == VINF_PGM_SYNC_CR3 /* we can rely on the FF */)
         return VINF_SUCCESS;
-    AssertMsgReturn(   rc == VERR_REM_FLUSHED_PAGES_OVERFLOW
-                    || rc == VINF_EM_RAW_EMULATE_INSTR,
+    AssertMsgReturn(rc == VINF_EM_RAW_EMULATE_INSTR,
                     ("%Rrc addr=%RGv\n", rc, addr),
                     VERR_EM_INTERPRETER);
Index: trunk/src/VBox/VMM/VMMAll/REMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/REMAll.cpp	(revision 20405)
+++ trunk/src/VBox/VMM/VMMAll/REMAll.cpp	(revision 20406)
@@ -41,6 +41,4 @@
  *
  * @returns VINF_SUCCESS on success.
- * @returns VERR_REM_FLUSHED_PAGES_OVERFLOW if a return to HC for flushing of
- *          recorded pages is required before the call can succeed.
  * @param   pVM         The VM handle.
  * @param   GCPtrPage   The
Index: trunk/src/VBox/VMM/VMMInternal.h
===================================================================
--- trunk/src/VBox/VMM/VMMInternal.h	(revision 20405)
+++ trunk/src/VBox/VMM/VMMInternal.h	(revision 20406)
@@ -297,5 +297,4 @@
     STAMCOUNTER                 StatRZRetPatchGP;
     STAMCOUNTER                 StatRZRetPatchIretIRQ;
-    STAMCOUNTER                 StatRZRetPageOverflow;
     STAMCOUNTER                 StatRZRetRescheduleREM;
     STAMCOUNTER                 StatRZRetToR3;
Index: trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp	(revision 20405)
+++ trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp	(revision 20406)
@@ -2652,5 +2652,5 @@
         return VINF_SUCCESS;
     }
-    Assert(rc == VERR_REM_FLUSHED_PAGES_OVERFLOW);
+    AssertRC(rc);
     return rc;
 }
Index: trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/VMMR0.cpp	(revision 20405)
+++ trunk/src/VBox/VMM/VMMR0/VMMR0.cpp	(revision 20406)
@@ -433,7 +433,4 @@
         case VINF_PATM_PENDING_IRQ_AFTER_IRET:
             STAM_COUNTER_INC(&pVM->vmm.s.StatRZRetPatchIretIRQ);
-            break;
-        case VERR_REM_FLUSHED_PAGES_OVERFLOW:
-            STAM_COUNTER_INC(&pVM->vmm.s.StatRZRetPageOverflow);
             break;
         case VINF_EM_RESCHEDULE_REM:
Index: trunk/src/recompiler/VBoxREM.def
===================================================================
--- trunk/src/recompiler/VBoxREM.def	(revision 20405)
+++ trunk/src/recompiler/VBoxREM.def	(revision 20406)
@@ -37,5 +37,4 @@
     REMR3A20Set
     REMR3DisasEnableStepping
-    REMR3ReplayInvalidatedPages
     REMR3ReplayHandlerNotifications
     REMR3NotifyPhysRamRegister
Index: trunk/src/recompiler/VBoxREMWrapper.cpp
===================================================================
--- trunk/src/recompiler/VBoxREMWrapper.cpp	(revision 20405)
+++ trunk/src/recompiler/VBoxREMWrapper.cpp	(revision 20406)
@@ -345,5 +345,4 @@
 static DECLCALLBACKPTR(void, pfnREMR3StateUpdate)(PVM, PVMCPU);
 static DECLCALLBACKPTR(void, pfnREMR3A20Set)(PVM, PVMCPU, bool);
-static DECLCALLBACKPTR(void, pfnREMR3ReplayInvalidatedPages)(PVM, PVMCPU);
 static DECLCALLBACKPTR(void, pfnREMR3ReplayHandlerNotifications)(PVM pVM);
 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamRegister)(PVM, RTGCPHYS, RTGCPHYS, unsigned);
@@ -1048,5 +1047,4 @@
     { "REMR3StateUpdate",                       (void *)&pfnREMR3StateUpdate,                       &g_aArgsVMandVMCPU[0],                      RT_ELEMENTS(g_aArgsVMandVMCPU),                        REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
     { "REMR3A20Set",                            (void *)&pfnREMR3A20Set,                            &g_aArgsA20Set[0],                          RT_ELEMENTS(g_aArgsA20Set),                            REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
-    { "REMR3ReplayInvalidatedPages",            (void *)&pfnREMR3ReplayInvalidatedPages,            &g_aArgsVMandVMCPU[0],                      RT_ELEMENTS(g_aArgsVMandVMCPU),                        REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
     { "REMR3ReplayHandlerNotifications",        (void *)&pfnREMR3ReplayHandlerNotifications,        &g_aArgsVM[0],                              RT_ELEMENTS(g_aArgsVM),                                REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
     { "REMR3NotifyPhysRamRegister",             (void *)&pfnREMR3NotifyPhysRamRegister,             &g_aArgsNotifyPhysRamRegister[0],           RT_ELEMENTS(g_aArgsNotifyPhysRamRegister),             REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
@@ -2154,12 +2152,4 @@
 }
 
-REMR3DECL(void) REMR3ReplayInvalidatedPages(PVM pVM, PVMCPU pVCpu)
-{
-#ifndef USE_REM_STUBS
-    Assert(VALID_PTR(pfnREMR3ReplayInvalidatedPages));
-    pfnREMR3ReplayInvalidatedPages(pVM, pVCpu);
-#endif
-}
-
 REMR3DECL(void) REMR3ReplayHandlerNotifications(PVM pVM)
 {
Index: trunk/src/recompiler/VBoxRecompiler.c
===================================================================
--- trunk/src/recompiler/VBoxRecompiler.c	(revision 20405)
+++ trunk/src/recompiler/VBoxRecompiler.c	(revision 20406)
@@ -2682,39 +2682,4 @@
 
     pVM->rem.s.fIgnoreAll = fSaved;
-}
-
-
-/**
- * Replays the invalidated recorded pages.
- * Called in response to VERR_REM_FLUSHED_PAGES_OVERFLOW from the RAW execution loop.
- *
- * @param   pVM         VM handle.
- * @param   pVCpu       VMCPU handle.
- */
-REMR3DECL(void) REMR3ReplayInvalidatedPages(PVM pVM, PVMCPU pVCpu)
-{
-    RTUINT i;
-
-    VM_ASSERT_EMT(pVM);
-
-    /*
-     * Sync the required registers.
-     */
-    pVM->rem.s.Env.cr[0] = pVM->rem.s.pCtx->cr0;
-    pVM->rem.s.Env.cr[2] = pVM->rem.s.pCtx->cr2;
-    pVM->rem.s.Env.cr[3] = pVM->rem.s.pCtx->cr3;
-    pVM->rem.s.Env.cr[4] = pVM->rem.s.pCtx->cr4;
-
-    /*
-     * Replay the flushes.
-     */
-    pVM->rem.s.fIgnoreInvlPg = true;
-    for (i = 0; i < pVM->rem.s.cInvalidatedPages; i++)
-    {
-        Log2(("REMR3ReplayInvalidatedPages: invlpg %RGv\n", pVM->rem.s.aGCPtrInvalidatedPages[i]));
-        tlb_flush_page(&pVM->rem.s.Env, pVM->rem.s.aGCPtrInvalidatedPages[i]);
-    }
-    pVM->rem.s.fIgnoreInvlPg = false;
-    pVM->rem.s.cInvalidatedPages = 0;
 }
 
