Index: trunk/src/VBox/VMM/VMMR0/HMR0A.asm
===================================================================
--- trunk/src/VBox/VMM/VMMR0/HMR0A.asm	(revision 45473)
+++ trunk/src/VBox/VMM/VMMR0/HMR0A.asm	(revision 45474)
@@ -567,5 +567,5 @@
 .good:
     jnz     .the_end
-    mov     eax, VERR_VMX_GENERIC
+    mov     eax, VERR_VMX_VMXON_FAILED
 
 .the_end:
Index: trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 45473)
+++ trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 45474)
@@ -387,5 +387,6 @@
  * @param    pVM        Pointer to the VM.
  * @param    pVCpu      Pointer to the VMCPU (can be NULL if @a rc is not
- *                      VERR_VMX_GENERIC).
+ *                      VERR_VMX_UNABLE_TO_START_VM or
+ *                      VERR_VMX_INVALID_VMCS_FIELD).
  * @param    rc         The error code.
  */
@@ -393,5 +394,6 @@
 {
     AssertPtr(pVM);
-    if (rc == VERR_VMX_GENERIC)
+    if (   rc == VERR_VMX_INVALID_VMCS_FIELD
+        || rc == VERR_VMX_UNABLE_TO_START_VM)
     {
         AssertPtrReturnVoid(pVCpu);
@@ -603,4 +605,6 @@
     /* Enter VMXON root mode. */
     int rc = VMXEnable(HCPhysCpuPage);
+    if (RT_FAILURE(rc))
+        ASMSetCR4(uCr4);
 
     /* Restore interrupts. */
@@ -1533,5 +1537,8 @@
     /* Enable the VMX preemption timer. */
     if (pVM->hm.s.vmx.fUsePreemptTimer)
+    {
+        Assert(pVM->hm.s.vmx.msr.vmx_pin_ctls.n.allowed1 & VMX_VMCS_CTRL_PIN_EXEC_CONTROLS_PREEMPT_TIMER);
         val |= VMX_VMCS_CTRL_PIN_EXEC_CONTROLS_PREEMPT_TIMER;
+    }
 
     if ((val & zap) != val)
@@ -1657,5 +1664,5 @@
      * Secondary processor-based VM-execution controls.
      */
-    if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL)
+    if (RT_LIKELY(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL))
     {
         val = pVM->hm.s.vmx.msr.vmx_proc_ctls2.n.disallowed0;           /* Bits set here must be set in the VMCS. */
@@ -3741,7 +3748,6 @@
             AssertFailed();
             break;
-        case VINF_SUCCESS:      /* VMLAUNCH/VMRESUME succeeded but VM-entry failed... yeah, true story. */
-        case VERR_VMX_UNABLE_TO_START_VM:
-        case VERR_VMX_UNABLE_TO_RESUME_VM:
+        case VINF_SUCCESS:                  /* VMLAUNCH/VMRESUME succeeded but VM-entry failed... yeah, true story. */
+        case VERR_VMX_UNABLE_TO_START_VM:   /* VMLAUNCH/VMRESUME itself failed. */
         {
             int rc = VMXReadVmcs32(VMX_VMCS32_RO_EXIT_REASON, &pVCpu->hm.s.vmx.lasterror.u32ExitReason);
@@ -4099,5 +4105,5 @@
         ASMSetCR4(ASMGetCR4() & ~X86_CR4_VMXE);
         ASMSetFlags(uOldEFlags);
-        return VERR_VMX_VMXON_FAILED;
+        return rc2;
     }
 
@@ -6924,5 +6930,5 @@
 
 /**
- * VM-exit handler for WBINVD (VMX_EXIT_INVD). Unconditional VM-exit.
+ * VM-exit handler for INVD (VMX_EXIT_INVD). Unconditional VM-exit.
  */
 static DECLCALLBACK(int) hmR0VmxExitInvd(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
Index: trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp	(revision 45473)
+++ trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp	(revision 45474)
@@ -179,5 +179,6 @@
 static void hmR0VmxCheckError(PVM pVM, PVMCPU pVCpu, int rc)
 {
-    if (rc == VERR_VMX_GENERIC)
+    if (   rc == VERR_VMX_UNABLE_TO_START_VM
+        || rc == VERR_VMX_INVALID_VMCS_FIELD)
     {
         RTCCUINTREG instrError;
@@ -535,5 +536,5 @@
                  */
                 pVM->hm.s.vmx.enmFlushEpt = VMX_FLUSH_EPT_NOT_SUPPORTED;
-                return VERR_VMX_GENERIC;
+                return VERR_HM_UNSUPPORTED_CPU_FEATURE_COMBO;
             }
         }
@@ -544,5 +545,5 @@
              */
             pVM->hm.s.vmx.enmFlushEpt = VMX_FLUSH_EPT_NOT_SUPPORTED;
-            return VERR_VMX_GENERIC;
+            return VERR_HM_UNSUPPORTED_CPU_FEATURE_COMBO;
         }
     }
@@ -5285,5 +5286,4 @@
 
         case VERR_VMX_UNABLE_TO_START_VM:
-        case VERR_VMX_UNABLE_TO_RESUME_VM:
         {
             int         rc2;
Index: trunk/src/VBox/VMM/VMMR3/HM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/HM.cpp	(revision 45473)
+++ trunk/src/VBox/VMM/VMMR3/HM.cpp	(revision 45474)
@@ -2634,10 +2634,4 @@
                 break;
 
-            case VERR_VMX_UNABLE_TO_RESUME_VM:
-                LogRel(("HM: VERR_VMX_UNABLE_TO_RESUME_VM:\n"));
-                LogRel(("HM: CPU%d instruction error %x\n", i, pVM->aCpus[i].hm.s.vmx.lasterror.u32InstrError));
-                LogRel(("HM: CPU%d exit reason       %x\n", i, pVM->aCpus[i].hm.s.vmx.lasterror.u32ExitReason));
-                break;
-
             case VERR_VMX_INVALID_VMXON_PTR:
                 break;
Index: trunk/src/VBox/VMM/VMMRC/HMRCA.asm
===================================================================
--- trunk/src/VBox/VMM/VMMRC/HMRCA.asm	(revision 45473)
+++ trunk/src/VBox/VMM/VMMRC/HMRCA.asm	(revision 45474)
@@ -113,5 +113,5 @@
 .vmxon_success:
     jnz     .vmxon_success2
-    mov     rax, VERR_VMX_GENERIC
+    mov     rax, VERR_VMX_VMXON_FAILED
     jmp     .vmstart64_vmxon_failed
 
@@ -125,5 +125,5 @@
 .vmptrld_success:
     jnz     .vmptrld_success2
-    mov     rax, VERR_VMX_GENERIC
+    mov     rax, VERR_VMX_VMPTRLD_FAILED
     jmp     .vmstart64_vmxoff_end
 
Index: trunk/src/VBox/VMM/include/EMHandleRCTmpl.h
===================================================================
--- trunk/src/VBox/VMM/include/EMHandleRCTmpl.h	(revision 45473)
+++ trunk/src/VBox/VMM/include/EMHandleRCTmpl.h	(revision 45474)
@@ -346,5 +346,4 @@
         case VERR_VMX_INVALID_GUEST_STATE:
         case VERR_VMX_UNABLE_TO_START_VM:
-        case VERR_VMX_UNABLE_TO_RESUME_VM:
             HMR3CheckError(pVM, rc);
             break;
