VirtualBox

儲存庫 vbox 的更動 16465


忽略:
時間撮記:
2009-2-2 下午03:25:18 (16 年 以前)
作者:
vboxsync
訊息:

Got rid of the aliased hack that directly manipulates shadow page table entries; use the right way by going through the PGM pool.

位置:
trunk/src/VBox/VMM/VMMAll
檔案:
修改 3 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp

    r16458 r16465  
    17851785#endif
    17861786
    1787 #if 0
     1787    /* @note this is a NOP in the EPT case; we'll just let it fault again to resync the page. */
    17881788    rc = PGMPrefetchPage(pVM, (RTGCPTR)GCPhys);
    1789 #else
    1790     /* Mark it as writable and present so reads and writes no longer fault. */
    1791     rc = PGMShwModifyPage(pVM, (RTGCPTR)GCPhys, 1, fPageFlags, ~fPageFlags);
    1792 #endif
    17931789    Assert(rc == VINF_SUCCESS || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT);
    1794 
    17951790    return VINF_SUCCESS;
    17961791}
     
    18071802VMMDECL(int)  IOMMMIOResetRegion(PVM pVM, RTGCPHYS GCPhys)
    18081803{
    1809     uint32_t cb;
    1810 
    18111804    Log(("IOMMMIOResetRegion %RGp\n", GCPhys));
    18121805
     
    18251818
    18261819
    1827     cb     = pRange->cb;
     1820    /* Reset the entire range by clearing all shadow page table entries. */
     1821    int rc = PGMHandlerPhysicalReset(pVM, pRange->GCPhys);
     1822    AssertRC(rc);
     1823
     1824#ifdef VBOX_STRICT
     1825    uint32_t cb = pRange->cb;
     1826
    18281827    GCPhys = pRange->GCPhys;
    18291828
    18301829    while (cb)
    18311830    {
    1832         int rc = PGMHandlerPhysicalPageReset(pVM, pRange->GCPhys, GCPhys);
    1833         AssertRC(rc);
    1834 
    1835         /* Mark it as not present again to intercept all read and write access. */
    1836 #if 0
    1837         rc = PGMPrefetchPage(pVM, (RTGCPTR)GCPhys);
    1838 #else
    1839         rc = PGMShwModifyPage(pVM, (RTGCPTR)GCPhys, 1, 0, ~(uint64_t)(X86_PTE_RW|X86_PTE_P));
    1840         Assert(rc == VINF_SUCCESS || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT);
    1841 #endif
    1842 
    1843 #ifdef VBOX_STRICT
     1831
    18441832        uint64_t fFlags;
    18451833        RTHCPHYS HCPhys;
    18461834        rc = PGMShwGetPage(pVM, (RTGCPTR)GCPhys, &fFlags, &HCPhys);
    18471835        Assert(rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT);
    1848 #endif
    18491836        cb     -= PAGE_SIZE;
    18501837        GCPhys += PAGE_SIZE;
    18511838    }
     1839#endif
    18521840    return VINF_SUCCESS;
    18531841}
  • trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp

    r16463 r16465  
    819819            case PGMPHYSHANDLERTYPE_PHYSICAL_WRITE:
    820820            case PGMPHYSHANDLERTYPE_PHYSICAL_ALL:
     821            case PGMPHYSHANDLERTYPE_MMIO: /* @note Only use when clearing aliased mmio ranges! */
    821822            {
    822823                /*
     
    842843             * Invalid.
    843844             */
    844             case PGMPHYSHANDLERTYPE_MMIO:
    845                 AssertMsgFailed(("Can't reset type %d!\n",  pCur->enmType));
    846                 rc = VERR_INTERNAL_ERROR;
    847                 break;
    848 
    849845            default:
    850846                AssertMsgFailed(("Invalid type %d! Corruption!\n",  pCur->enmType));
  • trunk/src/VBox/VMM/VMMAll/PGMAllShw.h

    r16358 r16465  
    358358            {
    359359                pPT->a[iPTE].u = (pPT->a[iPTE].u & (fMask | SHW_PTE_PG_MASK)) | (fFlags & ~SHW_PTE_PG_MASK);
    360 /** @todo r=bird: I think this may break assumptions in page pool GCPhys
    361  * tracking, and I seems to recall putting it here to prevent API users from
    362  * making anything !P. The assertion is kind of useless now, as it
    363  * won't hit anything any longer... */
    364                 Assert(pPT->a[iPTE].n.u1Present || !(fMask & X86_PTE_P));
     360                Assert(pPT->a[iPTE].n.u1Present);
    365361# if PGM_SHW_TYPE == PGM_TYPE_EPT
    366362                HWACCMInvalidatePhysPage(pVM, (RTGCPHYS)GCPtr);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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