Index: /trunk/include/VBox/err.h
===================================================================
--- /trunk/include/VBox/err.h	(revision 92492)
+++ /trunk/include/VBox/err.h	(revision 92493)
@@ -512,8 +512,4 @@
  * aliased or/and mapped by multiple PTs. */
 #define VINF_PGM_GCPHYS_ALIASED             1623
-/** Reason for leaving RC: Paging mode changed.
- * PGMChangeMode() uses this to force a switch to R3 so it can safely deal with
- * a mode switch. */
-#define VINF_PGM_CHANGE_MODE                1624
 /** SyncPage modified the PDE.
  * This is an internal status code used to communicate back to the \#PF handler
Index: /trunk/src/VBox/VMM/VMMAll/IEMAllCImplSvmInstr.cpp.h
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/IEMAllCImplSvmInstr.cpp.h	(revision 92492)
+++ /trunk/src/VBox/VMM/VMMAll/IEMAllCImplSvmInstr.cpp.h	(revision 92493)
@@ -93,7 +93,4 @@
      */
     int rc = PGMChangeMode(pVCpu, pVCpu->cpum.GstCtx.cr0 | X86_CR0_PE, pVCpu->cpum.GstCtx.cr4, pVCpu->cpum.GstCtx.msrEFER);
-# ifdef IN_RING3
-    Assert(rc != VINF_PGM_CHANGE_MODE);
-# endif
     AssertRCReturn(rc, rc);
 
Index: /trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h	(revision 92492)
+++ /trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h	(revision 92493)
@@ -1227,7 +1227,4 @@
      */
     int rc = PGMChangeMode(pVCpu, pVCpu->cpum.GstCtx.cr0 | X86_CR0_PE, pVCpu->cpum.GstCtx.cr4, pVCpu->cpum.GstCtx.msrEFER);
-# ifdef IN_RING3
-    Assert(rc != VINF_PGM_CHANGE_MODE);
-# endif
     AssertRCReturn(rc, rc);
 
Index: /trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/PGMAll.cpp	(revision 92492)
+++ /trunk/src/VBox/VMM/VMMAll/PGMAll.cpp	(revision 92493)
@@ -2781,6 +2781,4 @@
  *          VM scheduling.
  * @retval  VINF_SUCCESS if the was no change, or it was successfully dealt with.
- * @retval  VINF_PGM_CHANGE_MODE if we're in RC the mode changes.  This will
- *          NOT be returned in ring-3 or ring-0.
  * @retval  VINF_EM_SUSPEND or VINF_EM_OFF on a fatal runtime error. (R3 only)
  *
Index: /trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/VMMR0.cpp	(revision 92492)
+++ /trunk/src/VBox/VMM/VMMR0/VMMR0.cpp	(revision 92493)
@@ -1298,7 +1298,4 @@
             STAM_COUNTER_INC(&pVM->vmm.s.StatRZRetPATMDuplicateFn);
             break;
-        case VINF_PGM_CHANGE_MODE:
-            STAM_COUNTER_INC(&pVM->vmm.s.StatRZRetPGMChangeMode);
-            break;
         case VINF_PGM_POOL_FLUSH_PENDING:
             STAM_COUNTER_INC(&pVM->vmm.s.StatRZRetPGMFlushPending);
