Index: trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 72850)
+++ trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 72851)
@@ -160,9 +160,8 @@
                                                               (a_pVCpu)->cpum.GstCtx.fExtrn, (a_fExtrnMbz)))
 
-
 /** Helper macro for VM-exit handlers called unexpectedly. */
-#define HMVMX_RETURN_UNEXPECTED_EXIT() \
+#define HMVMX_UNEXPECTED_EXIT_RET(a_pVCpu, a_pVmxTransient) \
     do { \
-        pVCpu->hm.s.u32HMError = pVmxTransient->uExitReason; \
+        (a_pVCpu)->hm.s.u32HMError = (a_pVmxTransient)->uExitReason; \
         return VERR_VMX_UNEXPECTED_EXIT; \
     } while (0)
@@ -11158,5 +11157,5 @@
     {
         AssertMsgFailed(("Unexpected NMI-window exit.\n"));
-        HMVMX_RETURN_UNEXPECTED_EXIT();
+        HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
     }
 
@@ -11280,5 +11279,5 @@
 
     AssertMsgFailed(("hmR0VmxExitGetsec: unexpected VM-exit when CR4.SMXE is 0.\n"));
-    HMVMX_RETURN_UNEXPECTED_EXIT();
+    HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
 }
 
@@ -11517,5 +11516,5 @@
     HMVMX_VALIDATE_EXIT_HANDLER_PARAMS();
     AssertMsgFailed(("Unexpected RSM VM-exit. pVCpu=%p pMixedCtx=%p\n", pVCpu, pMixedCtx));
-    HMVMX_RETURN_UNEXPECTED_EXIT();
+    HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
 }
 
@@ -11537,5 +11536,5 @@
     HMVMX_VALIDATE_EXIT_HANDLER_PARAMS();
     AssertMsgFailed(("Unexpected SMI VM-exit. pVCpu=%p pMixedCtx=%p\n", pVCpu, pMixedCtx));
-    HMVMX_RETURN_UNEXPECTED_EXIT();
+    HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
 }
 
@@ -11549,5 +11548,5 @@
     HMVMX_VALIDATE_EXIT_HANDLER_PARAMS();
     AssertMsgFailed(("Unexpected IO SMI VM-exit. pVCpu=%p pMixedCtx=%p\n", pVCpu, pMixedCtx));
-    HMVMX_RETURN_UNEXPECTED_EXIT();
+    HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
 }
 
@@ -11565,5 +11564,5 @@
     HMVMX_VALIDATE_EXIT_HANDLER_PARAMS();
     AssertMsgFailed(("Unexpected SIPI VM-exit. pVCpu=%p pMixedCtx=%p\n", pVCpu, pMixedCtx));
-    HMVMX_RETURN_UNEXPECTED_EXIT();
+    HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
 }
 
@@ -11745,5 +11744,5 @@
     NOREF(pVmxTransient);
     AssertMsgFailed(("Unexpected MSR-load exit. pVCpu=%p pMixedCtx=%p\n", pVCpu, pMixedCtx)); NOREF(pMixedCtx);
-    HMVMX_RETURN_UNEXPECTED_EXIT();
+    HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
 }
 
@@ -11757,5 +11756,5 @@
     NOREF(pVmxTransient);
     AssertMsgFailed(("Unexpected machine-check event exit. pVCpu=%p pMixedCtx=%p\n", pVCpu, pMixedCtx)); NOREF(pMixedCtx);
-    HMVMX_RETURN_UNEXPECTED_EXIT();
+    HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
 }
 
@@ -11787,5 +11786,5 @@
         return VERR_EM_INTERPRETER;
     AssertMsgFailed(("Unexpected XDTR access. pVCpu=%p pMixedCtx=%p\n", pVCpu, pMixedCtx));
-    HMVMX_RETURN_UNEXPECTED_EXIT();
+    HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
 }
 
@@ -11802,5 +11801,5 @@
         return VERR_EM_INTERPRETER;
     AssertMsgFailed(("Unexpected RDRAND exit. pVCpu=%p pMixedCtx=%p\n", pVCpu, pMixedCtx));
-    HMVMX_RETURN_UNEXPECTED_EXIT();
+    HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
 }
 
@@ -11832,5 +11831,5 @@
             AssertMsgFailed(("Unexpected RDMSR for an MSR in the auto-load/store area in the VMCS. ecx=%#RX32\n",
                              pMixedCtx->ecx));
-            HMVMX_RETURN_UNEXPECTED_EXIT();
+            HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
         }
         if (hmR0VmxIsLazyGuestMsr(pVCpu, pMixedCtx->ecx))
@@ -11843,5 +11842,5 @@
             {
                 AssertMsgFailed(("Unexpected RDMSR for a passthru lazy-restore MSR. ecx=%#RX32\n", pMixedCtx->ecx));
-                HMVMX_RETURN_UNEXPECTED_EXIT();
+                HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
             }
         }
@@ -11951,5 +11950,5 @@
                 {
                     AssertMsgFailed(("Unexpected WRMSR for an MSR in the VMCS. ecx=%#RX32\n", pMixedCtx->ecx));
-                    HMVMX_RETURN_UNEXPECTED_EXIT();
+                    HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
                 }
 
@@ -11964,5 +11963,5 @@
                             AssertMsgFailed(("Unexpected WRMSR for an MSR in the auto-load/store area in the VMCS. ecx=%#RX32\n",
                                              pMixedCtx->ecx));
-                            HMVMX_RETURN_UNEXPECTED_EXIT();
+                            HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
                         }
                     }
@@ -11977,5 +11976,5 @@
                         {
                             AssertMsgFailed(("Unexpected WRMSR for passthru, lazy-restore MSR. ecx=%#RX32\n", pMixedCtx->ecx));
-                            HMVMX_RETURN_UNEXPECTED_EXIT();
+                            HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
                         }
                     }
@@ -12577,5 +12576,5 @@
     {
         AssertMsgFailed(("Unexpected MOV DRx exit. pVCpu=%p pMixedCtx=%p\n", pVCpu, pMixedCtx));
-        HMVMX_RETURN_UNEXPECTED_EXIT();
+        HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
     }
 
