VirtualBox

Changeset 30495 in vbox


Ignore:
Timestamp:
Jun 29, 2010 12:44:34 PM (15 years ago)
Author:
vboxsync
Message:

Drop PGMPhysGCPtr2R3Ptr usage

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PATM/CSAM.cpp

    r30493 r30495  
    24812481     * Get IDT entries.
    24822482     */
    2483     if (PAGE_ADDRESS(GCPtrIDT) == PAGE_ADDRESS(GCPtrIDT+cGates*sizeof(VBOXIDTE)))
    2484     {
    2485         /* Just convert the IDT address to a R3 pointer. The whole IDT fits in one page. */
    2486         rc = PGMPhysGCPtr2R3Ptr(pVCpu, GCPtrIDT, (PRTR3PTR)&pGuestIdte);
    2487         if (RT_FAILURE(rc))
    2488         {
    2489             AssertMsgRC(rc, ("Failed to read IDTE! rc=%Rrc\n", rc));
    2490             STAM_PROFILE_STOP(&pVM->csam.s.StatCheckGates, a);
    2491             return rc;
    2492         }
    2493     }
    2494     else
    2495     {
    2496         /* Slow method when it crosses a page boundary. */
    2497         rc = PGMPhysSimpleReadGCPtr(pVCpu, aIDT, GCPtrIDT,  cGates*sizeof(VBOXIDTE));
    2498         if (RT_FAILURE(rc))
    2499         {
    2500             AssertMsgRC(rc, ("Failed to read IDTE! rc=%Rrc\n", rc));
    2501             STAM_PROFILE_STOP(&pVM->csam.s.StatCheckGates, a);
    2502             return rc;
    2503         }
    2504         pGuestIdte = &aIDT[0];
    2505     }
     2483    rc = PGMPhysSimpleReadGCPtr(pVCpu, aIDT, GCPtrIDT,  cGates*sizeof(VBOXIDTE));
     2484    if (RT_FAILURE(rc))
     2485    {
     2486        AssertMsgRC(rc, ("Failed to read IDTE! rc=%Rrc\n", rc));
     2487        STAM_PROFILE_STOP(&pVM->csam.s.StatCheckGates, a);
     2488        return rc;
     2489    }
     2490    pGuestIdte = &aIDT[0];
    25062491
    25072492    for (/*iGate*/; iGate<iGateEnd; iGate++, pGuestIdte++)
  • trunk/src/VBox/VMM/PATM/PATM.cpp

    r30493 r30495  
    600600    if (pPatch->patch.flags & PATMFL_PATCHED_GUEST_CODE)
    601601    {
     602        PGMPAGEMAPLOCK PageLock;
     603
    602604        /** @note pPrivInstrHC is probably not valid anymore */
    603         rc = PGMPhysGCPtr2R3Ptr(VMMGetCpu0(pVM), pPatch->patch.pPrivInstrGC, (PRTR3PTR)&pPatch->patch.pPrivInstrHC);
     605        rc = PGMPhysGCPhys2CCPtrReadOnly(pVM, pPatch->patch.pPrivInstrGC, (const void **)&pPatch->patch.pPrivInstrHC, &PageLock);
    604606        if (rc == VINF_SUCCESS)
    605607        {
     
    607609            disret = PATMR3DISInstr(pVM, &pPatch->patch, &cpu, pPatch->patch.pPrivInstrGC, pPatch->patch.pPrivInstrHC, &opsize, szOutput, PATMREAD_RAWCODE);
    608610            Log(("Org patch jump: %s", szOutput));
     611
     612            PGMPhysReleasePageMappingLock(pVM, &PageLock);
    609613        }
    610614    }
     
    786790    if (pPatch->patch.flags & PATMFL_PATCHED_GUEST_CODE)
    787791    {
     792        PGMPAGEMAPLOCK PageLock;
     793
    788794        /** @note pPrivInstrHC is probably not valid anymore */
    789         rc = PGMPhysGCPtr2R3Ptr(VMMGetCpu0(pVM), pPatch->patch.pPrivInstrGC, (PRTR3PTR)&pPatch->patch.pPrivInstrHC);
     795        rc = PGMPhysGCPhys2CCPtrReadOnly(pVM, pPatch->patch.pPrivInstrGC, (const void **)&pPatch->patch.pPrivInstrHC, &PageLock);
    790796        if (rc == VINF_SUCCESS)
    791797        {
     
    793799            disret = PATMR3DISInstr(pVM, &pPatch->patch, &cpu, pPatch->patch.pPrivInstrGC, pPatch->patch.pPrivInstrHC, &opsize, szOutput, PATMREAD_RAWCODE);
    794800            Log(("Rel patch jump: %s", szOutput));
     801
     802            PGMPhysReleasePageMappingLock(pVM, &PageLock);
    795803        }
    796804    }
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