Index: /trunk/include/VBox/vmm/cpum.mac
===================================================================
--- /trunk/include/VBox/vmm/cpum.mac	(revision 74797)
+++ /trunk/include/VBox/vmm/cpum.mac	(revision 74798)
@@ -281,6 +281,7 @@
     .hwvirt.svm.HCPhysVmcb             RTHCPHYS_RES  1
     .hwvirt.enmHwvirt                  resd          1
+    .hwvirt.fGif                       resb          1
+    alignb 8
     .hwvirt.fLocalForcedActions        resd          1
-    .hwvirt.fGif                       resb          1
     alignb 64
 endstruc
Index: /trunk/include/VBox/vmm/cpumctx.h
===================================================================
--- /trunk/include/VBox/vmm/cpumctx.h	(revision 74797)
+++ /trunk/include/VBox/vmm/cpumctx.h	(revision 74798)
@@ -666,11 +666,11 @@
         /** 0x3f0 - Hardware virtualization type currently in use. */
         CPUMHWVIRT              enmHwvirt;
-        /** 0x3f4 - A subset of guest force flags that are saved while running the
+        /** 0x3f4 - Global interrupt flag - AMD only (always true on Intel). */
+        bool                    fGif;
+        bool                    afPadding1[3];
+        /** 0x3f8 - A subset of guest force flags that are saved while running the
          *  nested-guest. */
         uint32_t                fLocalForcedActions;
-        /** 0x3f8 - Global interrupt flag - AMD only (always true on Intel). */
-        bool                    fGif;
-        /** 0x3fc - Padding. */
-        uint8_t                 abPadding1[7];
+        uint8_t                 abPadding[4];
     } hwvirt;
     /** @} */
@@ -775,6 +775,6 @@
 AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) vmx.pvIoBitmapR0,      8);
 AssertCompileMemberOffset(CPUMCTX, hwvirt.enmHwvirt,           0x3f0);
-AssertCompileMemberOffset(CPUMCTX, hwvirt.fLocalForcedActions, 0x3f4);
-AssertCompileMemberOffset(CPUMCTX, hwvirt.fGif,                0x3f8);
+AssertCompileMemberOffset(CPUMCTX, hwvirt.fGif,                0x3f4);
+AssertCompileMemberOffset(CPUMCTX, hwvirt.fLocalForcedActions, 0x3f8);
 AssertCompileMembersAtSameOffset(CPUMCTX, CPUM_UNION_STRUCT_NM(g,qw.) rax, CPUMCTX, CPUM_UNION_NM(g.) aGRegs);
 AssertCompileMembersAtSameOffset(CPUMCTX, CPUM_UNION_STRUCT_NM(g,qw.) rax, CPUMCTX, CPUM_UNION_STRUCT_NM(g,qw2.)  r0);
Index: /trunk/include/VBox/vmm/vm.h
===================================================================
--- /trunk/include/VBox/vmm/vm.h	(revision 74797)
+++ /trunk/include/VBox/vmm/vm.h	(revision 74798)
@@ -103,6 +103,10 @@
     /** Per CPU forced action.
      * See the VMCPU_FF_* \#defines. Updated atomically. */
+#ifdef VMCPU_WITH_64_BIT_FFS
+    uint64_t volatile       fLocalForcedActions;
+#else
     uint32_t volatile       fLocalForcedActions;
     uint32_t                fForLocalForcedActionsExpansion;
+#endif
     /** The CPU state. */
     VMCPUSTATE volatile     enmState;
@@ -675,9 +679,17 @@
  * @sa      VMCPU_FF_SET_MASK
  */
-#define VMCPU_FF_SET(pVCpu, fFlag) do { \
+#ifdef VMCPU_WITH_64_BIT_FFS
+# define VMCPU_FF_SET(pVCpu, fFlag) do { \
+        AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
+        AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \
+        ASMAtomicBitSet(&(pVCpu)->fLocalForcedActions, fFlag##_BIT); \
+    } while (0)
+#else
+# define VMCPU_FF_SET(pVCpu, fFlag) do { \
         AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
         AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \
         ASMAtomicOrU32(&(pVCpu)->fLocalForcedActions, (fFlag)); \
     } while (0)
+#endif
 
 /** @def VMCPU_FF_SET_MASK
@@ -688,6 +700,18 @@
  * @sa      VMCPU_FF_SET
  */
