Index: /trunk/include/VBox/hwaccm.h
===================================================================
--- /trunk/include/VBox/hwaccm.h	(revision 17294)
+++ /trunk/include/VBox/hwaccm.h	(revision 17295)
@@ -120,5 +120,5 @@
 VMMR3DECL(bool) HWACCMR3IsVPIDActive(PVM pVM);
 VMMR3DECL(int)  HWACCMR3InjectNMI(PVM pVM);
-VMMR3DECL(void) HWACCMR3EmulateIoBlock(PVM pVM, PCPUMCTX pCtx);
+VMMR3DECL(int)  HWACCMR3EmulateIoBlock(PVM pVM, PCPUMCTX pCtx);
 
 /** @} */
Index: /trunk/src/VBox/VMM/EM.cpp
===================================================================
--- /trunk/src/VBox/VMM/EM.cpp	(revision 17294)
+++ /trunk/src/VBox/VMM/EM.cpp	(revision 17295)
@@ -2360,6 +2360,5 @@
          */
         case VINF_EM_RAW_EMULATE_IO_BLOCK:
-            HWACCMR3EmulateIoBlock(pVM, pCtx);
-            rc = VINF_EM_RESCHEDULE_REM;
+            rc =HWACCMR3EmulateIoBlock(pVM, pCtx);
             break;
 
Index: /trunk/src/VBox/VMM/HWACCM.cpp
===================================================================
--- /trunk/src/VBox/VMM/HWACCM.cpp	(revision 17294)
+++ /trunk/src/VBox/VMM/HWACCM.cpp	(revision 17295)
@@ -1192,14 +1192,23 @@
  * Force execution of the current IO code in the recompiler
  *
+ * @returns VBox status code.
  * @param   pVM         The VM to operate on.
  * @param   pCtx        Partial VM execution context
  */
-VMMR3DECL(void) HWACCMR3EmulateIoBlock(PVM pVM, PCPUMCTX pCtx)
+VMMR3DECL(int) 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;
+    Log(("HWACCMR3EmulateIoBlock\n"));
+    if (!CPUMIsGuestInPagedProtectedModeEx(pCtx))
+    {
+        Log(("HWACCMR3EmulateIoBlock -> enabled\n"));
+        pVCpu->hwaccm.s.EmulateIoBlock.fEnabled         = true;
+        pVCpu->hwaccm.s.EmulateIoBlock.GCPtrFunctionEsp = pCtx->rsp;
+        pVCpu->hwaccm.s.EmulateIoBlock.cr0              = pCtx->cr0;
+        return VINF_EM_RESCHEDULE_REM;
+    }
+    return VINF_SUCCESS;
 }
 
@@ -1218,5 +1227,6 @@
 
     if (    RT_UNLIKELY(pVCpu->hwaccm.s.EmulateIoBlock.fEnabled)
-        &&  pCtx->rsp <= pVCpu->hwaccm.s.EmulateIoBlock.GCPtrFunctionEsp)
+        &&  pCtx->rsp <= pVCpu->hwaccm.s.EmulateIoBlock.GCPtrFunctionEsp
+        &&  pCtx->cr0 == pVCpu->hwaccm.s.EmulateIoBlock.cr0)
         return false;
 
Index: /trunk/src/VBox/VMM/HWACCMInternal.h
===================================================================
--- /trunk/src/VBox/VMM/HWACCMInternal.h	(revision 17294)
+++ /trunk/src/VBox/VMM/HWACCMInternal.h	(revision 17295)
@@ -558,4 +558,6 @@
         /** Esp at the start of the io code we wish to emulate in the recompiler. */
         RTGCPTR                 GCPtrFunctionEsp;
+
+        uint64_t                cr0;
     } EmulateIoBlock;
 
