Index: trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/IEMAll.cpp	(revision 36831)
+++ trunk/src/VBox/VMM/VMMAll/IEMAll.cpp	(revision 36833)
@@ -4677,5 +4677,5 @@
 
 /**
- * Implements 'mov SReg, r/m'.
+ * Common worker for 'pop SReg', 'mov SReg, GReg' and 'lXs GReg, reg/mem'.
  *
  * @param   iSegReg     The segment register number (valid).
@@ -4710,6 +4710,4 @@
 
         iemRegAddToRip(pIemCpu, cbInstr);
-        if (iSegReg == X86_SREG_SS)
-            EMSetInhibitInterruptsPC(IEMCPU_TO_VMCPU(pIemCpu), pCtx->rip);
         return VINF_SUCCESS;
     }
@@ -4739,5 +4737,4 @@
             *pSel = uSel;
             iemRegAddToRip(pIemCpu, cbInstr);
-            EMSetInhibitInterruptsPC(IEMCPU_TO_VMCPU(pIemCpu), pCtx->rip);
             return VINF_SUCCESS;
         }
@@ -4881,7 +4878,86 @@
 
     iemRegAddToRip(pIemCpu, cbInstr);
-    if (iSegReg == X86_SREG_SS)
-        EMSetInhibitInterruptsPC(IEMCPU_TO_VMCPU(pIemCpu), pCtx->rip);
     return VINF_SUCCESS;
+}
+
+
+/**
+ * Implements 'mov SReg, r/m'.
+ *
+ * @param   iSegReg     The segment register number (valid).
+ * @param   uSel        The new selector value.
+ */
+IEM_CIMPL_DEF_2(iemCImpl_load_SReg, uint8_t, iSegReg, uint16_t, uSel)
+{
+    VBOXSTRICTRC rcStrict = IEM_CIMPL_CALL_2(iemCImpl_LoadSReg, iSegReg, uSel);
+    if (rcStrict == VINF_SUCCESS)
+    {
+        if (iSegReg == X86_SREG_SS)
+        {
+            PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx);
+            EMSetInhibitInterruptsPC(IEMCPU_TO_VMCPU(pIemCpu), pCtx->rip);
+        }
+    }
+    return rcStrict;
+}
+
+
+/**
+ * Implements 'pop SReg'.
+ *
+ * @param   iSegReg         The segment register number (valid).
+ * @param   enmEffOpSize    The efficient operand size (valid).
+ */
+IEM_CIMPL_DEF_2(iemOpCImpl_pop_Sreg, uint8_t, iSegReg, IEMMODE, enmEffOpSize)
+{
+    PCPUMCTX        pCtx = pIemCpu->CTX_SUFF(pCtx);
+    VBOXSTRICTRC    rcStrict;
+
+    /*
+     * Read the selector off the stack and join paths with mov ss, reg.
+     */
+    RTUINT64U TmpRsp;
+    TmpRsp.u = pCtx->rsp;
+    switch (enmEffOpSize)
+    {
+        case IEMMODE_16BIT:
+        {
+            uint16_t uSel;
+            rcStrict = iemMemStackPopU16Ex(pIemCpu, &uSel, &TmpRsp);
+            if (rcStrict == VINF_SUCCESS)
+                rcStrict = IEM_CIMPL_CALL_2(iemCImpl_LoadSReg, iSegReg, uSel);
+            break;
+        }
+
+        case IEMMODE_32BIT:
+        {
+            uint32_t u32Value;
+            rcStrict = iemMemStackPopU32Ex(pIemCpu, &u32Value, &TmpRsp);
+            if (rcStrict == VINF_SUCCESS)
+                rcStrict = IEM_CIMPL_CALL_2(iemCImpl_LoadSReg, iSegReg, (uint16_t)u32Value);
+            break;
+        }
+
+        case IEMMODE_64BIT:
+        {
+            uint64_t u64Value;
+            rcStrict = iemMemStackPopU64Ex(pIemCpu, &u64Value, &TmpRsp);
+            if (rcStrict == VINF_SUCCESS)
+                rcStrict = IEM_CIMPL_CALL_2(iemCImpl_LoadSReg, iSegReg, (uint16_t)u64Value);
+            break;
+        }
+        IEM_NOT_REACHED_DEFAULT_CASE_RET();
+    }
+
+    /*
+     * Commit the stack on success.
+     */
+    if (rcStrict == VINF_SUCCESS)
+    {
+        pCtx->rsp = TmpRsp.u;
+        if (iSegReg == X86_SREG_SS)
+            EMSetInhibitInterruptsPC(IEMCPU_TO_VMCPU(pIemCpu), pCtx->rip);
+    }
+    return rcStrict;
 }
 
