Index: /trunk/src/VBox/VMM/VMMR0/HMR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HMR0.cpp	(revision 46723)
+++ /trunk/src/VBox/VMM/VMMR0/HMR0.cpp	(revision 46724)
@@ -1378,5 +1378,5 @@
     /* On first entry we'll sync everything. */
     for (VMCPUID i = 0; i < pVM->cCpus; i++)
-        pVM->aCpus[i].hm.s.fContextUseFlags = HM_CHANGED_ALL;
+        pVM->aCpus[i].hm.s.fContextUseFlags = (HM_CHANGED_HOST_CONTEXT | HM_CHANGED_ALL_GUEST);
 
     /* Enable VT-x or AMD-V if local init is required. */
Index: /trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 46723)
+++ /trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 46724)
@@ -6710,5 +6710,6 @@
 
     /* Clear any unused and reserved bits. */
-    pVCpu->hm.s.fContextUseFlags &= ~HM_CHANGED_GUEST_CR2;
+    pVCpu->hm.s.fContextUseFlags &= ~(  HM_CHANGED_GUEST_CR2
+                                      | HM_CHANGED_GUEST_MSR  /* legacy */);
 
     AssertMsg(!pVCpu->hm.s.fContextUseFlags,
Index: /trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp	(revision 46723)
+++ /trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp	(revision 46724)
@@ -2811,5 +2811,5 @@
         /** @todo we can do better than this */
         /* Not in the VINF_PGM_CHANGE_MODE though! */
-        pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_ALL;
+        pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_HOST_CONTEXT | HM_CHANGED_ALL_GUEST;
     }
 
Index: /trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp	(revision 46723)
+++ /trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp	(revision 46724)
@@ -4050,5 +4050,5 @@
                          * whole context to be done with it.
                          */
-                        pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_ALL;
+                        pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_HOST_CONTEXT | HM_CHANGED_ALL_GUEST;
 
                         /* Only resume if successful. */
@@ -5024,5 +5024,5 @@
         /** @todo we can do better than this */
         /* Not in the VINF_PGM_CHANGE_MODE though! */
-        pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_ALL;
+        pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_HOST_CONTEXT | HM_CHANGED_ALL_GUEST;
     }
 
