儲存庫 vbox 的更動 13235
- 時間撮記:
- 2008-10-13 下午08:48:53 (16 年 以前)
- 位置:
- trunk
- 檔案:
-
- 修改 7 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/include/VBox/pgm.h
r13232 r13235 338 338 VMMDECL(X86PDPE) PGMGstGetPaePDPtr(PVM pVM, unsigned iPdPt); 339 339 340 VMMDECL(int) PGMInvalidatePage(PVM pVM, RTGCPTR GCPtrPage); 340 341 VMMDECL(int) PGMFlushTLB(PVM pVM, uint64_t cr3, bool fGlobal); 342 VMMDECL(int) PGMSyncCR3(PVM pVM, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal); 341 343 VMMDECL(int) PGMUpdateCR3(PVM pVM, uint64_t cr3); 342 VMMDECL(int) PGMSyncCR3(PVM pVM, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal);343 344 VMMDECL(int) PGMChangeMode(PVM pVM, uint64_t cr0, uint64_t cr4, uint64_t efer); 344 345 VMMDECL(PGMMODE) PGMGetGuestMode(PVM pVM); … … 432 433 VMMDECL(int) PGMPhysWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, const void *pvSrc, size_t cb); 433 434 VMMDECL(int) PGMPhysSimpleDirtyWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, const void *pvSrc, size_t cb); 434 VMMDECL(int) PGMInvalidatePage(PVM pVM, RTGCPTR GCPtrPage);435 435 #endif /* !IN_GC */ 436 436 VMMDECL(int) PGMPhysInterpretedRead(PVM pVM, PCPUMCTXCORE pCtxCore, void *pvDst, RTGCUINTPTR GCPtrSrc, size_t cb); … … 454 454 * @{ 455 455 */ 456 VMMRCDECL(int) PGMGCInvalidatePage(PVM pVM, RTGCPTR GCPtrPage);457 456 /** @} */ 458 457 #endif /* IN_GC */ -
trunk/src/VBox/VMM/PGM.cpp
r13188 r13235 1548 1548 1549 1549 /* GC only: */ 1550 STAM_REG(pVM, &pPGM->StatRCInvalidatePage, STAMTYPE_PROFILE, "/PGM/RC/InvalidatePage", STAMUNIT_TICKS_PER_CALL, "PGMGCInvalidatePage() profiling.");1551 1550 STAM_REG(pVM, &pPGM->StatRCDynMapCacheHits, STAMTYPE_COUNTER, "/PGM/RC/DynMapCache/Hits" , STAMUNIT_OCCURENCES, "Number of dynamic page mapping cache hits."); 1552 1551 STAM_REG(pVM, &pPGM->StatRCDynMapCacheMisses, STAMTYPE_COUNTER, "/PGM/RC/DynMapCache/Misses" , STAMUNIT_OCCURENCES, "Number of dynamic page mapping cache misses."); 1552 STAM_REG(pVM, &pPGM->StatRCInvlPgConflict, STAMTYPE_COUNTER, "/PGM/RC/InvlPgConflict", STAMUNIT_OCCURENCES, "Number of times PGMInvalidatePage() detected a mapping conflict."); 1553 STAM_REG(pVM, &pPGM->StatRCInvlPgSyncMonCR3, STAMTYPE_COUNTER, "/PGM/RC/InvlPgSyncMonitorCR3", STAMUNIT_OCCURENCES, "Number of times PGMInvalidatePage() ran into PGM_SYNC_MONITOR_CR3."); 1553 1554 1554 1555 /* RZ only: */ -
trunk/src/VBox/VMM/PGMInternal.h
r13100 r13235 2427 2427 2428 2428 /* RC only: */ 2429 STAMPROFILE StatRCInvalidatePage; /**< RC: PGMGCInvalidatePage() profiling. */2430 2429 STAMCOUNTER StatRCDynMapCacheMisses; /**< RC: The number of dynamic page mapping cache hits */ 2431 2430 STAMCOUNTER StatRCDynMapCacheHits; /**< RC: The number of dynamic page mapping cache misses */ 2431 STAMCOUNTER StatRCInvlPgConflict; /**< RC: Number of times PGMInvalidatePage() detected a mapping conflict. */ 2432 STAMCOUNTER StatRCInvlPgSyncMonCR3; /**< RC: Number of times PGMInvalidatePage() ran into PGM_SYNC_MONITOR_CR3. */ 2432 2433 2433 2434 /* RZ only: */ -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r13193 r13235 1786 1786 */ 1787 1787 #ifdef IN_GC 1788 // Note: we could also use PGMFlushPage here, but it currently doesn't always use invlpg!!!!!!!!!! 1789 LogFlow(("GC: EMULATE: invlpg %08X\n", pAddrGC)); 1790 rc = PGMGCInvalidatePage(pVM, pAddrGC); 1791 #else 1788 LogFlow(("RC: EMULATE: invlpg %RGv\n", pAddrGC)); 1789 #endif 1792 1790 rc = PGMInvalidatePage(pVM, pAddrGC); 1793 #endif 1794 if (VBOX_SUCCESS(rc))1791 if ( rc == VINF_SUCCESS 1792 || rc == VINF_PGM_SYNC_CR3 /* we can rely on the FF */) 1795 1793 return VINF_SUCCESS; 1796 Log(("PGMInvalidatePage %VGv returned %VGv (%d)\n", pAddrGC, rc, rc)); 1797 Assert(rc == VERR_REM_FLUSHED_PAGES_OVERFLOW); 1798 /** @todo r=bird: we shouldn't ignore returns codes like this... I'm 99% sure the error is fatal. */ 1799 return VERR_EM_INTERPRETER; 1794 AssertMsgReturn( rc == VERR_REM_FLUSHED_PAGES_OVERFLOW 1795 || rc == VINF_EM_RAW_EMULATE_INSTR, 1796 ("%Rrc addr=%RGv\n", rc, pAddrGC), 1797 VERR_EM_INTERPRETER); 1798 return rc; 1800 1799 } 1801 1800 … … 1830 1829 */ 1831 1830 #ifdef IN_GC 1832 // Note: we could also use PGMFlushPage here, but it currently doesn't always use invlpg!!!!!!!!!! 1833 LogFlow(("GC: EMULATE: invlpg %08X\n", addr)); 1834 rc = PGMGCInvalidatePage(pVM, addr); 1835 #else 1831 LogFlow(("RC: EMULATE: invlpg %RGv\n", addr)); 1832 #endif 1836 1833 rc = PGMInvalidatePage(pVM, addr); 1837 #endif 1838 if (VBOX_SUCCESS(rc))1834 if ( rc == VINF_SUCCESS 1835 || rc == VINF_PGM_SYNC_CR3 /* we can rely on the FF */) 1839 1836 return VINF_SUCCESS; 1840 /** @todo r=bird: we shouldn't ignore returns codes like this... I'm 99% sure the error is fatal. */ 1841 return VERR_EM_INTERPRETER; 1837 AssertMsgReturn( rc == VERR_REM_FLUSHED_PAGES_OVERFLOW 1838 || rc == VINF_EM_RAW_EMULATE_INSTR, 1839 ("%Rrc addr=%RGv\n", rc, addr), 1840 VERR_EM_INTERPRETER); 1841 return rc; 1842 1842 } 1843 1843 -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r13232 r13235 624 624 625 625 626 #ifndef IN_GC627 626 /** 628 627 * Emulation of the invlpg instruction (HC only actually). 629 628 * 630 * @returns VBox status code. 629 * @returns VBox status code, special care required. 630 * @retval VINF_PGM_SYNC_CR3 - handled. 631 * @retval VINF_EM_RAW_EMULATE_INSTR - not handled (RC only). 632 * @retval VERR_REM_FLUSHED_PAGES_OVERFLOW - not handled. 633 * 631 634 * @param pVM VM handle. 632 635 * @param GCPtrPage Page to invalidate. 633 * @remark ASSUMES the page table entry or page directory is 634 * valid. Fairly safe, but there could be edge cases! 636 * 637 * @remark ASSUMES the page table entry or page directory is valid. Fairly 638 * safe, but there could be edge cases! 639 * 635 640 * @todo Flush page or page directory only if necessary! 636 641 */ … … 638 643 { 639 644 int rc; 640 641 645 Log3(("PGMInvalidatePage: GCPtrPage=%VGv\n", GCPtrPage)); 642 646 643 /** @todo merge PGMGCInvalidatePage with this one */ 644 645 # ifndef IN_RING3 647 #ifndef IN_RING3 646 648 /* 647 649 * Notify the recompiler so it can record this instruction. … … 649 651 */ 650 652 rc = REMNotifyInvalidatePage(pVM, GCPtrPage); 651 if ( VBOX_FAILURE(rc))653 if (rc != VINF_SUCCESS) 652 654 return rc; 653 # endif 654 655 #endif /* !IN_RING3 */ 656 657 658 #ifdef IN_GC 659 /* 660 * Check for conflicts and pending CR3 monitoring updates. 661 */ 662 if (!pVM->pgm.s.fMappingsFixed) 663 { 664 if ( pgmGetMapping(pVM, GCPtrPage) 665 && PGMGstGetPage(pVM, GCPtrPage, NULL, NULL) != VERR_PAGE_TABLE_NOT_PRESENT) 666 { 667 LogFlow(("PGMGCInvalidatePage: Conflict!\n")); 668 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3); 669 STAM_COUNTER_INC(&pVM->pgm.s.StatRCInvlPgConflict); 670 return VINF_PGM_SYNC_CR3; 671 } 672 673 if (pVM->pgm.s.fSyncFlags & PGM_SYNC_MONITOR_CR3) 674 { 675 LogFlow(("PGMGCInvalidatePage: PGM_SYNC_MONITOR_CR3 -> reinterpret instruction in R3\n")); 676 STAM_COUNTER_INC(&pVM->pgm.s.StatRCInvlPgSyncMonCR3); 677 return VINF_EM_RAW_EMULATE_INSTR; 678 } 679 } 680 #endif /* IN_GC */ 681 682 /* 683 * Call paging mode specific worker. 684 */ 655 685 STAM_PROFILE_START(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePage), a); 656 686 rc = PGM_BTH_PFN(InvalidatePage, pVM)(pVM, GCPtrPage); 657 687 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePage), a); 658 688 659 # ifndef IN_RING0689 #ifdef IN_RING3 660 690 /* 661 691 * Check if we have a pending update of the CR3 monitoring. … … 669 699 rc = PGM_GST_PFN(MonitorCR3, pVM)(pVM, pVM->pgm.s.GCPhysCR3); 670 700 } 671 # endif 672 673 # ifdef IN_RING3 701 674 702 /* 675 703 * Inform CSAM about the flush 676 */ 677 /* note: This is to check if monitored pages have been changed; when we implement callbacks for virtual handlers, this is no longer required. */ 704 * 705 * Note: This is to check if monitored pages have been changed; when we implement 706 * callbacks for virtual handlers, this is no longer required. 707 */ 678 708 CSAMR3FlushPage(pVM, GCPtrPage); 679 # endif709 #endif /* IN_RING3 */ 680 710 return rc; 681 711 } 682 #endif /* !IN_GC */683 712 684 713 -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r13232 r13235 1110 1110 && !(pPDEDst[iPD].u & PGM_PDFLAGS_MAPPING)) 1111 1111 { 1112 pgmPoolFreeByPage(pPool, pgmPoolGetPage(pPool, pPDEDst[iPD].u & SHW_PDE_PG_MASK), SHW_POOL_ROOT_IDX, iPdpte * X86_PG_PAE_ENTRIES + iPD);1113 pPDEDst[iPD].u = 0;1112 pgmPoolFreeByPage(pPool, pgmPoolGetPage(pPool, pPDEDst[iPD].u & SHW_PDE_PG_MASK), SHW_POOL_ROOT_IDX, iPdpte * X86_PG_PAE_ENTRIES + iPD); 1113 pPDEDst[iPD].u = 0; 1114 1114 } 1115 1115 } -
trunk/src/VBox/VMM/VMMGC/PGMGC.cpp
r13106 r13235 166 166 #undef PGM_SHW_NAME 167 167 168 169 170 /**171 * Emulation of the invlpg instruction.172 *173 * @returns VBox status code suitable for scheduling.174 * @param pVM VM handle.175 * @param GCPtrPage Page to invalidate.176 */177 VMMRCDECL(int) PGMGCInvalidatePage(PVM pVM, RTGCPTR GCPtrPage)178 {179 LogFlow(("PGMGCInvalidatePage: GCPtrPage=%VGv\n", GCPtrPage));180 181 STAM_PROFILE_START(&pVM->pgm.s.StatRCInvalidatePage, a);182 183 /*184 * Check for conflicts and pending CR3 monitoring updates.185 */186 if (!pVM->pgm.s.fMappingsFixed)187 {188 if ( pgmGetMapping(pVM, GCPtrPage)189 /** @todo && (PGMGstGetPDE(pVM, GCPtrPage) & X86_PDE_P) - FIX THIS NOW!!! */ )190 {191 LogFlow(("PGMGCInvalidatePage: Conflict!\n"));192 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);193 STAM_PROFILE_STOP(&pVM->pgm.s.StatRCInvalidatePage, a);194 return VINF_PGM_SYNC_CR3;195 }196 197 if (pVM->pgm.s.fSyncFlags & PGM_SYNC_MONITOR_CR3)198 {199 LogFlow(("PGMGCInvalidatePage: PGM_SYNC_MONITOR_CR3 -> reinterpret instruction in HC\n"));200 STAM_PROFILE_STOP(&pVM->pgm.s.StatRCInvalidatePage, a);201 /** @todo counter for these... */202 return VINF_EM_RAW_EMULATE_INSTR;203 }204 }205 206 /*207 * Notify the recompiler so it can record this instruction.208 * Failure happens when it's out of space. We'll return to HC in that case.209 */210 int rc = REMNotifyInvalidatePage(pVM, GCPtrPage);211 if (rc == VINF_SUCCESS)212 rc = PGM_BTH_PFN(InvalidatePage, pVM)(pVM, GCPtrPage);213 214 STAM_PROFILE_STOP(&pVM->pgm.s.StatRCInvalidatePage, a);215 return rc;216 }
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器