Changeset 17438 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Mar 6, 2009 4:35:00 AM (16 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r17432 r17438 628 628 else 629 629 { 630 /* When the guest accesses invalid physical memory (e.g. probing of RAM or accessing a remapped MMIO range), then we'll fall 630 /* 631 * When the guest accesses invalid physical memory (e.g. probing 632 * of RAM or accessing a remapped MMIO range), then we'll fall 631 633 * back to the recompiler to emulate the instruction. 632 634 */ 633 LogFlow((" pgmPhysGetPageEx %RGpfailed with %Rrc\n", GCPhys, rc));635 LogFlow(("PGM #PF: pgmPhysGetPageEx(%RGp) failed with %Rrc\n", GCPhys, rc)); 634 636 STAM_COUNTER_INC(&pVM->pgm.s.StatRZTrap0eHandlersInvalid); 635 637 STAM_PROFILE_STOP(&pVM->pgm.s.StatRZTrap0eTimeHandlers, b); … … 641 643 # ifdef PGM_OUT_OF_SYNC_IN_GC 642 644 /* 643 * We are here only if page is present in Guest page tables and trap is not handled 644 * by our handlers. 645 * We are here only if page is present in Guest page tables and 646 * trap is not handled by our handlers. 647 * 645 648 * Check it for page out-of-sync situation. 646 649 */ … … 754 757 else 755 758 { 759 # ifdef VBOX_WITH_NEW_PHYS_CODE 760 /* 761 * Need to deal with these buggers somewhere... 762 */ 763 if ( PGM_PAGE_GET_STATE(pPage) != PGM_PAGE_STATE_ALLOCATED 764 && (uErr & X86_TRAP_PF_RW)) 765 { 766 Log(("PGM #PF: %RGp %R[pgmpage] uErr=%#x\n", GCPhys, pPage, uErr)); 767 AssertMsgFailed(("PGM #PF: %RGp %R[pgmpage] uErr=%#x\n", GCPhys, pPage, uErr)); 768 } 769 # endif /* VBOX_WITH_NEW_PHYS_CODE */ 770 756 771 /* 757 772 * A side effect of not flushing global PDEs are out of sync pages due … … 1464 1479 if (RT_SUCCESS(rc)) 1465 1480 { 1481 #ifdef VBOX_WITH_NEW_PHYS_CODE 1482 /* Try make the page writable if necessary. */ 1483 if ( PteSrc.n.u1Write 1484 && PGM_PAGE_GET_STATE(pPage) != PGM_PAGE_STATE_ALLOCATED 1485 && PGM_PAGE_GET_TYPE(pPage) == PGMPAGETYPE_RAM) 1486 { 1487 rc = pgmPhysPageMakeWritableUnlocked(pVM, pPage, PteSrc.u & GST_PTE_PG_MASK); 1488 AssertRC(rc); 1489 } 1490 #endif 1491 1466 1492 /** @todo investiage PWT, PCD and PAT. */ 1467 1493 /* … … 1537 1563 } 1538 1564 1565 #ifdef VBOX_WITH_NEW_PHYS_CODE 1566 /* 1567 * Make sure only allocated pages are mapped writable. 1568 */ 1569 if ( PteDst.n.u1Write 1570 && PteDst.n.u1Present 1571 && PGM_PAGE_GET_STATE(pPage) != PGM_PAGE_STATE_ALLOCATED) 1572 PteDst.n.u1Write = 0; /** @todo this isn't quite working yet. */ 1573 #endif 1574 1539 1575 #ifdef PGMPOOL_WITH_USER_TRACKING 1540 1576 /* … … 1822 1858 if (RT_SUCCESS(rc)) 1823 1859 { 1860 # ifdef VBOX_WITH_NEW_PHYS_CODE 1861 /* Try make the page writable if necessary. */ 1862 if ( PdeSrc.n.u1Write 1863 && PGM_PAGE_GET_STATE(pPage) != PGM_PAGE_STATE_ALLOCATED 1864 && PGM_PAGE_GET_TYPE(pPage) == PGMPAGETYPE_RAM) 1865 { 1866 rc = pgmPhysPageMakeWritableUnlocked(pVM, pPage, GCPhys); 1867 AssertRC(rc); 1868 } 1869 # endif 1870 1824 1871 /* 1825 1872 * Make shadow PTE entry. … … 1840 1887 PGM_BTH_NAME(SyncPageWorkerTrackAddref)(pVM, pShwPage, PGM_PAGE_GET_TRACKING(pPage), pPage, iPTDst); 1841 1888 # endif 1889 # ifdef VBOX_WITH_NEW_PHYS_CODE 1890 /* Make sure only allocated pages are mapped writable. */ 1891 if ( PteDst.n.u1Write 1892 && PteDst.n.u1Present 1893 && PGM_PAGE_GET_STATE(pPage) != PGM_PAGE_STATE_ALLOCATED) 1894 PteDst.n.u1Write = 0; /** @todo this isn't quite working yet... */ 1895 # endif 1896 1842 1897 pPTDst->a[iPTDst] = PteDst; 1843 1898 … … 2697 2752 SHWPTE PteDst; 2698 2753 2699 # ifndef VBOX_WITH_NEW_PHYS_CODE 2754 # ifdef VBOX_WITH_NEW_PHYS_CODE 2755 /* Try make the page writable if necessary. */ 2756 if ( PteDstBase.n.u1Write 2757 && PGM_PAGE_GET_STATE(pPage) != PGM_PAGE_STATE_ALLOCATED 2758 && PGM_PAGE_GET_TYPE(pPage) == PGMPAGETYPE_RAM) 2759 { 2760 rc = pgmPhysPageMakeWritableUnlocked(pVM, pPage, GCPhys); 2761 AssertRCReturn(rc, rc); 2762 } 2763 # else /* !VBOX_WITH_NEW_PHYS_CODE */ 2700 2764 /* Make sure the RAM has already been allocated. */ 2701 2765 if (pRam->fFlags & MM_RAM_FLAGS_DYNAMIC_ALLOC) /** @todo PAGE FLAGS */ -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r17435 r17438 462 462 return pgmPhysAllocPage(pVM, pPage, GCPhys); 463 463 } 464 } 465 466 467 /** 468 * Wrapper for pgmPhysPageMakeWritable which enters the critsect. 469 * 470 * @returns VBox status code. 471 * @retval VINF_SUCCESS on success. 472 * @retval VERR_PGM_PHYS_PAGE_RESERVED it it's a valid page but has no physical backing. 473 * 474 * @param pVM The VM address. 475 * @param pPage The physical page tracking structure. 476 * @param GCPhys The address of the page. 477 */ 478 int pgmPhysPageMakeWritableUnlocked(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys) 479 { 480 int rc = pgmLock(pVM); 481 if (RT_SUCCESS(rc)) 482 { 483 rc = pgmPhysPageMakeWritable(pVM, pPage, GCPhys); 484 pgmUnlock(pVM); 485 } 486 return rc; 464 487 } 465 488
Note:
See TracChangeset
for help on using the changeset viewer.