-#define VMCPU_FF_SET_MASK(a_pVCpu, fFlags) \
+#ifdef VMCPU_WITH_64_BIT_FFS
+# if ARCH_BITS > 32
+#  define VMCPU_FF_SET_MASK(a_pVCpu, fFlags) \
+    do { ASMAtomicOrU64(&a_pVCpu->fLocalForcedActions, (fFlags)); } while (0)
+# else
+#  define VMCPU_FF_SET_MASK(a_pVCpu, fFlags) do { \
+        if (!((fFlags) >> 32)) ASMAtomicOrU32((uint32_t volatile *)&a_pVCpu->fLocalForcedActions, (uint32_t)(fFlags)); \
+        else ASMAtomicOrU64(&a_pVCpu->fLocalForcedActions, (fFlags)); \
+    } while (0)
+# endif
+#else
+# define VMCPU_FF_SET_MASK(a_pVCpu, fFlags) \
     do { ASMAtomicOrU32(&a_pVCpu->fLocalForcedActions, (fFlags)); } while (0)
+#endif
 
 /** @def VM_FF_CLEAR
@@ -709,9 +733,17 @@
  * @param   fFlag   The flag to clear.
  */
-#define VMCPU_FF_CLEAR(pVCpu, fFlag) do { \
+#ifdef VMCPU_WITH_64_BIT_FFS
+# define VMCPU_FF_CLEAR(pVCpu, fFlag) do { \
+        AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
+        AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \
+        ASMAtomicBitClear(&(pVCpu)->fLocalForcedActions, fFlag##_BIT); \
+    } while (0)
+#else
+# define VMCPU_FF_CLEAR(pVCpu, fFlag) do { \
         AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
         AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \
         ASMAtomicAndU32(&(pVCpu)->fLocalForcedActions, ~(fFlag)); \
     } while (0)
+#endif
 
 /** @def VMCPU_FF_CLEAR_MASK
@@ -721,6 +753,18 @@
  * @param   fFlags  The flags to clear.
  */
-#define VMCPU_FF_CLEAR_MASK(pVCpu, fFlags) \
+#ifdef VMCPU_WITH_64_BIT_FFS
+# if ARCH_BITS > 32
+# define VMCPU_FF_CLEAR_MASK(pVCpu, fFlags) \
+    do { ASMAtomicAndU64(&(pVCpu)->fLocalForcedActions, ~(fFlags)); } while (0)
+# else
+# define VMCPU_FF_CLEAR_MASK(pVCpu, fFlags) do { \
+        if (!((fFlags) >> 32)) ASMAtomicAndU32((uint32_t volatile *)&(pVCpu)->fLocalForcedActions, ~(uint32_t)(fFlags)); \
+        else ASMAtomicAndU64(&(pVCpu)->fLocalForcedActions, ~(fFlags)); \
+    } while (0)
+# endif
+#else
+# define VMCPU_FF_CLEAR_MASK(pVCpu, fFlags) \
     do { ASMAtomicAndU32(&(pVCpu)->fLocalForcedActions, ~(fFlags)); } while (0)
+#endif
 
 /** @def VM_FF_IS_SET
@@ -732,5 +776,5 @@
  */
 #if !defined(VBOX_STRICT) || !defined(RT_COMPILER_SUPPORTS_LAMBDA)
-# define VM_FF_IS_SET(pVM, fFlag)           (((pVM)->fGlobalForcedActions & (fFlag)) == (fFlag))
+# define VM_FF_IS_SET(pVM, fFlag)           RT_BOOL((pVM)->fGlobalForcedActions & (fFlag))
 #else
 # define VM_FF_IS_SET(pVM, fFlag) \
@@ -739,5 +783,5 @@
         AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
         AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \
-        return (a_pVM->fGlobalForcedActions & (fFlag)) == (fFlag); \
+        return RT_BOOL(a_pVM->fGlobalForcedActions & (fFlag)); \
     }(pVM))
 #endif
@@ -751,5 +795,5 @@
  */
 #if !defined(VBOX_STRICT) || !defined(RT_COMPILER_SUPPORTS_LAMBDA)
-# define VMCPU_FF_IS_SET(pVCpu, fFlag)      (((pVCpu)->fLocalForcedActions & (fFlag)) == (fFlag))
+# define VMCPU_FF_IS_SET(pVCpu, fFlag)      RT_BOOL((pVCpu)->fLocalForcedActions & (fFlag))
 #else
 # define VMCPU_FF_IS_SET(pVCpu, fFlag) \
