Index: /trunk/src/VBox/VMM/VMMAll/IEMAllCImplSvmInstr.cpp.h
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/IEMAllCImplSvmInstr.cpp.h	(revision 68783)
+++ /trunk/src/VBox/VMM/VMMAll/IEMAllCImplSvmInstr.cpp.h	(revision 68784)
@@ -105,5 +105,5 @@
          * Disable the global interrupt flag to prevent interrupts during the 'atomic' world switch.
          */
-        pCtx->hwvirt.svm.fGif = 0;
+        pCtx->hwvirt.svm.fGif = false;
 
         Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pCtx->es));
@@ -219,4 +219,13 @@
         Assert(!CPUMIsGuestInSvmNestedHwVirtMode(pCtx));
 
+        /*
+         * Restore the subset of force-flags that were preserved.
+         */
+        if (pCtx->hwvirt.fLocalForcedActions)
+        {
+            VMCPU_FF_SET(pVCpu, pCtx->hwvirt.fLocalForcedActions);
+            pCtx->hwvirt.fLocalForcedActions = 0;
+        }
+
         if (RT_SUCCESS(rcStrict))
         {
@@ -490,4 +499,5 @@
          */
         pCtx->hwvirt.fLocalForcedActions = pVCpu->fLocalForcedActions & VMCPU_FF_BLOCK_NMIS;
+        VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS);
 
         /*
@@ -566,5 +576,5 @@
          * Clear global interrupt flags to allow interrupts in the guest.
          */
-        pCtx->hwvirt.svm.fGif = 1;
+        pCtx->hwvirt.svm.fGif = true;
 
         /*
@@ -1016,5 +1026,6 @@
     IEM_SVM_INSTR_COMMON_CHECKS(pVCpu, vmrun);
 
-    RTGCPHYS const GCPhysVmcb = pVCpu->iem.s.enmEffAddrMode == IEMMODE_64BIT ? pCtx->rax : pCtx->eax;
+    /** @todo Check effective address size using address size prefix. */
+    RTGCPHYS const GCPhysVmcb = pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT ? pCtx->rax : pCtx->eax;
     if (   (GCPhysVmcb & X86_PAGE_4K_OFFSET_MASK)
         || !PGMPhysIsGCPhysNormal(pVCpu->CTX_SUFF(pVM), GCPhysVmcb))
@@ -1079,5 +1090,6 @@
     IEM_SVM_INSTR_COMMON_CHECKS(pVCpu, vmload);
 
-    RTGCPHYS const GCPhysVmcb = pVCpu->iem.s.enmEffAddrMode == IEMMODE_64BIT ? pCtx->rax : pCtx->eax;
+    /** @todo Check effective address size using address size prefix. */
+    RTGCPHYS const GCPhysVmcb = pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT ? pCtx->rax : pCtx->eax;
     if (   (GCPhysVmcb & X86_PAGE_4K_OFFSET_MASK)
         || !PGMPhysIsGCPhysNormal(pVCpu->CTX_SUFF(pVM), GCPhysVmcb))
@@ -1134,5 +1146,6 @@
     IEM_SVM_INSTR_COMMON_CHECKS(pVCpu, vmsave);
 
-    RTGCPHYS const GCPhysVmcb = pVCpu->iem.s.enmEffAddrMode == IEMMODE_64BIT ? pCtx->rax : pCtx->eax;
+    /** @todo Check effective address size using address size prefix. */
+    RTGCPHYS const GCPhysVmcb = pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT ? pCtx->rax : pCtx->eax;
     if (   (GCPhysVmcb & X86_PAGE_4K_OFFSET_MASK)
         || !PGMPhysIsGCPhysNormal(pVCpu->CTX_SUFF(pVM), GCPhysVmcb))
@@ -1197,5 +1210,5 @@
     }
 
-    pCtx->hwvirt.svm.fGif = 0;
+    pCtx->hwvirt.svm.fGif = false;
     iemRegAddToRipAndClearRF(pVCpu, cbInstr);
 
@@ -1227,5 +1240,5 @@
     }
 
-    pCtx->hwvirt.svm.fGif = 1;
+    pCtx->hwvirt.svm.fGif = true;
     iemRegAddToRipAndClearRF(pVCpu, cbInstr);
 
@@ -1245,5 +1258,6 @@
 {
     PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
-    RTGCPTR  const GCPtrPage = pVCpu->iem.s.enmEffAddrMode == IEMMODE_64BIT ? pCtx->rax : pCtx->eax;
+    /** @todo Check effective address size using address size prefix. */
+    RTGCPTR  const GCPtrPage = pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT ? pCtx->rax : pCtx->eax;
     /** @todo PGM needs virtual ASID support. */
 #if 0