@@ -4923,60 +4999,4 @@
     }
 
-    return rcStrict;
-}
-
-
-/**
- * Implements 'pop SReg'.
- *
- * @param   iSegReg         The segment register number (valid).
- * @param   enmEffOpSize    The efficient operand size (valid).
- */
-IEM_CIMPL_DEF_2(iemOpCImpl_pop_Sreg, uint8_t, iSegReg, IEMMODE, enmEffOpSize)
-{
-    PCPUMCTX        pCtx = pIemCpu->CTX_SUFF(pCtx);
-    VBOXSTRICTRC    rcStrict;
-
-    /*
-     * Read the selector off the stack and join paths with mov ss, reg.
-     */
-    RTUINT64U TmpRsp;
-    TmpRsp.u = pCtx->rsp;
-    switch (enmEffOpSize)
-    {
-        case IEMMODE_16BIT:
-        {
-            uint16_t uSel;
-            rcStrict = iemMemStackPopU16Ex(pIemCpu, &uSel, &TmpRsp);
-            if (rcStrict == VINF_SUCCESS)
-                rcStrict = IEM_CIMPL_CALL_2(iemCImpl_LoadSReg, iSegReg, uSel);
-            break;
-        }
-
-        case IEMMODE_32BIT:
-        {
-            uint32_t u32Value;
-            rcStrict = iemMemStackPopU32Ex(pIemCpu, &u32Value, &TmpRsp);
-            if (rcStrict == VINF_SUCCESS)
-                rcStrict = IEM_CIMPL_CALL_2(iemCImpl_LoadSReg, iSegReg, (uint16_t)u32Value);
-            break;
-        }
-
-        case IEMMODE_64BIT:
-        {
-            uint64_t u64Value;
-            rcStrict = iemMemStackPopU64Ex(pIemCpu, &u64Value, &TmpRsp);
-            if (rcStrict == VINF_SUCCESS)
-                rcStrict = IEM_CIMPL_CALL_2(iemCImpl_LoadSReg, iSegReg, (uint16_t)u64Value);
-            break;
-        }
-        IEM_NOT_REACHED_DEFAULT_CASE_RET();
-    }
-
-    /*
-     * Commit the stack on success.
-     */
-    if (rcStrict == VINF_SUCCESS)
-        pCtx->rsp = TmpRsp.u;
     return rcStrict;
 }
Index: trunk/src/VBox/VMM/VMMAll/IEMAllCImplStrInstr.cpp.h
===================================================================
--- trunk/src/VBox/VMM/VMMAll/IEMAllCImplStrInstr.cpp.h	(revision 36831)
+++ trunk/src/VBox/VMM/VMMAll/IEMAllCImplStrInstr.cpp.h	(revision 36833)
@@ -66,5 +66,8 @@
     ADDR_TYPE       uCounterReg = pCtx->ADDR_rCX;
     if (uCounterReg == 0)
+    {
+        iemRegAddToRip(pIemCpu, cbInstr);
         return VINF_SUCCESS;
+    }
 
     PCCPUMSELREGHID pSrc1Hid = iemSRegGetHid(pIemCpu, iEffSeg);
@@ -218,5 +221,8 @@
     ADDR_TYPE       uCounterReg = pCtx->ADDR_rCX;
     if (uCounterReg == 0)
+    {
+        iemRegAddToRip(pIemCpu, cbInstr);
         return VINF_SUCCESS;
+    }
 
     PCCPUMSELREGHID pSrc1Hid = iemSRegGetHid(pIemCpu, iEffSeg);
@@ -370,5 +376,8 @@
     ADDR_TYPE       uCounterReg = pCtx->ADDR_rCX;
     if (uCounterReg == 0)