@@ -758,5 +802,5 @@
         AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
         AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \
-        return (a_pVCpu->fLocalForcedActions & (fFlag)) == (fFlag); \
+        return RT_BOOL(a_pVCpu->fLocalForcedActions & (fFlag)); \
     }(pVCpu))
 #endif
Index: /trunk/src/VBox/VMM/VBoxVMM.d
===================================================================
--- /trunk/src/VBox/VMM/VBoxVMM.d	(revision 74797)
+++ /trunk/src/VBox/VMM/VBoxVMM.d	(revision 74798)
@@ -30,8 +30,8 @@
     /*^^VMM-ALT-TP: "%04x:%08llx rc=%d", (a_pCtx)->cs, (a_pCtx)->rip, (a_rc) */
 
-    probe em__ff__high(struct VMCPU *a_pVCpu, uint32_t a_fGlobal, uint32_t a_fLocal, int a_rc);
+    probe em__ff__high(struct VMCPU *a_pVCpu, uint32_t a_fGlobal, uint64_t a_fLocal, int a_rc);
     /*^^VMM-ALT-TP: "vm=%#x cpu=%#x rc=%d", (a_fGlobal), (a_fLocal), (a_rc) */
 
-    probe em__ff__all(struct VMCPU *a_pVCpu, uint32_t a_fGlobal, uint32_t a_fLocal, int a_rc);
+    probe em__ff__all(struct VMCPU *a_pVCpu, uint32_t a_fGlobal, uint64_t a_fLocal, int a_rc);
     /*^^VMM-ALT-TP: "vm=%#x cpu=%#x rc=%d", (a_fGlobal), (a_fLocal), (a_rc) */
 
@@ -39,5 +39,5 @@
     /*^^VMM-ALT-TP: "%d", (a_rc) */
 
-    probe em__ff__raw(struct VMCPU *a_pVCpu, uint32_t a_fGlobal, uint32_t a_fLocal);
+    probe em__ff__raw(struct VMCPU *a_pVCpu, uint32_t a_fGlobal, uint64_t a_fLocal);
     /*^^VMM-ALT-TP: "vm=%#x cpu=%#x", (a_fGlobal), (a_fLocal) */
 
