Index: /trunk/include/VBox/vmm/hm_vmx.h
===================================================================
--- /trunk/include/VBox/vmm/hm_vmx.h	(revision 45683)
+++ /trunk/include/VBox/vmm/hm_vmx.h	(revision 45684)
@@ -54,10 +54,9 @@
 # define VMX_VMCS_GUEST_RSP_CACHE_IDX                                         11
 # define VMX_VMCS_GUEST_RIP_CACHE_IDX                                         12
-# define VMX_VMCS_GUEST_RFLAGS_CACHE_IDX                                      13
-# define VMX_VMCS_GUEST_SYSENTER_ESP_CACHE_IDX                                14
-# define VMX_VMCS_GUEST_SYSENTER_EIP_CACHE_IDX                                15
-# define VMX_VMCS_RO_EXIT_QUALIFICATION_CACHE_IDX                             16
+# define VMX_VMCS_GUEST_SYSENTER_ESP_CACHE_IDX                                13
+# define VMX_VMCS_GUEST_SYSENTER_EIP_CACHE_IDX                                14
+# define VMX_VMCS_RO_EXIT_QUALIFICATION_CACHE_IDX                             15
 # define VMX_VMCS_MAX_CACHE_IDX                                               (VMX_VMCS_RO_EXIT_QUALIFICATION_CACHE_IDX + 1)
-# define VMX_VMCS_GUEST_CR3_CACHE_IDX                                         17
+# define VMX_VMCS_GUEST_CR3_CACHE_IDX                                         16
 # define VMX_VMCS_MAX_NESTED_PAGING_CACHE_IDX                                 (VMX_VMCS_GUEST_CR3_CACHE_IDX + 1)
 #else /* VBOX_WITH_OLD_VTX_CODE */
Index: /trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 45683)
+++ /trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 45684)
@@ -3968,5 +3968,4 @@
 # error "VMX_USE_CACHED_VMCS_ACCESSES not defined when it should be!"
 #endif
-
 #ifdef VBOX_STRICT
 static bool hmR0VmxIsValidWriteField(uint32_t idxField)
@@ -4287,6 +4286,4 @@
         case VMX_VMCS64_CTRL_EPTP_FULL:
         case VMX_VMCS64_CTRL_EPTP_LIST_FULL:
-        /* 64-bit Read-only data fields. */
-        case VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL:
         /* 64-bit Guest-state fields. */
         case VMX_VMCS64_GUEST_VMCS_LINK_PTR_FULL:
@@ -4347,5 +4344,5 @@
         default:
         {
-            AssertMsgFailed(("VMXWriteVmcs64Ex: invalid field %#x (pVCpu=%p u64Val=%RX64)\n", (unsigned)idxField, pVCpu, u64Val));
+            AssertMsgFailed(("VMXWriteVmcs64Ex: Invalid field %#RX32 (pVCpu=%p u64Val=%#RX64)\n", idxField, pVCpu, u64Val));
             rc = VERR_INVALID_PARAMETER;
             break;
@@ -4389,6 +4386,7 @@
 }
 
-
-/**
+/* Enable later when the assembly code uses these as callbacks. */
+#if 0
+/*
  * Loads the VMCS write-cache into the CPU (by executing VMWRITEs).
  *
@@ -4427,4 +4425,5 @@
     }
 }
+#endif
 #endif /* HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL) */
 
@@ -4949,8 +4948,8 @@
 static int hmR0VmxSaveGuestFSBaseMsr(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
 {
-    RTGCUINTREG uVal = 0;
     int rc = VINF_SUCCESS;
     if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_FS_BASE_MSR))
     {
+        RTGCUINTREG uVal = 0;
         rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_FS_BASE, &uVal);   AssertRCReturn(rc, rc);
         pMixedCtx->fs.u64Base = uVal;
@@ -4975,8 +4974,8 @@
 static int hmR0VmxSaveGuestGSBaseMsr(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
 {
-    RTGCUINTREG uVal = 0;
     int rc = VINF_SUCCESS;
     if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_GS_BASE_MSR))
     {
+        RTGCUINTREG uVal = 0;
         rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_GS_BASE, &uVal);   AssertRCReturn(rc, rc);
         pMixedCtx->gs.u64Base = uVal;
@@ -5045,10 +5044,6 @@
 static int hmR0VmxSaveGuestControlRegs(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
 {
-    RTGCUINTREG uVal    = 0;
-    RTGCUINTREG uShadow = 0;
-    int rc              = VINF_SUCCESS;
-
     /* Guest CR0. Guest FPU. */
-    rc = hmR0VmxSaveGuestCR0(pVCpu, pMixedCtx);
+    int rc = hmR0VmxSaveGuestCR0(pVCpu, pMixedCtx);
 
     /* Guest CR4. */
@@ -5063,4 +5058,5 @@
             && CPUMIsGuestPagingEnabledEx(pMixedCtx))
         {
+            RTGCUINTREG uVal = 0;
             rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_CR3, &uVal);
             if (pMixedCtx->cr3 != uVal)
Index: /trunk/src/VBox/VMM/include/HMInternal.h
===================================================================
--- /trunk/src/VBox/VMM/include/HMInternal.h	(revision 45683)
+++ /trunk/src/VBox/VMM/include/HMInternal.h	(revision 45684)
@@ -40,5 +40,5 @@
 #ifdef VBOX_WITH_OLD_VTX_CODE
 # define VMX_USE_CACHED_VMCS_ACCESSES
-#elif HC_ARCH_BITS == 32 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#elif HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
 # define VMX_USE_CACHED_VMCS_ACCESSES
 #endif
