Changeset 13235 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Oct 13, 2008 8:48:53 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.