Index: /trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/IEMAll.cpp	(revision 74797)
+++ /trunk/src/VBox/VMM/VMMAll/IEMAll.cpp	(revision 74798)
@@ -14337,5 +14337,5 @@
                     if (RT_LIKELY(pVCpu->iem.s.rcPassUp == VINF_SUCCESS))
                     {
-                        uint32_t fCpu = pVCpu->fLocalForcedActions
+                        uint64_t fCpu = pVCpu->fLocalForcedActions
                                       & ( VMCPU_FF_ALL_MASK & ~(  VMCPU_FF_PGM_SYNC_CR3
                                                                 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL
@@ -14499,5 +14499,5 @@
                     if (RT_LIKELY(pVCpu->iem.s.rcPassUp == VINF_SUCCESS))
                     {
-                        uint32_t fCpu = pVCpu->fLocalForcedActions
+                        uint64_t fCpu = pVCpu->fLocalForcedActions
                                       & ( VMCPU_FF_ALL_MASK & ~(  VMCPU_FF_PGM_SYNC_CR3
                                                                 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL
Index: /trunk/src/VBox/VMM/VMMAll/IEMAllCImplStrInstr.cpp.h
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/IEMAllCImplStrInstr.cpp.h	(revision 74797)
+++ /trunk/src/VBox/VMM/VMMAll/IEMAllCImplStrInstr.cpp.h	(revision 74798)
@@ -89,6 +89,6 @@
         else \
         { \
-            LogFlow(("%s: Leaving early (outer)! ffcpu=%#x ffvm=%#x\n", \
-                     __FUNCTION__, (a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \
+            LogFlow(("%s: Leaving early (outer)! ffcpu=%#RX64 ffvm=%#x\n", \
+                     __FUNCTION__, (uint64_t)(a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \
             return VINF_SUCCESS; \
         } \
@@ -104,6 +104,6 @@
         else  \
         { \
-            LogFlow(("%s: Leaving early (outer)! ffcpu=%#x ffvm=%#x\n", \
-                     __FUNCTION__, (a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \
+            LogFlow(("%s: Leaving early (outer)! ffcpu=%#RX64 ffvm=%#x\n", \
+                     __FUNCTION__, (uint64_t)(a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \
             return VINF_SUCCESS; \
         } \
@@ -124,6 +124,6 @@
         else \
         { \
-            LogFlow(("%s: Leaving early (inner)! ffcpu=%#x ffvm=%#x\n", \
-                     __FUNCTION__, (a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \
+            LogFlow(("%s: Leaving early (inner)! ffcpu=%#RX64 ffvm=%#x\n", \
+                     __FUNCTION__, (uint64_t)(a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \
             return VINF_SUCCESS; \
         } \
@@ -144,6 +144,6 @@
         else \
         { \
-            LogFlow(("%s: Leaving early (inner)! ffcpu=%#x (ffvm=%#x)\n", \
-                     __FUNCTION__, (a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \
+            LogFlow(("%s: Leaving early (inner)! ffcpu=%#RX64 (ffvm=%#x)\n", \
+                     __FUNCTION__, (uint64_t)(a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \
             return VINF_SUCCESS; \
         } \
Index: /trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h	(revision 74797)
+++ /trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h	(revision 74798)
@@ -4309,6 +4309,6 @@
                 /** @todo Try handle pending flags, not just return to EM loops.  Take care
                  *        not to set important RCs here unless we've handled a message. */
-                LogFlow(("NEM/%u: breaking: pending FF (%#x / %#x)\n",
-                         pVCpu->idCpu, pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions));
+                LogFlow(("NEM/%u: breaking: pending FF (%#x / %#RX64)\n",
+                         pVCpu->idCpu, pVM->fGlobalForcedActions, (uint64_t)pVCpu->fLocalForcedActions));
                 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatBreakOnFFPost);
             }
Index: /trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp	(revision 74797)
+++ /trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp	(revision 74798)
@@ -3236,5 +3236,5 @@
     /* Please, no longjumps here (any logging shouldn't flush jump back to ring-3). NO LOGGING BEFORE THIS POINT! */
     VMMRZCallRing3Disable(pVCpu);
-    Log4Func(("rcExit=%d LocalFF=%#RX32 GlobalFF=%#RX32\n", rcExit, pVCpu->fLocalForcedActions,
+    Log4Func(("rcExit=%d LocalFF=%#RX64 GlobalFF=%#RX32\n", rcExit, (uint64_t)pVCpu->fLocalForcedActions,
               pVCpu->CTX_SUFF(pVM)->fGlobalForcedActions));
 
Index: /trunk/src/VBox/VMM/VMMR3/EMR3Nem.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/EMR3Nem.cpp	(revision 74797)
+++ /trunk/src/VBox/VMM/VMMR3/EMR3Nem.cpp	(revision 74798)
@@ -309,5 +309,5 @@
     if (VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL))
     {
-        Log(("NEM: TODO: Make VMCPU_FF_PGM_SYNC_CR3 / VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL quiet! (%#x)\n", pVCpu->fLocalForcedActions));
+        Log(("NEM: TODO: Make VMCPU_FF_PGM_SYNC_CR3 / VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL quiet! (%#RX64)\n", (uint64_t)pVCpu->fLocalForcedActions));
         VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL);
     }
Index: /trunk/src/VBox/VMM/VMMR3/VMEmt.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/VMEmt.cpp	(revision 74797)
+++ /trunk/src/VBox/VMM/VMMR3/VMEmt.cpp	(revision 74798)
@@ -1112,5 +1112,5 @@
         ||  VMCPU_FF_IS_ANY_SET(pVCpu, fMask))
     {
-        LogFlow(("VMR3WaitHalted: returns VINF_SUCCESS (FF %#x FFCPU %#x)\n", pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions));
+        LogFlow(("VMR3WaitHalted: returns VINF_SUCCESS (FF %#x FFCPU %#RX64)\n", pVM->fGlobalForcedActions, (uint64_t)pVCpu->fLocalForcedActions));
         return VINF_SUCCESS;
     }
Index: /trunk/src/VBox/VMM/VMMR3/VMM.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/VMM.cpp	(revision 74797)
+++ /trunk/src/VBox/VMM/VMMR3/VMM.cpp	(revision 74798)
@@ -3103,6 +3103,6 @@
     for (VMCPUID i = 0; i < pVM->cCpus; i++)
     {
-        const uint32_t fLocalForcedActions = pVM->aCpus[i].fLocalForcedActions;
-        pHlp->pfnPrintf(pHlp, "CPU %u FFs: %#RX32", i, fLocalForcedActions);
+        const uint64_t fLocalForcedActions = pVM->aCpus[i].fLocalForcedActions;
+        pHlp->pfnPrintf(pHlp, "CPU %u FFs: %#RX64", i, fLocalForcedActions);
 
         /* show the flag mnemonics */
@@ -3139,5 +3139,5 @@
 #endif
         if (f)
-            pHlp->pfnPrintf(pHlp, "%s\n    Unknown bits: %#RX32\n", c ? "," : "", f);
+            pHlp->pfnPrintf(pHlp, "%s\n    Unknown bits: %#RX64\n", c ? "," : "", f);
         else
             pHlp->pfnPrintf(pHlp, "\n");
Index: /trunk/src/VBox/VMM/include/CPUMInternal.mac
===================================================================
--- /trunk/src/VBox/VMM/include/CPUMInternal.mac	(revision 74797)
+++ /trunk/src/VBox/VMM/include/CPUMInternal.mac	(revision 74798)
@@ -254,6 +254,7 @@
     .Guest.hwvirt.svm.HCPhysVmcb             RTHCPHYS_RES 1
     .Guest.hwvirt.enmHwvirt                  resd         1
+    .Guest.hwvirt.fGif                       resb         1
+    alignb 8
     .Guest.hwvirt.fLocalForcedActions        resd         1
-    .Guest.hwvirt.fGif                       resb         1
     alignb 64
 
@@ -542,6 +543,7 @@
     .Hyper.hwvirt.svm.HCPhysVmcb             RTHCPHYS_RES 1
     .Hyper.hwvirt.enmHwvirt                  resd         1
+    .Hyper.hwvirt.fGif                       resb         1
+    alignb 8
     .Hyper.hwvirt.fLocalForcedActions        resd         1
-    .Hyper.hwvirt.fGif                       resb         1
     alignb 64
 
Index: /trunk/src/VBox/VMM/testcase/tstVMStruct.h
===================================================================
--- /trunk/src/VBox/VMM/testcase/tstVMStruct.h	(revision 74797)
+++ /trunk/src/VBox/VMM/testcase/tstVMStruct.h	(revision 74798)
@@ -169,6 +169,6 @@
     GEN_CHECK_OFF(CPUMCTX, hwvirt.vmx.pvMsrBitmapR3);
     GEN_CHECK_OFF(CPUMCTX, hwvirt.enmHwvirt);
+    GEN_CHECK_OFF(CPUMCTX, hwvirt.fGif);
     GEN_CHECK_OFF(CPUMCTX, hwvirt.fLocalForcedActions);
-    GEN_CHECK_OFF(CPUMCTX, hwvirt.fGif);
     /** @todo NSTVMX: add rest of hwvirt fields when code is more
      *        finalized. */
Index: /trunk/src/recompiler/VBoxRecompiler.c
===================================================================
--- /trunk/src/recompiler/VBoxRecompiler.c	(revision 74797)
+++ /trunk/src/recompiler/VBoxRecompiler.c	(revision 74798)
@@ -1166,6 +1166,6 @@
                     && !VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_ALL_REM_MASK))
                     continue;
-                RTLogPrintf("remR3RunLoggingStep: rc=VINF_SUCCESS w/ FFs (%#x/%#x)\n",
-                            pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions);
+                RTLogPrintf("remR3RunLoggingStep: rc=VINF_SUCCESS w/ FFs (%#x/%#RX64)\n",
+                            pVM->fGlobalForcedActions, (uint64_t)pVCpu->fLocalForcedActions);
                 rc = VINF_SUCCESS;
                 break;
@@ -1200,6 +1200,6 @@
                         continue;
 
-                    RTLogPrintf("remR3RunLoggingStep: rc=VINF_SUCCESS w/ FFs (%#x/%#x)\n",
-                                pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions);
+                    RTLogPrintf("remR3RunLoggingStep: rc=VINF_SUCCESS w/ FFs (%#x/%#RX64)\n",
+                                pVM->fGlobalForcedActions, (uint64_t)pVCpu->fLocalForcedActions);
                     rc = VINF_SUCCESS;
                 }
