VirtualBox

Changeset 4418 in vbox for trunk


Ignore:
Timestamp:
Aug 29, 2007 9:16:39 AM (17 years ago)
Author:
vboxsync
Message:

Reapplied 23986

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/EMAll.cpp

    r4416 r4418  
    281281DECLINLINE(int) emRamRead(PVM pVM, void *pDest, RTGCPTR GCSrc, uint32_t cb)
    282282{
    283     int rc;
    284 #ifdef IN_GC
    285     rc = MMGCRamRead(pVM, pDest, GCSrc, cb);
     283#ifdef IN_GC
     284    int rc = MMGCRamRead(pVM, pDest, GCSrc, cb);
    286285    if (RT_LIKELY(rc != VERR_ACCESS_DENIED))
    287286        return rc;
     
    291290     * instruction and it either flushed the TLB or the CPU reused it.
    292291     */
    293 #endif
    294292    RTGCPHYS    GCPhys;
    295293    RTGCUINTPTR offset;
     
    301299    PGMPhysRead(pVM, GCPhys + offset, pDest, cb);
    302300    return VINF_SUCCESS;
     301#else
     302    return PGMPhysReadGCPtrSafe(pVM, pDest, GCSrc, cb);
     303#endif
    303304}
    304305
     
    329330
    330331#else
    331 
    332     int         rc;
    333     RTGCPHYS    GCPhys;
    334     RTGCUINTPTR offset;
    335 
    336     offset = GCDest & PAGE_OFFSET_MASK;
    337     rc = PGMPhysGCPtr2GCPhys(pVM, GCDest, &GCPhys);
    338     AssertRCReturn(rc, rc);
    339     PGMPhysWrite(pVM, GCPhys + offset, pSrc, cb);
    340     return VINF_SUCCESS;
     332    return PGMPhysWriteGCPtrSafe(pVM, GCDest, pSrc, cb);
    341333#endif
    342334}
     
    701693#ifdef IN_GC
    702694                /* Safety check (in theory it could cross a page boundary and fault there though) */
    703                 AssertMsgReturn(pParam1 == pvFault, ("eip=%VGv, pParam1=%VGv pvFault=%VGv\n", pRegFrame->eip, pParam1, pvFault), VERR_EM_INTERPRETER);
     695//                AssertMsgReturn(pParam1 == pvFault, ("eip=%VGv, pParam1=%VGv pvFault=%VGv\n", pRegFrame->eip, pParam1, pvFault), VERR_EM_INTERPRETER);
    704696#endif
    705697                rc = emRamRead(pVM,  &valpar1, pParam1, param1.size);
    706698                if (VBOX_FAILURE(rc))
    707699                {
    708                     AssertMsgFailed(("emRamRead %VGv size=%d failed with %Vrc\n", pParam1, param1.size, rc));
     700//                    AssertMsgFailed(("emRamRead %VGv size=%d failed with %Vrc\n", pParam1, param1.size, rc));
    709701                    return VERR_EM_INTERPRETER;
    710702                }
     
    10251017#ifdef IN_GC
    10261018            /* Safety check (in theory it could cross a page boundary and fault there though) */
    1027             AssertMsgReturn(pDest == pvFault, ("eip=%VGv pDest=%VGv pvFault=%VGv\n", pRegFrame->eip, pDest, pvFault), VERR_EM_INTERPRETER);
     1019//            AssertMsgReturn(pDest == pvFault, ("eip=%VGv pDest=%VGv pvFault=%VGv\n", pRegFrame->eip, pDest, pvFault), VERR_EM_INTERPRETER);
    10281020#endif
    10291021            rc = emRamWrite(pVM, pDest, &val32, param2.size);
     
    11241116
    11251117                /* Safety check (in theory it could cross a page boundary and fault there though) */
    1126                 AssertMsgReturn(pParam1 == pvFault, ("eip=%VGv pParam1=%VGv pvFault=%VGv\n", pRegFrame->eip, pParam1, pvFault), VERR_EM_INTERPRETER);
     1118//                AssertMsgReturn(pParam1 == pvFault, ("eip=%VGv pParam1=%VGv pvFault=%VGv\n", pRegFrame->eip, pParam1, pvFault), VERR_EM_INTERPRETER);
    11271119
    11281120#ifdef VBOX_STRICT
     
    12621254    Log(("PGMInvalidatePage %VGv returned %VGv (%d)\n", pAddrGC, rc, rc));
    12631255    Assert(rc == VERR_REM_FLUSHED_PAGES_OVERFLOW);
    1264 
    12651256    /** @todo r=bird: we shouldn't ignore returns codes like this... I'm 99% sure the error is fatal. */
    12661257    return VERR_EM_INTERPRETER;
  • trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp

    r4416 r4418  
    461461    return MMGCRamReadNoTrapHandler(pDest, GCSrc, cb);
    462462#else
    463     int         rc;
    464     RTGCPHYS    GCPhys;
    465     RTGCUINTPTR offset;
    466 
    467     offset = GCSrc & PAGE_OFFSET_MASK;
    468 
    469     /** @todo optimize the loop; no need to convert the address all the time */
    470     rc = PGMPhysGCPtr2GCPhys(pVM, GCSrc, &GCPhys);
    471     AssertRCReturn(rc, rc);
    472     PGMPhysRead(pVM, GCPhys + offset, pDest, cb);
    473     return VINF_SUCCESS;
     463    return PGMPhysReadGCPtrSafe(pVM, pDest, GCSrc, cb);
    474464#endif
    475465}
     
    480470    return MMGCRamWriteNoTrapHandler(GCDest, pSrc, cb);
    481471#else
    482     int         rc;
    483     RTGCPHYS    GCPhys;
    484     RTGCUINTPTR offset;
    485 
    486     /** @todo optimize the loop; no need to convert the address all the time */
    487     offset = GCDest & PAGE_OFFSET_MASK;
    488     rc = PGMPhysGCPtr2GCPhys(pVM, GCDest, &GCPhys);
    489     AssertRCReturn(rc, rc);
    490     PGMPhysWrite(pVM, GCPhys + offset, pSrc, cb);
    491     return VINF_SUCCESS;
     472    return PGMPhysWriteGCPtrSafe(pVM, GCDest, pSrc, cb);
    492473#endif
    493474}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette