Index: /trunk/src/VBox/VMM/EM.cpp
===================================================================
--- /trunk/src/VBox/VMM/EM.cpp	(revision 17283)
+++ /trunk/src/VBox/VMM/EM.cpp	(revision 17284)
@@ -2357,4 +2357,11 @@
 
         /*
+         * (MM)IO intensive code block detected; fall back to the recompiler for better performance
+         */
+        case VINF_EM_RAW_EMULATE_IO_BLOCK:
+            rc = VINF_EM_RESCHEDULE_REM;
+            break;
+
+        /*
          * Execute instruction.
          */
Index: /trunk/src/VBox/VMM/VMM.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMM.cpp	(revision 17283)
+++ /trunk/src/VBox/VMM/VMM.cpp	(revision 17284)
@@ -323,4 +323,5 @@
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetIRETTrap,            STAMTYPE_COUNTER, "/VMM/RZRet/IRETTrap",            STAMUNIT_OCCURENCES, "Number of VINF_EM_RAW_IRET_TRAP returns.");
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetEmulate,             STAMTYPE_COUNTER, "/VMM/RZRet/Emulate",             STAMUNIT_OCCURENCES, "Number of VINF_EM_EXECUTE_INSTRUCTION returns.");
+    STAM_REG(pVM, &pVM->vmm.s.StatRZRetIOBlockEmulate,      STAMTYPE_COUNTER, "/VMM/RZRet/EmulateIOBlock",      STAMUNIT_OCCURENCES, "Number of VINF_EM_RAW_EMULATE_IO_BLOCK returns.");
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetPatchEmulate,        STAMTYPE_COUNTER, "/VMM/RZRet/PatchEmulate",        STAMUNIT_OCCURENCES, "Number of VINF_PATCH_EMULATE_INSTR returns.");
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetIORead,              STAMTYPE_COUNTER, "/VMM/RZRet/IORead",              STAMUNIT_OCCURENCES, "Number of VINF_IOM_HC_IOPORT_READ returns.");
Index: /trunk/src/VBox/VMM/VMMInternal.h
===================================================================
--- /trunk/src/VBox/VMM/VMMInternal.h	(revision 17283)
+++ /trunk/src/VBox/VMM/VMMInternal.h	(revision 17284)
@@ -302,4 +302,5 @@
     STAMCOUNTER                 StatRZRetIRETTrap;
     STAMCOUNTER                 StatRZRetEmulate;
+    STAMCOUNTER                 StatRZRetIOBlockEmulate;
     STAMCOUNTER                 StatRZRetPatchEmulate;
     STAMCOUNTER                 StatRZRetIORead;
Index: /trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp	(revision 17283)
+++ /trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp	(revision 17284)
@@ -1453,5 +1453,5 @@
             }
 #ifdef VBOX_STRICT
-            if (rc != VINF_EM_RAW_EMULATE_INSTR)
+            if (rc != VINF_EM_RAW_EMULATE_INSTR && rc != VINF_EM_RAW_EMULATE_IO_BLOCK)
                 LogFlow(("PGMTrap0eHandler failed with %d\n", rc));
 #endif
Index: /trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp	(revision 17283)
+++ /trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp	(revision 17284)
@@ -2429,5 +2429,5 @@
                 }
 #ifdef VBOX_STRICT
-                if (rc != VINF_EM_RAW_EMULATE_INSTR)
+                if (rc != VINF_EM_RAW_EMULATE_INSTR && rc != VINF_EM_RAW_EMULATE_IO_BLOCK)
                     Log2(("PGMTrap0eHandler failed with %d\n", rc));
 #endif
Index: /trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/VMMR0.cpp	(revision 17283)
+++ /trunk/src/VBox/VMM/VMMR0/VMMR0.cpp	(revision 17284)
@@ -372,4 +372,7 @@
         case VINF_EM_RAW_EMULATE_INSTR:
             STAM_COUNTER_INC(&pVM->vmm.s.StatRZRetEmulate);
+            break;
+        case VINF_EM_RAW_EMULATE_IO_BLOCK:
+            STAM_COUNTER_INC(&pVM->vmm.s.StatRZRetIOBlockEmulate);
             break;
         case VINF_PATCH_EMULATE_INSTR:
