Index: trunk/src/VBox/VMM/VMMAll/EMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/EMAll.cpp	(revision 4417)
+++ trunk/src/VBox/VMM/VMMAll/EMAll.cpp	(revision 4418)
@@ -281,7 +281,6 @@
 DECLINLINE(int) emRamRead(PVM pVM, void *pDest, RTGCPTR GCSrc, uint32_t cb)
 {
-    int rc;
-#ifdef IN_GC
-    rc = MMGCRamRead(pVM, pDest, GCSrc, cb);
+#ifdef IN_GC
+    int rc = MMGCRamRead(pVM, pDest, GCSrc, cb);
     if (RT_LIKELY(rc != VERR_ACCESS_DENIED))
         return rc;
@@ -291,5 +290,4 @@
      * instruction and it either flushed the TLB or the CPU reused it.
      */
-#endif
     RTGCPHYS    GCPhys;
     RTGCUINTPTR offset;
@@ -301,4 +299,7 @@
     PGMPhysRead(pVM, GCPhys + offset, pDest, cb);
     return VINF_SUCCESS;
+#else
+    return PGMPhysReadGCPtrSafe(pVM, pDest, GCSrc, cb);
+#endif
 }
 
@@ -329,14 +330,5 @@
 
 #else
-
-    int         rc;
-    RTGCPHYS    GCPhys;
-    RTGCUINTPTR offset;
-
-    offset = GCDest & PAGE_OFFSET_MASK;
-    rc = PGMPhysGCPtr2GCPhys(pVM, GCDest, &GCPhys);
-    AssertRCReturn(rc, rc);
-    PGMPhysWrite(pVM, GCPhys + offset, pSrc, cb);
-    return VINF_SUCCESS;
+    return PGMPhysWriteGCPtrSafe(pVM, GCDest, pSrc, cb);
 #endif
 }
@@ -701,10 +693,10 @@
 #ifdef IN_GC
                 /* Safety check (in theory it could cross a page boundary and fault there though) */
-                AssertMsgReturn(pParam1 == pvFault, ("eip=%VGv, pParam1=%VGv pvFault=%VGv\n", pRegFrame->eip, pParam1, pvFault), VERR_EM_INTERPRETER);
+//                AssertMsgReturn(pParam1 == pvFault, ("eip=%VGv, pParam1=%VGv pvFault=%VGv\n", pRegFrame->eip, pParam1, pvFault), VERR_EM_INTERPRETER);
 #endif
                 rc = emRamRead(pVM,  &valpar1, pParam1, param1.size);
                 if (VBOX_FAILURE(rc))
                 {
-                    AssertMsgFailed(("emRamRead %VGv size=%d failed with %Vrc\n", pParam1, param1.size, rc));
+//                    AssertMsgFailed(("emRamRead %VGv size=%d failed with %Vrc\n", pParam1, param1.size, rc));
                     return VERR_EM_INTERPRETER;
                 }
@@ -1025,5 +1017,5 @@
 #ifdef IN_GC
             /* Safety check (in theory it could cross a page boundary and fault there though) */
-            AssertMsgReturn(pDest == pvFault, ("eip=%VGv pDest=%VGv pvFault=%VGv\n", pRegFrame->eip, pDest, pvFault), VERR_EM_INTERPRETER);
+//            AssertMsgReturn(pDest == pvFault, ("eip=%VGv pDest=%VGv pvFault=%VGv\n", pRegFrame->eip, pDest, pvFault), VERR_EM_INTERPRETER);
 #endif
             rc = emRamWrite(pVM, pDest, &val32, param2.size);
@@ -1124,5 +1116,5 @@
 
                 /* Safety check (in theory it could cross a page boundary and fault there though) */
-                AssertMsgReturn(pParam1 == pvFault, ("eip=%VGv pParam1=%VGv pvFault=%VGv\n", pRegFrame->eip, pParam1, pvFault), VERR_EM_INTERPRETER);
+//                AssertMsgReturn(pParam1 == pvFault, ("eip=%VGv pParam1=%VGv pvFault=%VGv\n", pRegFrame->eip, pParam1, pvFault), VERR_EM_INTERPRETER);
 
 #ifdef VBOX_STRICT
@@ -1262,5 +1254,4 @@
     Log(("PGMInvalidatePage %VGv returned %VGv (%d)\n", pAddrGC, rc, rc));
     Assert(rc == VERR_REM_FLUSHED_PAGES_OVERFLOW);
-
     /** @todo r=bird: we shouldn't ignore returns codes like this... I'm 99% sure the error is fatal. */
     return VERR_EM_INTERPRETER;
Index: trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp	(revision 4417)
+++ trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp	(revision 4418)
@@ -461,15 +461,5 @@
     return MMGCRamReadNoTrapHandler(pDest, GCSrc, cb);
 #else
-    int         rc;
-    RTGCPHYS    GCPhys;
-    RTGCUINTPTR offset;
-
-    offset = GCSrc & PAGE_OFFSET_MASK;
-
-    /** @todo optimize the loop; no need to convert the address all the time */
-    rc = PGMPhysGCPtr2GCPhys(pVM, GCSrc, &GCPhys);
-    AssertRCReturn(rc, rc);
-    PGMPhysRead(pVM, GCPhys + offset, pDest, cb);
-    return VINF_SUCCESS;
+    return PGMPhysReadGCPtrSafe(pVM, pDest, GCSrc, cb);
 #endif
 }
@@ -480,14 +470,5 @@
     return MMGCRamWriteNoTrapHandler(GCDest, pSrc, cb);
 #else
-    int         rc;
-    RTGCPHYS    GCPhys;
-    RTGCUINTPTR offset;
-
-    /** @todo optimize the loop; no need to convert the address all the time */
-    offset = GCDest & PAGE_OFFSET_MASK;
-    rc = PGMPhysGCPtr2GCPhys(pVM, GCDest, &GCPhys);
-    AssertRCReturn(rc, rc);
-    PGMPhysWrite(pVM, GCPhys + offset, pSrc, cb);
-    return VINF_SUCCESS;
+    return PGMPhysWriteGCPtrSafe(pVM, GCDest, pSrc, cb);
 #endif
 }
