Index: /trunk/src/VBox/VMM/Makefile.kmk
===================================================================
--- /trunk/src/VBox/VMM/Makefile.kmk	(revision 41830)
+++ /trunk/src/VBox/VMM/Makefile.kmk	(revision 41831)
@@ -432,5 +432,10 @@
   VMMRC_SOURCES += $(VMMRCImp_0_OUTDIR)/VMMRC.def
  endif
-
+ ifdef VBOX_WITH_IEM
+  VMMRC_SOURCES += \
+	VMMAll/IEMAll.cpp \
+	VMMAll/IEMAllAImpl.asm \
+	VMMAll/IEMAllAImplC.cpp
+ endif
 
  # the very last one.
@@ -532,4 +537,10 @@
 	VMMR0/VMMR0TripleFaultHackA.asm
  endif
+ ifdef VBOX_WITH_IEM
+  VMMR0_SOURCES += \
+	VMMAll/IEMAll.cpp \
+	VMMAll/IEMAllAImpl.asm \
+	VMMAll/IEMAllAImplC.cpp
+ endif
  VMMR0_SOURCES.amd64 = \
  	VMMR0/VMMR0JmpA-amd64.asm
Index: /trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/IEMAll.cpp	(revision 41830)
+++ /trunk/src/VBox/VMM/VMMAll/IEMAll.cpp	(revision 41831)
@@ -78,4 +78,5 @@
 #include <VBox/vmm/iem.h>
 #include <VBox/vmm/pgm.h>
+#include <internal/pgm.h>
 #include <VBox/vmm/iom.h>
 #include <VBox/vmm/em.h>
@@ -683,5 +684,5 @@
     {
         uint32_t GCPtrPC32 = pCtx->eip;
-        Assert(!(GCPtrPC32 & ~(uint32_t)UINT16_MAX) || pIemCpu->enmCpuMode == IEMMODE_32BIT);
+        AssertMsg(!(GCPtrPC32 & ~(uint32_t)UINT16_MAX) || pIemCpu->enmCpuMode == IEMMODE_32BIT, ("%04x:%RX64\n", pCtx->cs, pCtx->rip));
         if (GCPtrPC32 > pCtx->csHid.u32Limit)
             return iemRaiseSelectorBounds(pIemCpu, X86_SREG_CS, IEM_ACCESS_INSTRUCTION);
@@ -2159,5 +2160,5 @@
      * Extensive logging.
      */
-#ifdef LOG_ENABLED
+#if defined(LOG_ENABLED) && defined(IN_RING3)
     if (LogIs3Enabled())
     {
@@ -2530,5 +2531,5 @@
  *
  */
-#include <iprt/mem.h>
+//#include <iprt/mem.h>
 
 /**
@@ -2538,4 +2539,5 @@
 static void iemOpStubMsg2(PIEMCPU pIemCpu)
 {
+#if defined(LOG_ENABLED) && defined(IN_RING3)
     PVM     pVM   = IEMCPU_TO_VM(pIemCpu);
     PVMCPU  pVCpu = IEMCPU_TO_VMCPU(pIemCpu);
@@ -2574,4 +2576,7 @@
 
     RTAssertMsg2Weak("%s%s\n", szRegs, szInstr);
+#else
+    RTAssertMsg2Weak("cs:rip=%04x:%RX64\n", pIemCpu->CTX_SUFF(pCtx)->cs, pIemCpu->CTX_SUFF(pCtx)->rip);
+#endif
 }
 
@@ -3295,5 +3300,6 @@
     NOREF(pIemCpu);
 #else
-# error "Implement me"
+/** @todo RZ: FIXME */
+//# error "Implement me"
 #endif
 }
@@ -4409,8 +4415,21 @@
      */
     /** @todo need some better API. */
+#ifdef IN_RING3
     return PGMR3PhysTlbGCPhys2Ptr(IEMCPU_TO_VM(pIemCpu),
                                   GCPhysMem,
                                   RT_BOOL(fAccess & IEM_ACCESS_TYPE_WRITE),
                                   ppvMem);
+#else
+//# error "Implement me"
+    if (fAccess & IEM_ACCESS_TYPE_WRITE)
+        return PGMPhysGCPhys2CCPtr(IEMCPU_TO_VM(pIemCpu),
+                                   GCPhysMem,
+                                   ppvMem,
+                                   /** @todo pLock */ NULL);
+    return PGMPhysGCPhys2CCPtrReadOnly(IEMCPU_TO_VM(pIemCpu),
+                                       GCPhysMem,
+                                       (void const **)ppvMem,
+                                       /** @todo pLock */ NULL);
+#endif
 }
 
@@ -7835,4 +7854,5 @@
 #ifdef LOG_ENABLED
     PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx);
+# ifdef IN_RING3
     if (LogIs2Enabled())
     {
@@ -7861,4 +7881,5 @@
     }
     else
+# endif
         LogFlow(("IEMExecOne: cs:rip=%04x:%08RX64 ss:rsp=%04x:%08RX64 EFL=%06x\n",
                  pCtx->cs, pCtx->rip, pCtx->ss, pCtx->rsp, pCtx->eflags.u));
@@ -7916,5 +7937,6 @@
 
     VBOXSTRICTRC rcStrict;
-    if (cbOpcodeBytes)
+    if (   cbOpcodeBytes
+        && pCtx->rip == OpcodeBytesPC)
     {
         iemInitDecoder(pIemCpu);