Index: /trunk/src/VBox/VMM/VMMR3/EM.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/EM.cpp	(revision 92492)
+++ /trunk/src/VBox/VMM/VMMR3/EM.cpp	(revision 92493)
@@ -1504,6 +1504,5 @@
     {
         VBOXSTRICTRC rcStrict = IEMExecVmxVmexitExtInt(pVCpu, 0 /* uVector */, true /* fIntPending */);
-        AssertMsg(   rcStrict != VINF_PGM_CHANGE_MODE
-                  && rcStrict != VINF_VMX_VMEXIT
+        AssertMsg(   rcStrict != VINF_VMX_VMEXIT
                   && rcStrict != VINF_NO_CHANGE, ("%Rrc\n", VBOXSTRICTRC_VAL(rcStrict)));
         if (rcStrict != VINF_VMX_INTERCEPT_NOT_ACTIVE)
@@ -1534,6 +1533,5 @@
         if (RT_SUCCESS(rcStrict))
         {
-            AssertMsg(   rcStrict != VINF_PGM_CHANGE_MODE
-                      && rcStrict != VINF_SVM_VMEXIT
+            AssertMsg(   rcStrict != VINF_SVM_VMEXIT
                       && rcStrict != VINF_NO_CHANGE, ("%Rrc\n", VBOXSTRICTRC_VAL(rcStrict)));
             return VBOXSTRICTRC_VAL(rcStrict);
@@ -1566,5 +1564,4 @@
         if (RT_SUCCESS(rcStrict))
         {
-            Assert(rcStrict != VINF_PGM_CHANGE_MODE);
             Assert(rcStrict != VINF_SVM_VMEXIT);
             return VBOXSTRICTRC_VAL(rcStrict);
@@ -1945,5 +1942,4 @@
                     rc2 = VBOXSTRICTRC_VAL(IEMExecVmxVmexit(pVCpu, VMX_EXIT_NMI_WINDOW, 0 /* uExitQual */));
                     AssertMsg(   rc2 != VINF_VMX_INTERCEPT_NOT_ACTIVE
-                              && rc2 != VINF_PGM_CHANGE_MODE
                               && rc2 != VINF_VMX_VMEXIT
                               && rc2 != VINF_NO_CHANGE, ("%Rrc\n", rc2));
@@ -1973,6 +1969,5 @@
                     {
                         rc2 = VBOXSTRICTRC_VAL(IEMExecSvmVmexit(pVCpu, SVM_EXIT_NMI, 0 /* uExitInfo1 */,  0 /* uExitInfo2 */));
-                        AssertMsg(   rc2 != VINF_PGM_CHANGE_MODE
-                                  && rc2 != VINF_SVM_VMEXIT
+                        AssertMsg(   rc2 != VINF_SVM_VMEXIT
                                   && rc2 != VINF_NO_CHANGE, ("%Rrc\n", rc2));
                         UPDATE_RC();
@@ -2010,5 +2005,4 @@
                     rc2 = VBOXSTRICTRC_VAL(IEMExecVmxVmexit(pVCpu, VMX_EXIT_INT_WINDOW, 0 /* uExitQual */));
                     AssertMsg(   rc2 != VINF_VMX_INTERCEPT_NOT_ACTIVE
-                              && rc2 != VINF_PGM_CHANGE_MODE
                               && rc2 != VINF_VMX_VMEXIT
                               && rc2 != VINF_NO_CHANGE, ("%Rrc\n", rc2));
Index: /trunk/src/VBox/VMM/VMMR3/VMM.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/VMM.cpp	(revision 92492)
+++ /trunk/src/VBox/VMM/VMMR3/VMM.cpp	(revision 92493)
@@ -373,5 +373,4 @@
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetInterruptPending,    STAMTYPE_COUNTER, "/VMM/RZRet/InterruptPending",    STAMUNIT_OCCURENCES, "Number of VINF_EM_RAW_INTERRUPT_PENDING returns.");
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetPATMDuplicateFn,     STAMTYPE_COUNTER, "/VMM/RZRet/PATMDuplicateFn",     STAMUNIT_OCCURENCES, "Number of VINF_PATM_DUPLICATE_FUNCTION returns.");
-    STAM_REG(pVM, &pVM->vmm.s.StatRZRetPGMChangeMode,       STAMTYPE_COUNTER, "/VMM/RZRet/PGMChangeMode",       STAMUNIT_OCCURENCES, "Number of VINF_PGM_CHANGE_MODE returns.");
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetPGMFlushPending,     STAMTYPE_COUNTER, "/VMM/RZRet/PGMFlushPending",     STAMUNIT_OCCURENCES, "Number of VINF_PGM_POOL_FLUSH_PENDING returns.");
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetPendingRequest,      STAMTYPE_COUNTER, "/VMM/RZRet/PendingRequest",      STAMUNIT_OCCURENCES, "Number of VINF_EM_PENDING_REQUEST returns.");
Index: /trunk/src/VBox/VMM/include/EMHandleRCTmpl.h
===================================================================
--- /trunk/src/VBox/VMM/include/EMHandleRCTmpl.h	(revision 92492)
+++ /trunk/src/VBox/VMM/include/EMHandleRCTmpl.h	(revision 92493)
@@ -91,15 +91,4 @@
         case VINF_PGM_POOL_FLUSH_PENDING:
             rc = VINF_SUCCESS;
-            break;
-
-        /*
-         * Paging mode change.
-         */
-        case VINF_PGM_CHANGE_MODE:
-            CPUM_ASSERT_NOT_EXTRN(pVCpu, CPUMCTX_EXTRN_CR0 | CPUMCTX_EXTRN_CR3 | CPUMCTX_EXTRN_CR4 | CPUMCTX_EXTRN_EFER);
-            rc = PGMChangeMode(pVCpu, pVCpu->cpum.GstCtx.cr0, pVCpu->cpum.GstCtx.cr4, pVCpu->cpum.GstCtx.msrEFER);
-            if (rc == VINF_SUCCESS)
-                rc = VINF_EM_RESCHEDULE;
-            AssertMsg(RT_FAILURE(rc) || (rc >= VINF_EM_FIRST && rc <= VINF_EM_LAST), ("%Rrc\n", rc));
             break;
 #endif /* !EMHANDLERC_WITH_NEM */
Index: /trunk/src/VBox/VMM/include/VMMInternal.h
===================================================================
--- /trunk/src/VBox/VMM/include/VMMInternal.h	(revision 92492)
+++ /trunk/src/VBox/VMM/include/VMMInternal.h	(revision 92493)
@@ -396,5 +396,4 @@
     STAMCOUNTER                 StatRZRetInterruptPending;
     STAMCOUNTER                 StatRZRetPATMDuplicateFn;
-    STAMCOUNTER                 StatRZRetPGMChangeMode;
     STAMCOUNTER                 StatRZRetPendingRequest;
     STAMCOUNTER                 StatRZRetPGMFlushPending;