+    {
+        iemRegAddToRip(pIemCpu, cbInstr);
         return VINF_SUCCESS;
+    }
 
     VBOXSTRICTRC rcStrict = iemMemSegCheckReadAccessEx(pIemCpu, &pCtx->esHid, X86_SREG_ES);
@@ -495,5 +504,8 @@
     ADDR_TYPE       uCounterReg = pCtx->ADDR_rCX;
     if (uCounterReg == 0)
+    {
+        iemRegAddToRip(pIemCpu, cbInstr);
         return VINF_SUCCESS;
+    }
 
     VBOXSTRICTRC rcStrict = iemMemSegCheckReadAccessEx(pIemCpu, &pCtx->esHid, X86_SREG_ES);
@@ -622,5 +634,8 @@
     ADDR_TYPE       uCounterReg = pCtx->ADDR_rCX;
     if (uCounterReg == 0)
+    {
+        iemRegAddToRip(pIemCpu, cbInstr);
         return VINF_SUCCESS;
+    }
 
     PCCPUMSELREGHID pSrcHid = iemSRegGetHid(pIemCpu, iEffSeg);
@@ -734,6 +749,4 @@
     if (rcStrict == VINF_SUCCESS)
         iemRegAddToRip(pIemCpu, cbInstr);
-    else
-        AssertFailed();
 
     return rcStrict;
@@ -753,5 +766,8 @@
     ADDR_TYPE       uCounterReg = pCtx->ADDR_rCX;
     if (uCounterReg == 0)
+    {
+        iemRegAddToRip(pIemCpu, cbInstr);
         return VINF_SUCCESS;
+    }
 
     VBOXSTRICTRC rcStrict = iemMemSegCheckWriteAccessEx(pIemCpu, &pCtx->esHid, X86_SREG_ES);
@@ -866,5 +882,8 @@
     ADDR_TYPE       uCounterReg = pCtx->ADDR_rCX;
     if (uCounterReg == 0)
+    {
+        iemRegAddToRip(pIemCpu, cbInstr);
         return VINF_SUCCESS;
+    }
 
     PCCPUMSELREGHID pSrcHid = iemSRegGetHid(pIemCpu, iEffSeg);
@@ -1038,5 +1057,8 @@
     ADDR_TYPE       uCounterReg = pCtx->ADDR_rCX;
     if (uCounterReg == 0)
+    {
+        iemRegAddToRip(pIemCpu, cbInstr);
         return VINF_SUCCESS;
+    }
 
     rcStrict = iemMemSegCheckWriteAccessEx(pIemCpu, &pCtx->esHid, X86_SREG_ES);
@@ -1232,5 +1254,8 @@
     ADDR_TYPE       uCounterReg = pCtx->ADDR_rCX;
     if (uCounterReg == 0)
+    {
+        iemRegAddToRip(pIemCpu, cbInstr);
         return VINF_SUCCESS;
+    }
 
     PCCPUMSELREGHID pHid = iemSRegGetHid(pIemCpu, iEffSeg);
Index: trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
===================================================================
--- trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h	(revision 36831)
+++ trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h	(revision 36833)
@@ -5993,5 +5993,5 @@
         IEM_MC_ARG(uint16_t,      u16Value,          1);
         IEM_MC_FETCH_GREG_U16(u16Value, (bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB);
-        IEM_MC_CALL_CIMPL_2(iemCImpl_LoadSReg, iSRegArg, u16Value);
+        IEM_MC_CALL_CIMPL_2(iemCImpl_load_SReg, iSRegArg, u16Value);
         IEM_MC_END();
     }
@@ -6008,5 +6008,5 @@
         IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm);
         IEM_MC_FETCH_MEM_U16(u16Value, pIemCpu->iEffSeg, GCPtrEffDst);
-        IEM_MC_CALL_CIMPL_2(iemCImpl_LoadSReg, iSRegArg, u16Value);
+        IEM_MC_CALL_CIMPL_2(iemCImpl_load_SReg, iSRegArg, u16Value);
         IEM_MC_END();
     }
@@ -6017,4 +6017,5 @@
 /** Opcode 0x8f. */
 FNIEMOP_STUB(iemOp_pop_Ev);
+/** @todo DO ME NEXT, PLEEEASE. */
 
 