Index: /trunk/src/VBox/VMM/VMMR3/HM.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/HM.cpp	(revision 46723)
+++ /trunk/src/VBox/VMM/VMMR3/HM.cpp	(revision 46724)
@@ -1667,5 +1667,5 @@
 {
     /* On first entry we'll sync everything. */
-    pVCpu->hm.s.fContextUseFlags = HM_CHANGED_ALL;
+    pVCpu->hm.s.fContextUseFlags = (HM_CHANGED_HOST_CONTEXT | HM_CHANGED_ALL_GUEST);
 
     pVCpu->hm.s.vmx.u32CR0Mask = 0;
Index: /trunk/src/VBox/VMM/include/HMInternal.h
===================================================================
--- /trunk/src/VBox/VMM/include/HMInternal.h	(revision 46723)
+++ /trunk/src/VBox/VMM/include/HMInternal.h	(revision 46724)
@@ -81,72 +81,55 @@
  * @{
  */
-#ifdef VBOX_WITH_OLD_VTX_CODE
-# define HM_CHANGED_GUEST_FPU                RT_BIT(0)
-# define HM_CHANGED_GUEST_CR0                RT_BIT(1)
-# define HM_CHANGED_GUEST_CR3                RT_BIT(2)
-# define HM_CHANGED_GUEST_CR4                RT_BIT(3)
-# define HM_CHANGED_GUEST_GDTR               RT_BIT(4)
-# define HM_CHANGED_GUEST_IDTR               RT_BIT(5)
-# define HM_CHANGED_GUEST_LDTR               RT_BIT(6)
-# define HM_CHANGED_GUEST_TR                 RT_BIT(7)
-# define HM_CHANGED_GUEST_MSR                RT_BIT(8)
-# define HM_CHANGED_GUEST_SEGMENT_REGS       RT_BIT(9)
-# define HM_CHANGED_GUEST_DEBUG              RT_BIT(10)
-# define HM_CHANGED_HOST_CONTEXT             RT_BIT(11)
-# define HM_CHANGED_ALL_GUEST               (  HM_CHANGED_GUEST_SEGMENT_REGS \
-                                            | HM_CHANGED_GUEST_CR0          \
-                                            | HM_CHANGED_GUEST_CR3          \
-                                            | HM_CHANGED_GUEST_CR4          \
-                                            | HM_CHANGED_GUEST_GDTR         \
-                                            | HM_CHANGED_GUEST_IDTR         \
-                                            | HM_CHANGED_GUEST_LDTR         \
-                                            | HM_CHANGED_GUEST_TR           \
-                                            | HM_CHANGED_GUEST_MSR          \
-                                            | HM_CHANGED_GUEST_DEBUG        \
-                                            | HM_CHANGED_GUEST_FPU)
-#else
-# define HM_CHANGED_GUEST_RIP                    RT_BIT(0)
-# define HM_CHANGED_GUEST_RSP                    RT_BIT(1)
-# define HM_CHANGED_GUEST_RFLAGS                 RT_BIT(2)
-# define HM_CHANGED_GUEST_CR0                    RT_BIT(3)
-# define HM_CHANGED_GUEST_CR2                    RT_BIT(4)
-# define HM_CHANGED_GUEST_CR3                    RT_BIT(5)
-# define HM_CHANGED_GUEST_CR4                    RT_BIT(6)
-# define HM_CHANGED_GUEST_GDTR                   RT_BIT(7)
-# define HM_CHANGED_GUEST_IDTR                   RT_BIT(8)
-# define HM_CHANGED_GUEST_LDTR                   RT_BIT(9)
-# define HM_CHANGED_GUEST_TR                     RT_BIT(10)
-# define HM_CHANGED_GUEST_SEGMENT_REGS           RT_BIT(11)
-# define HM_CHANGED_GUEST_DEBUG                  RT_BIT(12)
-# define HM_CHANGED_GUEST_SYSENTER_CS_MSR        RT_BIT(13)
-# define HM_CHANGED_GUEST_SYSENTER_EIP_MSR       RT_BIT(14)
-# define HM_CHANGED_GUEST_SYSENTER_ESP_MSR       RT_BIT(15)
+#define HM_CHANGED_GUEST_CR0                     RT_BIT(0)
+#define HM_CHANGED_GUEST_CR3                     RT_BIT(1)
+#define HM_CHANGED_GUEST_CR4                     RT_BIT(2)
+#define HM_CHANGED_GUEST_GDTR                    RT_BIT(3)
+#define HM_CHANGED_GUEST_IDTR                    RT_BIT(4)
+#define HM_CHANGED_GUEST_LDTR                    RT_BIT(5)
+#define HM_CHANGED_GUEST_TR                      RT_BIT(6)
+#define HM_CHANGED_GUEST_MSR                     RT_BIT(7)  /* Unused in new VT-x, AMD-V code. */
+#define HM_CHANGED_GUEST_SEGMENT_REGS            RT_BIT(8)
+#define HM_CHANGED_GUEST_DEBUG                   RT_BIT(9)
+#define HM_CHANGED_ALL_GUEST_BASE                (  HM_CHANGED_GUEST_CR0          \
+                                                  | HM_CHANGED_GUEST_CR3          \
+                                                  | HM_CHANGED_GUEST_CR4          \
+                                                  | HM_CHANGED_GUEST_GDTR         \
+                                                  | HM_CHANGED_GUEST_IDTR         \
+                                                  | HM_CHANGED_GUEST_LDTR         \
+                                                  | HM_CHANGED_GUEST_TR           \
+                                                  | HM_CHANGED_GUEST_MSR          \
+                                                  | HM_CHANGED_GUEST_SEGMENT_REGS \
+                                                  | HM_CHANGED_GUEST_DEBUG)
+#define HM_CHANGED_ALL_GUEST                     HM_CHANGED_ALL_GUEST_BASE
+
+/** New VT-x, AMD-V code uses extra flags for more fine-grained state
+ *  tracking. */
+#if !defined(VBOX_WITH_OLD_VTX_CODE) || !defined(VBOX_WITH_OLD_AMDV_CODE)
+# define HM_CHANGED_GUEST_RIP                    RT_BIT(10)
+# define HM_CHANGED_GUEST_RSP                    RT_BIT(11)
+# define HM_CHANGED_GUEST_RFLAGS                 RT_BIT(12)
+# define HM_CHANGED_GUEST_CR2                    RT_BIT(13)
+# define HM_CHANGED_GUEST_SYSENTER_CS_MSR        RT_BIT(14)
+# define HM_CHANGED_GUEST_SYSENTER_EIP_MSR       RT_BIT(15)
+# define HM_CHANGED_GUEST_SYSENTER_ESP_MSR       RT_BIT(16)
 /* VT-x specific state. */
