Index: trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompFuncs.h
===================================================================
--- trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompFuncs.h	(revision 106195)
+++ trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompFuncs.h	(revision 106196)
@@ -6058,4 +6058,7 @@
     {
         Assert(!(pReNative->fSkippingEFlags & fElfInput)); RT_NOREF(fElfInput);
+        if (pReNative->fSkippingEFlags)
+            Log5(("EFLAGS: fSkippingEFlags %#x -> %#x (iemNativeEmitCommitEFlags)\n",
+                  pReNative->fSkippingEFlags, pReNative->fSkippingEFlags & ~(a_fEflOutput & X86_EFL_STATUS_BITS) ));
         if RT_CONSTEXPR_IF((a_fEflOutput & X86_EFL_STATUS_BITS) == X86_EFL_STATUS_BITS)
             pReNative->fSkippingEFlags  = 0;
@@ -6121,4 +6124,19 @@
     /* Free but don't flush the EFLAGS register. */
     iemNativeRegFreeTmp(pReNative, idxEflReg);
+
+#ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
+    /* Clear the bit in the skipped mask if we're clobbering and it's a status bit. */
+    if RT_CONSTEXPR_IF(   (a_enmOp == kIemNativeEmitEflOp_Set || a_enmOp == kIemNativeEmitEflOp_Clear)
+                       && (a_fEflBit & X86_EFL_STATUS_BITS))
+    {
+        if (pReNative->fSkippingEFlags)
+            Log5(("EFLAGS: fSkippingEFlags %#x -> %#x (iemNativeEmitModifyEFlagsBit)\n",
+                  pReNative->fSkippingEFlags, pReNative->fSkippingEFlags & ~a_fEflBit ));
+        pReNative->fSkippingEFlags &= ~a_fEflBit;
+# ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
+        off = iemNativeEmitAndImmIntoVCpuU32(pReNative, off, ~a_fEflBit, RT_UOFFSETOF(VMCPU, iem.s.fSkippingEFlags));
+# endif
+    }
+#endif
 
     return off;
@@ -6269,4 +6287,7 @@
     IEMNATIVE_ASSERT_EFLAGS_SKIPPING_AND_POSTPONING(pReNative,  fEflInput);
     IEMNATIVE_STRICT_EFLAGS_SKIPPING_EMIT_CHECK(pReNative, off, fEflInput);
+    if (pReNative->fSkippingEFlags)
+        Log5(("EFLAGS: fSkippingEFlags %#x -> %#x (iemNativeEmitRefEFlags)\n",
+              pReNative->fSkippingEFlags, pReNative->fSkippingEFlags & ~a_fEflOutput ));
     pReNative->fSkippingEFlags &= ~a_fEflOutput;
 # ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
Index: trunk/src/VBox/VMM/VMMAll/target-x86/IEMAllN8veEmit-x86.h
===================================================================
--- trunk/src/VBox/VMM/VMMAll/target-x86/IEMAllN8veEmit-x86.h	(revision 106195)
+++ trunk/src/VBox/VMM/VMMAll/target-x86/IEMAllN8veEmit-x86.h	(revision 106196)
@@ -237,5 +237,5 @@
             else
             {
-                Log5(("iemNativeClearPostponedEFlags: Clobbering %#x: %#x -> %#x (op=%d bits=%u)\n", a_fEflClobbered,
+                Log5(("EFLAGS: Clobbering %#x: %#x -> %#x (op=%d bits=%u) - iemNativeClearPostponedEFlags\n", a_fEflClobbered,
                       pReNative->PostponedEfl.fEFlags, fEFlags, pReNative->PostponedEfl.enmOp, pReNative->PostponedEfl.cOpBits));
                 pReNative->PostponedEfl.fEFlags = fEFlags;
@@ -245,5 +245,5 @@
 
         /* Do cleanup.  */
-        Log5(("iemNativeClearPostponedEFlags: Cleanup of op=%u bits=%u efl=%#x upon clobbering %#x\n",
+        Log5(("EFLAGS: Cleanup of op=%u bits=%u efl=%#x upon clobbering %#x - iemNativeClearPostponedEFlags\n",
               pReNative->PostponedEfl.enmOp, pReNative->PostponedEfl.cOpBits, pReNative->PostponedEfl.fEFlags, a_fEflClobbered));
         pReNative->PostponedEfl.fEFlags = 0;
@@ -548,9 +548,9 @@
     {
         STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeEflSkippedLogical);
-        pReNative->fSkippingEFlags |= X86_EFL_STATUS_BITS;
+        pReNative->fSkippingEFlags = X86_EFL_STATUS_BITS;
 # ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
         off = iemNativeEmitOrImmIntoVCpuU32(pReNative, off, X86_EFL_STATUS_BITS, RT_UOFFSETOF(VMCPU, iem.s.fSkippingEFlags));
 # endif
-        Log5(("iemNativeEmitEFlagsForLogical: Skipping %#x\n", X86_EFL_STATUS_BITS));
+        Log5(("EFLAGS: Skipping %#x - iemNativeEmitEFlagsForLogical\n", X86_EFL_STATUS_BITS));
         return off;
     }
@@ -570,5 +570,5 @@
          *        doesn't modify it.  That'll save a register move and allocation. */
         off = iemNativeEmitLoadGprFromGpr(pReNative, off, pReNative->PostponedEfl.idxReg1, idxRegResult);
-        Log5(("iemNativeEmitEFlagsForLogical: Postponing %#x op=%u bits=%u reg1=%u\n", X86_EFL_STATUS_BITS,
+        Log5(("EFLAGS: Postponing %#x op=%u bits=%u reg1=%u - iemNativeEmitEFlagsForLogical\n", X86_EFL_STATUS_BITS,
               kIemNativePostponedEflOp_Logical, cOpBits, pReNative->PostponedEfl.idxReg1));
     }
@@ -645,4 +645,6 @@
 
 #ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
+    if (pReNative->fSkippingEFlags)
+        Log5(("EFLAGS: fSkippingEFlags %#x -> 0 (iemNativeEmitEFlagsForLogical)\n", pReNative->fSkippingEFlags));
     pReNative->fSkippingEFlags = 0;
 # ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
@@ -679,5 +681,6 @@
     {
         STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeEflSkippedArithmetic);
-        pReNative->fSkippingEFlags |= X86_EFL_STATUS_BITS;
+        pReNative->fSkippingEFlags = X86_EFL_STATUS_BITS;
+        Log5(("EFLAGS: Skipping %#x - iemNativeEmitEFlagsForArithmetic\n", X86_EFL_STATUS_BITS));
 # ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
         off = iemNativeEmitOrImmIntoVCpuU32(pReNative, off, X86_EFL_STATUS_BITS, RT_UOFFSETOF(VMCPU, iem.s.fSkippingEFlags));
@@ -687,7 +690,4 @@
 #endif
     {
-#ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
-        uint32_t fSkipped = 0;
-#endif
 #ifdef RT_ARCH_AMD64
         /*
@@ -845,7 +845,9 @@
 
 #ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
-        pReNative->fSkippingEFlags = fSkipped;
+        if (pReNative->fSkippingEFlags)
+            Log5(("EFLAGS: fSkippingEFlags %#x -> 0 (iemNativeEmitEFlagsForArithmetic)\n", pReNative->fSkippingEFlags));
+        pReNative->fSkippingEFlags = 0;
 # ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
-        off = iemNativeEmitStoreImmToVCpuU32(pReNative, off, fSkipped, RT_UOFFSETOF(VMCPU, iem.s.fSkippingEFlags));
+        off = iemNativeEmitStoreImmToVCpuU32(pReNative, off, 0, RT_UOFFSETOF(VMCPU, iem.s.fSkippingEFlags));
 # endif
 #endif
@@ -2106,4 +2108,6 @@
 
 #ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
+        if (pReNative->fSkippingEFlags)
+            Log5(("EFLAGS: fSkippingEFlags %#x -> 0 (iemNativeEmitEFlagsForShift)\n", pReNative->fSkippingEFlags));
         pReNative->fSkippingEFlags = 0;
 # ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
