Index: /trunk/include/VBox/hwaccm.h
===================================================================
--- /trunk/include/VBox/hwaccm.h	(revision 17291)
+++ /trunk/include/VBox/hwaccm.h	(revision 17292)
@@ -120,4 +120,5 @@
 VMMR3DECL(bool) HWACCMR3IsVPIDActive(PVM pVM);
 VMMR3DECL(int)  HWACCMR3InjectNMI(PVM pVM);
+VMMR3DECL(void) HWACCMR3EmulateIoBlock(PVM pVM, PCPUMCTX pCtx);
 
 /** @} */
Index: /trunk/src/VBox/VMM/EM.cpp
===================================================================
--- /trunk/src/VBox/VMM/EM.cpp	(revision 17291)
+++ /trunk/src/VBox/VMM/EM.cpp	(revision 17292)
@@ -2360,4 +2360,5 @@
          */
         case VINF_EM_RAW_EMULATE_IO_BLOCK:
+            HWACCMR3EmulateIoBlock(pVM, pCtx);
             rc = VINF_EM_RESCHEDULE_REM;
             break;
Index: /trunk/src/VBox/VMM/HWACCM.cpp
===================================================================
--- /trunk/src/VBox/VMM/HWACCM.cpp	(revision 17291)
+++ /trunk/src/VBox/VMM/HWACCM.cpp	(revision 17292)
@@ -1190,4 +1190,19 @@
 
 /**
+ * Force execution of the current IO code in the recompiler
+ *
+ * @param   pVM         The VM to operate on.
+ * @param   pCtx        Partial VM execution context
+ */
+VMMR3DECL(void) HWACCMR3EmulateIoBlock(PVM pVM, PCPUMCTX pCtx)
+{
+    PVMCPU pVCpu = VMMGetCpu(pVM);
+
+    Assert(pVM->fHWACCMEnabled);
+    pVCpu->hwaccm.s.EmulateIoBlock.fEnabled         = true;
+    pVCpu->hwaccm.s.EmulateIoBlock.GCPtrFunctionEsp = pCtx->rsp;
+}
+
+/**
  * Checks if we can currently use hardware accelerated raw mode.
  *
@@ -1198,5 +1213,13 @@
 VMMR3DECL(bool) HWACCMR3CanExecuteGuest(PVM pVM, PCPUMCTX pCtx)
 {
+    PVMCPU pVCpu = VMMGetCpu(pVM);
+
     Assert(pVM->fHWACCMEnabled);
+
+    if (    RT_UNLIKELY(pVCpu->hwaccm.s.EmulateIoBlock.fEnabled)
+        &&  pCtx->rsp < pVCpu->hwaccm.s.EmulateIoBlock.GCPtrFunctionEsp)
+        return false;
+
+    pVCpu->hwaccm.s.EmulateIoBlock.fEnabled = false;
 
     /* AMD SVM supports real & protected mode with or without paging. */
Index: /trunk/src/VBox/VMM/HWACCMInternal.h
===================================================================
--- /trunk/src/VBox/VMM/HWACCMInternal.h	(revision 17291)
+++ /trunk/src/VBox/VMM/HWACCMInternal.h	(revision 17292)
@@ -549,4 +549,14 @@
         uint64_t                    intInfo;
     } Event;
+
+    /** IO Block emulation state. */
+    struct
+    {
+        bool                    fEnabled;
+        uint8_t                 u8Align[7];
+
+        /** Esp at the start of the io code we wish to emulate in the recompiler. */
+        RTGCPTR                 GCPtrFunctionEsp;
+    } EmulateIoBlock;
 
     /** Currenty shadow paging mode. */