-# define HM_CHANGED_VMX_GUEST_AUTO_MSRS          RT_BIT(16)
-# define HM_CHANGED_VMX_GUEST_ACTIVITY_STATE     RT_BIT(17)
-# define HM_CHANGED_VMX_GUEST_APIC_STATE         RT_BIT(18)
-# define HM_CHANGED_VMX_ENTRY_CTLS               RT_BIT(19)
-# define HM_CHANGED_VMX_EXIT_CTLS                RT_BIT(20)
+# define HM_CHANGED_VMX_GUEST_AUTO_MSRS          RT_BIT(17)
+# define HM_CHANGED_VMX_GUEST_ACTIVITY_STATE     RT_BIT(18)
+# define HM_CHANGED_VMX_GUEST_APIC_STATE         RT_BIT(19)
+# define HM_CHANGED_VMX_ENTRY_CTLS               RT_BIT(20)
+# define HM_CHANGED_VMX_EXIT_CTLS                RT_BIT(21)
 /* AMD-V specific state. */
-# define HM_CHANGED_SVM_GUEST_APIC_STATE         RT_BIT(16)
 # define HM_CHANGED_SVM_GUEST_EFER_MSR           RT_BIT(17)
-# define HM_CHANGED_SVM_RESERVED2                RT_BIT(18)
-# define HM_CHANGED_SVM_RESERVED3                RT_BIT(19)
-# define HM_CHANGED_SVM_RESERVED4                RT_BIT(20)
-
-# define HM_CHANGED_HOST_CONTEXT                 RT_BIT(21)
-# define HM_CHANGED_ALL_GUEST                   (  HM_CHANGED_GUEST_RIP                \
+# define HM_CHANGED_SVM_GUEST_APIC_STATE         RT_BIT(18)
+# define HM_CHANGED_SVM_RESERVED1                RT_BIT(19)
+# define HM_CHANGED_SVM_RESERVED2                RT_BIT(20)
+# define HM_CHANGED_SVM_RESERVED3                RT_BIT(21)
+
+# undef  HM_CHANGED_ALL_GUEST
+# define HM_CHANGED_ALL_GUEST                   (  HM_CHANGED_ALL_GUEST_BASE           \
+                                                 | HM_CHANGED_GUEST_RIP                \
                                                  | HM_CHANGED_GUEST_RSP                \
                                                  | HM_CHANGED_GUEST_RFLAGS             \
-                                                 | HM_CHANGED_GUEST_CR0                \
                                                  | HM_CHANGED_GUEST_CR2                \
-                                                 | HM_CHANGED_GUEST_CR3                \
-                                                 | HM_CHANGED_GUEST_CR4                \
-                                                 | HM_CHANGED_GUEST_GDTR               \
-                                                 | HM_CHANGED_GUEST_IDTR               \
-                                                 | HM_CHANGED_GUEST_LDTR               \
-                                                 | HM_CHANGED_GUEST_TR                 \
-                                                 | HM_CHANGED_GUEST_SEGMENT_REGS       \
-                                                 | HM_CHANGED_GUEST_DEBUG              \
                                                  | HM_CHANGED_GUEST_SYSENTER_CS_MSR    \
                                                  | HM_CHANGED_GUEST_SYSENTER_EIP_MSR   \
@@ -159,5 +142,5 @@
 #endif
 
-#define HM_CHANGED_ALL                          (HM_CHANGED_ALL_GUEST | HM_CHANGED_HOST_CONTEXT)
+#define HM_CHANGED_HOST_CONTEXT                 RT_BIT(22)
 /** @} */
 
