Index: trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp	(revision 62534)
+++ trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp	(revision 62601)
@@ -272,5 +272,5 @@
 static void hmR0SvmSetMsrPermission(PVMCPU pVCpu, unsigned uMsr, SVMMSREXITREAD enmRead, SVMMSREXITWRITE enmWrite);
 static void hmR0SvmPendingEventToTrpmTrap(PVMCPU pVCpu);
-static void hmR0SvmLeave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
+static void hmR0SvmLeave(PVMCPU pVCpu);
 
 /** @name \#VMEXIT handlers.
@@ -1759,7 +1759,4 @@
             VMCPU_ASSERT_EMT(pVCpu);
 
-            PVM         pVM  = pVCpu->CTX_SUFF(pVM);
-            PCPUMCTX    pCtx = CPUMQueryGuestCtxPtr(pVCpu);
-
             /* No longjmps (log-flush, locks) in this fragile context. */
             VMMRZCallRing3Disable(pVCpu);
@@ -1767,5 +1764,5 @@
             if (!pVCpu->hm.s.fLeaveDone)
             {
-                hmR0SvmLeave(pVM, pVCpu, pCtx);
+                hmR0SvmLeave(pVCpu);
                 pVCpu->hm.s.fLeaveDone = true;
             }
@@ -2080,11 +2077,9 @@
  * (longjmp, preemption, voluntary exits to ring-3) from AMD-V.
  *
- * @param   pVM         The cross context VM structure.
  * @param   pVCpu       The cross context virtual CPU structure.
- * @param   pCtx        Pointer to the guest-CPU context.
  *
  * @remarks No-long-jmp zone!!!
  */
-static void hmR0SvmLeave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
+static void hmR0SvmLeave(PVMCPU pVCpu)
 {
     Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
@@ -2132,9 +2127,7 @@
  *
  * @returns VBox status code.
- * @param   pVM         The cross context VM structure.
  * @param   pVCpu       The cross context virtual CPU structure.
- * @param   pCtx        Pointer to the guest-CPU context.
- */
-static int hmR0SvmLeaveSession(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
+ */
+static int hmR0SvmLeaveSession(PVMCPU pVCpu)
 {
     HM_DISABLE_PREEMPT();
@@ -2146,5 +2139,5 @@
     if (!pVCpu->hm.s.fLeaveDone)
     {
-        hmR0SvmLeave(pVM, pVCpu, pCtx);
+        hmR0SvmLeave(pVCpu);
         pVCpu->hm.s.fLeaveDone = true;
     }
@@ -2171,13 +2164,11 @@
  *
  * @returns VBox status code.
- * @param   pVM         The cross context VM structure.
  * @param   pVCpu       The cross context virtual CPU structure.
- * @param   pCtx        Pointer to the guest-CPU context.
  *
  * @remarks No-long-jmp zone!!!
  */
-static int hmR0SvmLongJmpToRing3(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
-{
-    return hmR0SvmLeaveSession(pVM, pVCpu, pCtx);
+static int hmR0SvmLongJmpToRing3(PVMCPU pVCpu)
+{
+    return hmR0SvmLeaveSession(pVCpu);
 }
 
@@ -2232,5 +2223,5 @@
 
     Log4(("hmR0SvmCallRing3Callback->hmR0SvmLongJmpToRing3\n"));
-    int rc = hmR0SvmLongJmpToRing3(pVCpu->CTX_SUFF(pVM), pVCpu, (PCPUMCTX)pvUser);
+    int rc = hmR0SvmLongJmpToRing3(pVCpu);
     AssertRCReturn(rc, rc);
 
@@ -2277,5 +2268,5 @@
 
     /* Sync. the necessary state for going back to ring-3. */
-    hmR0SvmLeaveSession(pVM, pVCpu, pCtx);
+    hmR0SvmLeaveSession(pVCpu);
     STAM_COUNTER_DEC(&pVCpu->hm.s.StatSwitchLongJmpToR3);
 
Index: trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 62534)
+++ trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 62601)
@@ -7096,5 +7096,4 @@
  *
  * @returns VBox status code.
- * @param   pVM                 The cross context VM structure.
  * @param   pVCpu               The cross context virtual CPU structure.
  * @param   pMixedCtx           Pointer to the guest-CPU context. The data may
@@ -7105,5 +7104,5 @@
  * @remarks No-long-jmp zone!!!
  */
-static int hmR0VmxLeave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx, bool fSaveGuestState)
+static int hmR0VmxLeave(PVMCPU pVCpu, PCPUMCTX pMixedCtx, bool fSaveGuestState)
 {
     Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
@@ -7212,5 +7211,4 @@
  *
  * @returns VBox status code.
- * @param   pVM         The cross context VM structure.
  * @param   pVCpu       The cross context virtual CPU structure.
  * @param   pMixedCtx   Pointer to the guest-CPU context. The data may be
@@ -7220,5 +7218,5 @@
  * @remarks No-long-jmp zone!!!
  */
-DECLINLINE(int) hmR0VmxLeaveSession(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx)
+DECLINLINE(int) hmR0VmxLeaveSession(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
 {
     HM_DISABLE_PREEMPT();
@@ -7231,5 +7229,5 @@
     if (!pVCpu->hm.s.fLeaveDone)
     {
-        int rc2 = hmR0VmxLeave(pVM, pVCpu, pMixedCtx, true /* fSaveGuestState */);
+        int rc2 = hmR0VmxLeave(pVCpu, pMixedCtx, true /* fSaveGuestState */);
         AssertRCReturnStmt(rc2, HM_RESTORE_PREEMPT(), rc2);
         pVCpu->hm.s.fLeaveDone = true;
@@ -7260,5 +7258,4 @@
  *
  * @returns VBox status code.
- * @param   pVM         The cross context VM structure.
  * @param   pVCpu       The cross context virtual CPU structure.
  * @param   pMixedCtx   Pointer to the guest-CPU context. The data may be
@@ -7268,7 +7265,7 @@
  * @remarks No-long-jmp zone!!!
  */
-DECLINLINE(int) hmR0VmxLongJmpToRing3(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx)
-{
-    return hmR0VmxLeaveSession(pVM, pVCpu, pMixedCtx);
+DECLINLINE(int) hmR0VmxLongJmpToRing3(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
+{
+    return hmR0VmxLeaveSession(pVCpu, pMixedCtx);
 }
 
@@ -7328,5 +7325,5 @@
 
     /* Save guest state and restore host state bits. */
-    int rc = hmR0VmxLeaveSession(pVM, pVCpu, pMixedCtx);
+    int rc = hmR0VmxLeaveSession(pVCpu, pMixedCtx);
     AssertRCReturn(rc, rc);
     STAM_COUNTER_DEC(&pVCpu->hm.s.StatSwitchLongJmpToR3);
@@ -7430,5 +7427,5 @@
           enmOperation));
 
-    int rc = hmR0VmxLongJmpToRing3(pVCpu->CTX_SUFF(pVM), pVCpu, (PCPUMCTX)pvUser);
+    int rc = hmR0VmxLongJmpToRing3(pVCpu, (PCPUMCTX)pvUser);
     AssertRCReturn(rc, rc);
 
@@ -8210,5 +8207,4 @@
             VMCPU_ASSERT_EMT(pVCpu);
 
-            PVM      pVM       = pVCpu->CTX_SUFF(pVM);
             PCPUMCTX pMixedCtx = CPUMQueryGuestCtxPtr(pVCpu);
 
@@ -8224,5 +8220,5 @@
                 /* Do -not- save guest-state here as we might already be in the middle of saving it (esp. bad if we are
                    holding the PGM lock while saving the guest state (see hmR0VmxSaveGuestControlRegs()). */
-                hmR0VmxLeave(pVM, pVCpu, pMixedCtx, false /* fSaveGuestState */);
+                hmR0VmxLeave(pVCpu, pMixedCtx, false /* fSaveGuestState */);
                 pVCpu->hm.s.fLeaveDone = true;
             }
@@ -13028,4 +13024,5 @@
 static int hmR0VmxExitXcptAC(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
 {
+    RT_NOREF_PV(pMixedCtx);
     HMVMX_VALIDATE_EXIT_XCPT_HANDLER_PARAMS();
 
@@ -13485,4 +13482,5 @@
 static int hmR0VmxExitXcptGeneric(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
 {
+    RT_NOREF_PV(pMixedCtx);
     HMVMX_VALIDATE_EXIT_XCPT_HANDLER_PARAMS();
 #ifndef HMVMX_ALWAYS_TRAP_ALL_XCPTS
