Index: trunk/src/VBox/VMM/VMMAll/EMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/EMAll.cpp	(revision 108156)
+++ trunk/src/VBox/VMM/VMMAll/EMAll.cpp	(revision 108186)
@@ -981,5 +981,5 @@
 #endif
 
-    VBOXSTRICTRC rc = IEMExecOneBypassEx(pVCpu, NULL /*pcbWritten*/);
+    VBOXSTRICTRC rc = IEMExecOneBypass(pVCpu);
     if (RT_UNLIKELY(   rc == VERR_IEM_ASPECT_NOT_IMPLEMENTED
                     || rc == VERR_IEM_INSTR_NOT_IMPLEMENTED))
Index: trunk/src/VBox/VMM/VMMAll/IEMAll-armv8.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/IEMAll-armv8.cpp	(revision 108156)
+++ trunk/src/VBox/VMM/VMMAll/IEMAll-armv8.cpp	(revision 108186)
@@ -49,6 +49,7 @@
 *********************************************************************************************************************************/
 
-VMMDECL(VBOXSTRICTRC) IEMExecForExits(PVMCPUCC pVCpu, uint32_t fWillExit, uint32_t cMinInstructions, uint32_t cMaxInstructions,
-                                      uint32_t cMaxInstructionsWithoutExits, PIEMEXECFOREXITSTATS pStats)
+VMM_INT_DECL(VBOXSTRICTRC)
+IEMExecForExits(PVMCPUCC pVCpu, uint32_t fWillExit, uint32_t cMinInstructions, uint32_t cMaxInstructions,
+                uint32_t cMaxInstructionsWithoutExits, PIEMEXECFOREXITSTATS pStats)
 {
     AssertReleaseFailed();
@@ -59,5 +60,5 @@
 
 
-VMMDECL(VBOXSTRICTRC) IEMExecLots(PVMCPUCC pVCpu, uint32_t cMaxInstructions, uint32_t cPollRate, uint32_t *pcInstructions)
+VMM_INT_DECL(VBOXSTRICTRC) IEMExecLots(PVMCPUCC pVCpu, uint32_t cMaxInstructions, uint32_t cPollRate, uint32_t *pcInstructions)
 {
     AssertReleaseFailed();
@@ -67,5 +68,5 @@
 
 
-VMMDECL(VBOXSTRICTRC) IEMExecOne(PVMCPUCC pVCpu)
+VMM_INT_DECL(VBOXSTRICTRC) IEMExecOne(PVMCPUCC pVCpu)
 {
     AssertReleaseFailed();
@@ -75,6 +76,6 @@
 
 
-VMMDECL(VBOXSTRICTRC) IEMExecOneWithPrefetchedByPC(PVMCPUCC pVCpu, uint64_t OpcodeBytesPC,
-                                                   const void *pvOpcodeBytes, size_t cbOpcodeBytes)
+VMM_INT_DECL(VBOXSTRICTRC) IEMExecOneWithPrefetchedByPC(PVMCPUCC pVCpu, uint64_t OpcodeBytesPC,
+                                                        const void *pvOpcodeBytes, size_t cbOpcodeBytes)
 {
     AssertReleaseFailed();
@@ -84,14 +85,14 @@
 
 
-VMMDECL(VBOXSTRICTRC) IEMExecOneBypassEx(PVMCPUCC pVCpu, uint32_t *pcbWritten)
+VMM_INT_DECL(VBOXSTRICTRC) IEMExecOneBypass(PVMCPUCC pVCpu)
 {
     AssertReleaseFailed();
-    RT_NOREF(pVCpu, pcbWritten);
+    RT_NOREF(pVCpu);
     return VERR_NOT_IMPLEMENTED;
 }
 
 
-VMMDECL(VBOXSTRICTRC) IEMExecOneBypassWithPrefetchedByPC(PVMCPUCC pVCpu, uint64_t OpcodeBytesPC,
-                                                         const void *pvOpcodeBytes, size_t cbOpcodeBytes)
+VMM_INT_DECL(VBOXSTRICTRC) IEMExecOneBypassWithPrefetchedByPC(PVMCPUCC pVCpu, uint64_t OpcodeBytesPC,
+                                                              const void *pvOpcodeBytes, size_t cbOpcodeBytes)
 {
     AssertReleaseFailed();
@@ -101,5 +102,5 @@
 
 
-VMMDECL(VBOXSTRICTRC) IEMInjectTrpmEvent(PVMCPUCC pVCpu)
+VMM_INT_DECL(VBOXSTRICTRC) IEMInjectTrpmEvent(PVMCPUCC pVCpu)
 {
     AssertReleaseFailed();
Index: trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/IEMAll.cpp	(revision 108156)
+++ trunk/src/VBox/VMM/VMMAll/IEMAll.cpp	(revision 108186)
@@ -6121,19 +6121,4 @@
 #undef  LOG_GROUP
 #define LOG_GROUP LOG_GROUP_IEM_MEM
-
-/**
- * Updates the IEMCPU::cbWritten counter if applicable.
- *
- * @param   pVCpu               The cross context virtual CPU structure of the calling thread.
- * @param   fAccess             The access being accounted for.
- * @param   cbMem               The access size.
- */
-DECL_FORCE_INLINE(void) iemMemUpdateWrittenCounter(PVMCPUCC pVCpu, uint32_t fAccess, size_t cbMem)
-{
-    if (   (fAccess & (IEM_ACCESS_WHAT_MASK | IEM_ACCESS_TYPE_WRITE)) == (IEM_ACCESS_WHAT_STACK | IEM_ACCESS_TYPE_WRITE)
-        || (fAccess & (IEM_ACCESS_WHAT_MASK | IEM_ACCESS_TYPE_WRITE)) == (IEM_ACCESS_WHAT_DATA  | IEM_ACCESS_TYPE_WRITE) )
-        pVCpu->iem.s.cbWritten += (uint32_t)cbMem;
-}
-
 
 /**
@@ -6750,5 +6735,4 @@
     pVCpu->iem.s.cActiveMappings++;
 
-    iemMemUpdateWrittenCounter(pVCpu, fAccess, cbMem);
     *ppvMem = pbBuf;
     *pbUnmapInfo = iMemMap | 0x08 | ((fAccess & IEM_ACCESS_TYPE_MASK) << 4);
@@ -6839,5 +6823,4 @@
     pVCpu->iem.s.cActiveMappings++;
 
-    iemMemUpdateWrittenCounter(pVCpu, fAccess, cbMem);
     *ppvMem = pbBuf;
     *pbUnmapInfo = iMemMap | 0x08 | ((fAccess & IEM_ACCESS_TYPE_MASK) << 4);
@@ -7214,5 +7197,4 @@
     pVCpu->iem.s.cActiveMappings += 1;
 
-    iemMemUpdateWrittenCounter(pVCpu, fAccess, cbMem);
     *ppvMem = pvMem;
     *pbUnmapInfo = iMemMap | 0x08 | ((fAccess & IEM_ACCESS_TYPE_MASK) << 4);
@@ -7710,6 +7692,4 @@
     pVCpu->iem.s.iNextMapping = iMemMap + 1;
     pVCpu->iem.s.cActiveMappings++;
-
-    iemMemUpdateWrittenCounter(pVCpu, fAccess, cbMem);
 
     *pbUnmapInfo = iMemMap | 0x08 | ((fAccess & IEM_ACCESS_TYPE_MASK) << 4);
@@ -9709,6 +9689,6 @@
 
 /**
- * The actual code execution bits of IEMExecOne, IEMExecOneEx, and
- * IEMExecOneWithPrefetchedByPC.
+ * The actual code execution bits of IEMExecOne, IEMExecOneWithPrefetchedByPC,
+ * IEMExecOneBypass and friends.
  *
  * Similar code is found in IEMExecLots.
@@ -9846,5 +9826,5 @@
  * @param   pVCpu       The cross context virtual CPU structure of the calling EMT.
  */
-VMMDECL(VBOXSTRICTRC) IEMExecOne(PVMCPUCC pVCpu)
+VMM_INT_DECL(VBOXSTRICTRC) IEMExecOne(PVMCPUCC pVCpu)
 {
     AssertCompile(sizeof(pVCpu->iem.s) <= sizeof(pVCpu->iem.padding)); /* (tstVMStruct can't do it's job w/o instruction stats) */
@@ -9869,23 +9849,6 @@
 
 
-VMMDECL(VBOXSTRICTRC) IEMExecOneEx(PVMCPUCC pVCpu, uint32_t *pcbWritten)
-{
-    uint32_t const cbOldWritten = pVCpu->iem.s.cbWritten;
-    VBOXSTRICTRC rcStrict = iemInitDecoderAndPrefetchOpcodes(pVCpu, 0 /*fExecOpts*/);
-    if (rcStrict == VINF_SUCCESS)
-    {
-        rcStrict = iemExecOneInner(pVCpu, true, "IEMExecOneEx");
-        if (pcbWritten)
-            *pcbWritten = pVCpu->iem.s.cbWritten - cbOldWritten;
-    }
-    else if (pVCpu->iem.s.cActiveMappings > 0)
-        iemMemRollback(pVCpu);
-
-    return rcStrict;
-}
-
-
-VMMDECL(VBOXSTRICTRC) IEMExecOneWithPrefetchedByPC(PVMCPUCC pVCpu, uint64_t OpcodeBytesPC,
-                                                   const void *pvOpcodeBytes, size_t cbOpcodeBytes)
+VMM_INT_DECL(VBOXSTRICTRC) IEMExecOneWithPrefetchedByPC(PVMCPUCC pVCpu, uint64_t OpcodeBytesPC,
+                                                        const void *pvOpcodeBytes, size_t cbOpcodeBytes)
 {
     VBOXSTRICTRC rcStrict;
@@ -9918,14 +9881,9 @@
 
 
-VMMDECL(VBOXSTRICTRC) IEMExecOneBypassEx(PVMCPUCC pVCpu, uint32_t *pcbWritten)
-{
-    uint32_t const cbOldWritten = pVCpu->iem.s.cbWritten;
+VMM_INT_DECL(VBOXSTRICTRC) IEMExecOneBypass(PVMCPUCC pVCpu)
+{
     VBOXSTRICTRC rcStrict = iemInitDecoderAndPrefetchOpcodes(pVCpu, IEM_F_BYPASS_HANDLERS);
     if (rcStrict == VINF_SUCCESS)
-    {
-        rcStrict = iemExecOneInner(pVCpu, false, "IEMExecOneBypassEx");
-        if (pcbWritten)
-            *pcbWritten = pVCpu->iem.s.cbWritten - cbOldWritten;
-    }
+        rcStrict = iemExecOneInner(pVCpu, false, "IEMExecOneBypass");
     else if (pVCpu->iem.s.cActiveMappings > 0)
         iemMemRollback(pVCpu);
@@ -9935,6 +9893,6 @@
 
 
-VMMDECL(VBOXSTRICTRC) IEMExecOneBypassWithPrefetchedByPC(PVMCPUCC pVCpu, uint64_t OpcodeBytesPC,
-                                                         const void *pvOpcodeBytes, size_t cbOpcodeBytes)
+VMM_INT_DECL(VBOXSTRICTRC) IEMExecOneBypassWithPrefetchedByPC(PVMCPUCC pVCpu, uint64_t OpcodeBytesPC,
+                                                              const void *pvOpcodeBytes, size_t cbOpcodeBytes)
 {
     VBOXSTRICTRC rcStrict;
@@ -9977,5 +9935,5 @@
  * @param   pVCpu   The cross context virtual CPU structure of the calling EMT.
  */
-VMMDECL(VBOXSTRICTRC) IEMExecOneIgnoreLock(PVMCPUCC pVCpu)
+VMM_INT_DECL(VBOXSTRICTRC) IEMExecOneIgnoreLock(PVMCPUCC pVCpu)
 {
     /*
@@ -10052,5 +10010,5 @@
 
 
-VMMDECL(VBOXSTRICTRC) IEMExecLots(PVMCPUCC pVCpu, uint32_t cMaxInstructions, uint32_t cPollRate, uint32_t *pcInstructions)
+VMM_INT_DECL(VBOXSTRICTRC) IEMExecLots(PVMCPUCC pVCpu, uint32_t cMaxInstructions, uint32_t cPollRate, uint32_t *pcInstructions)
 {
     uint32_t const cInstructionsAtStart = pVCpu->iem.s.cInstructions;
@@ -10223,6 +10181,7 @@
  * @param   pStats              Where to return statistics.
  */
-VMMDECL(VBOXSTRICTRC) IEMExecForExits(PVMCPUCC pVCpu, uint32_t fWillExit, uint32_t cMinInstructions, uint32_t cMaxInstructions,
-                                      uint32_t cMaxInstructionsWithoutExits, PIEMEXECFOREXITSTATS pStats)
+VMM_INT_DECL(VBOXSTRICTRC)
+IEMExecForExits(PVMCPUCC pVCpu, uint32_t fWillExit, uint32_t cMinInstructions, uint32_t cMaxInstructions,
+                uint32_t cMaxInstructionsWithoutExits, PIEMEXECFOREXITSTATS pStats)
 {
     NOREF(fWillExit); /** @todo define flexible exit crits */
@@ -10470,5 +10429,5 @@
  * @param   pVCpu               The cross context virtual CPU structure.
  */
-VMMDECL(VBOXSTRICTRC) IEMInjectTrpmEvent(PVMCPUCC pVCpu)
+VMM_INT_DECL(VBOXSTRICTRC) IEMInjectTrpmEvent(PVMCPUCC pVCpu)
 {
 #ifndef IEM_IMPLEMENTS_TASKSWITCH
