Index: /trunk/src/VBox/VMM/VMMR0/HMR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HMR0.cpp	(revision 45377)
+++ /trunk/src/VBox/VMM/VMMR0/HMR0.cpp	(revision 45378)
@@ -1400,4 +1400,5 @@
     PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);
 
+#ifdef VBOX_WITH_OLD_VTX_CODE
     /* Always load the guest's FPU/XMM state on-demand. */
     CPUMDeactivateGuestFPUState(pVCpu);
@@ -1405,6 +1406,10 @@
     /* Always load the guest's debug state on-demand. */
     CPUMDeactivateGuestDebugState(pVCpu);
-
-    /* Always reload the host context and the guest's CR0 register. (!!!!) */
+#else
+    Assert(!CPUMIsGuestFPUStateActive(pVCpu));
+    Assert(!CPUMIsGuestDebugStateActive(pVCpu));
+#endif
+
+    /* Always reload the host context and the guest's CR0 register (for the FPU bits). */
     pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_CR0 | HM_CHANGED_HOST_CONTEXT;
 
@@ -1471,4 +1476,6 @@
     AssertReturn(!ASMAtomicReadBool(&g_HvmR0.fSuspended), VERR_HM_SUSPEND_PENDING);
 
+    /* The new code does FPU restoration in the VMX R0 code. */
+#ifdef VBOX_WITH_OLD_VTX_CODE
     /*
      * Save the guest FPU and XMM state if necessary.
@@ -1487,4 +1494,5 @@
         Assert(!CPUMIsGuestFPUStateActive(pVCpu));
     }
+#endif
 
     rc = g_HvmR0.pfnLeaveSession(pVM, pVCpu, pCtx);
@@ -1494,6 +1502,13 @@
        time it executes code. */
     if (    pVM->hm.s.fNestedPaging
-        &&  CPUMIsGuestInPagedProtectedModeEx(pCtx))
+#ifdef VBOX_WITH_OLD_VTX_CODE
+        &&  CPUMIsGuestInPagedProtectedModeEx(pCtx)
+#else
+        &&  CPUMIsGuestPagingEnabledEx(pCtx)
+#endif
+       )
+    {
         CPUMSetChangedFlags(pVCpu, CPUM_CHANGED_GLOBAL_TLB_FLUSH);
+    }
 
     /* Keep track of the CPU owning the VMCS for debugging scheduling weirdness
Index: /trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp	(revision 45377)
+++ /trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp	(revision 45378)
@@ -1748,5 +1748,5 @@
  * shortly before a VM entry and execution MUST NOT be rescheduled between a call to
  * this function and a VM entry without calling this function again.
- * 
+ *
  * @returns VBox status code.
  * @param   pVM         Pointer to the VM.
@@ -1827,4 +1827,6 @@
     int         rc = VINF_SUCCESS;
     RTGCUINTPTR val;
+
+    STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatLoadGuestState, x);
 
     /*
@@ -2420,4 +2422,6 @@
     /* Minimal guest state update (ESP, EIP, EFLAGS mostly) */
     VMXR0LoadMinimalGuestState(pVM, pVCpu, pCtx);
+
+    STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatLoadGuestState, x);
     return rc;
 }
Index: /trunk/src/VBox/VMM/VMMR3/HM.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/HM.cpp	(revision 45377)
+++ /trunk/src/VBox/VMM/VMMR3/HM.cpp	(revision 45378)
@@ -487,6 +487,4 @@
                              "/PROF/HM/CPU%d/StatEntry", i);
         AssertRC(rc);
-        /** @todo r=ramshankar: should be sorted out for the new-code which doesn't
-         *        have 2 exit parts. */
         rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit1, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL,
                              "Profiling of VMXR0RunGuestCode exit part 1",
@@ -497,5 +495,6 @@
                              "/PROF/HM/CPU%d/SwitchFromGC_2", i);
         AssertRC(rc);
-# if 1 /* temporary for tracking down darwin holdup. */
+# ifdef VBOX_WITH_OLD_VTX_CODE
+        /* temporary for tracking down darwin holdup. */
         rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit2Sub1, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL,
                              "Temporary - I/O",
@@ -511,6 +510,10 @@
         AssertRC(rc);
 # endif
+        rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatLoadGuestState, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL,
+                             "Profiling of VMXR0LoadGuestState",
+                             "/PROF/HM/CPU%d/StatLoadGuestState", i);
+        AssertRC(rc);
         rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatInGC, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL,
-                             "Profiling of vmlaunch",
+                             "Profiling of vmlaunch/vmresume",
                              "/PROF/HM/CPU%d/InGC", i);
         AssertRC(rc);
Index: /trunk/src/VBox/VMM/include/HMInternal.h
===================================================================
--- /trunk/src/VBox/VMM/include/HMInternal.h	(revision 45377)
+++ /trunk/src/VBox/VMM/include/HMInternal.h	(revision 45378)
@@ -789,9 +789,10 @@
     STAMPROFILEADV          StatExit1;
     STAMPROFILEADV          StatExit2;
-#if 1 /* temporary for tracking down darwin issues. */
+#ifdef VBOX_WITH_OLD_VTX_CODE /* temporary for tracking down darwin issues. */
     STAMPROFILEADV          StatExit2Sub1;
     STAMPROFILEADV          StatExit2Sub2;
     STAMPROFILEADV          StatExit2Sub3;
 #endif
+    STAMPROFILEADV          StatLoadGuestState;
     STAMPROFILEADV          StatInGC;
 
