Index: /trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp	(revision 73165)
+++ /trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp	(revision 73166)
@@ -7026,7 +7026,11 @@
             Assert(!IoExitInfo.n.u1Rep);
 
+            uint8_t const cbInstr = pVmcb->ctrl.u64ExitInfo2 - pCtx->rip;
             if (IoExitInfo.n.u1Type == SVM_IOIO_WRITE)
             {
                 rcStrict = IOMIOPortWrite(pVM, pVCpu, IoExitInfo.n.u16Port, pCtx->eax & uAndVal, cbValue);
+                if (    rcStrict == VINF_IOM_R3_IOPORT_WRITE
+                    && !pCtx->eflags.Bits.u1TF)
+                    rcStrict = EMRZSetPendingIoPortWrite(pVCpu, IoExitInfo.n.u16Port, cbInstr, cbValue, pCtx->eax & uAndVal);
                 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitIOWrite);
             }
@@ -7041,9 +7045,7 @@
                     pCtx->eax = (pCtx->eax & ~uAndVal) | (u32Val & uAndVal);
                 }
-                else if (rcStrict == VINF_IOM_R3_IOPORT_READ)
-                {
-                    HMR0SavePendingIOPortRead(pVCpu, pVCpu->cpum.GstCtx.rip, pVmcb->ctrl.u64ExitInfo2, IoExitInfo.n.u16Port,
-                                              uAndVal, cbValue);
-                }
+                else if (    rcStrict == VINF_IOM_R3_IOPORT_READ
+                         && !pCtx->eflags.Bits.u1TF)
+                    rcStrict = EMRZSetPendingIoPortRead(pVCpu, IoExitInfo.n.u16Port, cbInstr, cbValue);
 
                 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitIORead);
@@ -7102,7 +7104,10 @@
 
 #ifdef VBOX_STRICT
-        if (rcStrict == VINF_IOM_R3_IOPORT_READ)
+        if (   rcStrict == VINF_IOM_R3_IOPORT_READ
+            || rcStrict == VINF_EM_PENDING_R3_IOPORT_READ)
             Assert(IoExitInfo.n.u1Type == SVM_IOIO_READ);
-        else if (rcStrict == VINF_IOM_R3_IOPORT_WRITE || rcStrict == VINF_IOM_R3_IOPORT_COMMIT_WRITE)
+        else if (   rcStrict == VINF_IOM_R3_IOPORT_WRITE
+                 || rcStrict == VINF_IOM_R3_IOPORT_COMMIT_WRITE
+                 || rcStrict == VINF_EM_PENDING_R3_IOPORT_WRITE)
             Assert(IoExitInfo.n.u1Type == SVM_IOIO_WRITE);
         else
