Index: /trunk/src/VBox/VMM/VMMAll/EMAll.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/EMAll.cpp	(revision 72656)
+++ /trunk/src/VBox/VMM/VMMAll/EMAll.cpp	(revision 72657)
@@ -472,5 +472,5 @@
             VBOXSTRICTRC rcStrict = IEMExecForExits(pVCpu, fWillExit,
                                                     pExitRec->cMaxInstructionsWithoutExit /* cMinInstructions*/,
-                                                    4096 /*cMaxInstructions*/,
+                                                    pVCpu->em.s.cHistoryExecMaxInstructions,
                                                     pExitRec->cMaxInstructionsWithoutExit,
                                                     &ExecStats);
@@ -494,7 +494,7 @@
             PEMEXITREC   pExitRecUnconst = (PEMEXITREC)pExitRec;
             VBOXSTRICTRC rcStrict = IEMExecForExits(pVCpu, fWillExit,
-                                                    64 /*cMinInstructions*/,
-                                                    4096 /*cMaxInstructions*/,
-                                                    32 /*cMaxInstructionsWithoutExit*/,
+                                                    pVCpu->em.s.cHistoryProbeMinInstructions,
+                                                    pVCpu->em.s.cHistoryExecMaxInstructions,
+                                                    pVCpu->em.s.cHistoryProbeMaxInstructionsWithoutExit,
                                                     &ExecStats);
             LogFlow(("EMHistoryExec/EXEC_PROBE: %Rrc cExits=%u cMaxExitDistance=%u cInstructions=%u\n",
Index: /trunk/src/VBox/VMM/VMMR3/EM.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/EM.cpp	(revision 72656)
+++ /trunk/src/VBox/VMM/VMMR3/EM.cpp	(revision 72657)
@@ -183,4 +183,15 @@
         pVM->aCpus[i].em.s.fExitOptimizationEnabledR0                = fExitOptimizationEnabledR0;
         pVM->aCpus[i].em.s.fExitOptimizationEnabledR0PreemptDisabled = fExitOptimizationEnabledR0PreemptDisabled;
+
+        pVM->aCpus[i].em.s.cHistoryExecMaxInstructions               = 8192;
+        pVM->aCpus[i].em.s.cHistoryProbeMinInstructions              = 48;
+        pVM->aCpus[i].em.s.cHistoryProbeMaxInstructionsWithoutExit   = 24;
+#ifdef RT_OS_WINDOWS
+        if (VM_IS_NEM_ENABLED(pVM))
+        {
+            pVM->aCpus[i].em.s.cHistoryProbeMaxInstructionsWithoutExit = 32;
+            pVM->aCpus[i].em.s.cHistoryProbeMinInstructions            = 64;
+        }
+#endif
     }
 
Index: /trunk/src/VBox/VMM/include/EMInternal.h
===================================================================
--- /trunk/src/VBox/VMM/include/EMInternal.h	(revision 72656)
+++ /trunk/src/VBox/VMM/include/EMInternal.h	(revision 72657)
@@ -503,4 +503,8 @@
      * wrapped around or not.  */
     uint64_t                iNextExit;
+
+    /** Index into aExitRecords set by EMHistoryExec when returning to ring-3.
+     * This is UINT16_MAX if not armed.  */
+    uint16_t volatile       idxContinueExitRec;
     /** Whether exit optimizations are enabled or not (in general). */
     bool                    fExitOptimizationEnabled : 1;
@@ -510,8 +514,12 @@
     bool                    fExitOptimizationEnabledR0PreemptDisabled : 1;
     /** Explicit padding. */
-    bool                    afPadding2[1];
-    /** Index into aExitRecords set by EMHistoryExec when returning to ring-3.
-     * This is UINT16_MAX if not armed.  */
-    uint16_t volatile       idxContinueExitRec;
+    bool                    fPadding2;
+    /** Max number of instructions to execute. */
+    uint16_t                cHistoryExecMaxInstructions;
+    /** Min number of instructions to execute while probing. */
+    uint16_t                cHistoryProbeMinInstructions;
+    /** Max number of instructions to execute without an exit before giving up probe. */
+    uint16_t                cHistoryProbeMaxInstructionsWithoutExit;
+    uint16_t                uPadding3;
     /** Number of exit records in use. */
     uint32_t                cExitRecordUsed;
@@ -522,5 +530,5 @@
     /** Number of instructions executed by EMHistoryExec. */
     STAMCOUNTER             StatHistoryExecInstructions;
-    uint64_t                aPadding3[2];
+    uint64_t                uPadding4;
     /** Number of instructions executed by EMHistoryExec when probing. */
     STAMCOUNTER             StatHistoryProbeInstructions;
