VirtualBox

Changeset 25550 in vbox for trunk


Ignore:
Timestamp:
Dec 21, 2009 5:18:47 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56226
Message:

Raw mode: deal with invalidated tlb entries during disassembly (long overdue)

File:
1 edited

Legend:

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

    r24953 r25550  
    107107
    108108
    109 #ifndef IN_RC
    110 
    111109/**
    112110 * Read callback for disassembly function; supports reading bytes that cross a page boundary
     
    145143    rc = PGMPhysSimpleReadGCPtr(pVCpu, pDest, pSrc, cb);
    146144    AssertMsgRC(rc, ("PGMPhysSimpleReadGCPtr failed for pSrc=%RGv cb=%x rc=%d\n", pSrc, cb, rc));
    147 # else /* IN_RING3 */
     145# elif defined(IN_RING3)
    148146    if (!PATMIsPatchGCAddr(pVM, pSrc))
    149147    {
     
    152150    }
    153151    else
    154     {
    155         for (unsigned i = 0; i < cb; i++)
     152        memcpy(pDest, PATMR3GCPtrToHCPtr(pVM, pSrc), cb);
     153
     154# elif defined(IN_RC)
     155    if (!PATMIsPatchGCAddr(pVM, (RTRCPTR)pSrc))
     156    {
     157        int rc = MMGCRamRead(pVM, pDest, (void *)pSrc, cb);
     158        if (rc == VERR_ACCESS_DENIED)
    156159        {
    157             uint8_t opcode;
    158             if (RT_SUCCESS(PATMR3QueryOpcode(pVM, (RTGCPTR)pSrc + i, &opcode)))
    159                 *(pDest+i) = opcode;
    160 
     160            /* Recently flushed; access the data manually. */
     161            rc = PGMPhysSimpleReadGCPtr(pVCpu, pDest, pSrc, cb);
     162            AssertRC(rc);
    161163        }
    162164    }
     165    else /* the hypervisor region is always present. */
     166        memcpy(pDest, (RTRCPTR)pSrc, cb);
     167
    163168# endif /* IN_RING3 */
    164169    return VINF_SUCCESS;
    165170}
    166171
     172
     173#ifndef IN_RC
    167174DECLINLINE(int) emDisCoreOne(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pDis, RTGCUINTPTR InstrGC, uint32_t *pOpsize)
    168175{
     
    195202DECLINLINE(int) emDisCoreOne(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pDis, RTGCUINTPTR InstrGC, uint32_t *pOpsize)
    196203{
    197     NOREF(pVCpu);
    198     NOREF(pVM);
    199     return DISCoreOne(pDis, InstrGC, pOpsize);
     204    EMDISSTATE State;
     205
     206    State.pVM   = pVM;
     207    State.pVCpu = pVCpu;
     208    State.GCPtr = InstrGC;
     209
     210    return DISCoreOneEx(InstrGC, pDis->mode, EMReadBytes, &State, pDis, pOpsize);
    200211}
    201212
Note: See TracChangeset for help on using the changeset viewer.

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