Changeset 16907 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Feb 18, 2009 3:04:16 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 43029
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r16882 r16907 719 719 pVM->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3; 720 720 Assert(!pVM->pgm.s.fMappingsFixed); 721 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY722 721 Assert(pVM->pgm.s.GCPhysCR3 == pVM->pgm.s.GCPhysGstCR3Monitored); 723 722 rc = PGM_GST_PFN(MonitorCR3, pVM)(pVM, pVM->pgm.s.GCPhysCR3); 724 #endif725 723 } 726 724 … … 1641 1639 { 1642 1640 pVM->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3; 1643 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY1644 1641 rc = PGM_GST_PFN(MonitorCR3, pVM)(pVM, GCPhysCR3); 1645 #endif1646 1642 } 1647 1643 } … … 1670 1666 pVM->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3; 1671 1667 Assert(!pVM->pgm.s.fMappingsFixed); 1672 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY1673 1668 rc = PGM_GST_PFN(MonitorCR3, pVM)(pVM, GCPhysCR3); 1674 #endif1675 1669 } 1676 1670 if (fGlobal) … … 1848 1842 pVM->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3; 1849 1843 Assert(!pVM->pgm.s.fMappingsFixed); 1850 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY1851 1844 Assert(pVM->pgm.s.GCPhysCR3 == pVM->pgm.s.GCPhysGstCR3Monitored); 1852 1845 rc = PGM_GST_PFN(MonitorCR3, pVM)(pVM, pVM->pgm.s.GCPhysCR3); 1853 #endif1854 1846 } 1855 1847 } -
trunk/src/VBox/VMM/VMMAll/PGMAllGst.h
r16317 r16907 129 129 PGM_GST_DECL(int, ModifyPage)(PVM pVM, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask); 130 130 PGM_GST_DECL(int, GetPDE)(PVM pVM, RTGCPTR GCPtr, PX86PDEPAE pPDE); 131 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY132 131 PGM_GST_DECL(int, MonitorCR3)(PVM pVM, RTGCPHYS GCPhysCR3); 133 132 PGM_GST_DECL(int, UnmonitorCR3)(PVM pVM); 134 #endif135 133 PGM_GST_DECL(bool, HandlerVirtualUpdate)(PVM pVM, uint32_t cr4); 136 134 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY … … 414 412 415 413 416 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY417 418 414 #undef LOG_GROUP 419 415 #define LOG_GROUP LOG_GROUP_PGM_POOL … … 438 434 * Register/Modify write phys handler for guest's CR3 if it changed. 439 435 */ 436 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 437 438 if (pVM->pgm.s.GCPhysGstCR3Monitored != GCPhysCR3) 439 { 440 rc = pgmPoolMonitorMonitorCR3(pVM->pgm.s.CTX_SUFF(pPool), GCPhysCR3); 441 if (RT_FAILURE(rc)) 442 { 443 AssertMsgFailed(("PGMHandlerPhysicalModify/PGMR3HandlerPhysicalRegister failed, rc=%Rrc GCPhysGstCR3Monitored=%RGp GCPhysCR3=%RGp\n", 444 rc, pVM->pgm.s.GCPhysGstCR3Monitored, GCPhysCR3)); 445 return rc; 446 } 447 pVM->pgm.s.GCPhysGstCR3Monitored = GCPhysCR3; 448 } 449 450 #if PGM_GST_TYPE == PGM_TYPE_PAE 451 /* 452 * Do the 4 PDs. 453 */ 454 PX86PDPT pGuestPDPT = pgmGstGetPaePDPTPtr(&pVM->pgm.s); 455 for (unsigned i = 0; i < X86_PG_PAE_PDPE_ENTRIES; i++) 456 { 457 if (pGuestPDPT->a[i].n.u1Present) 458 { 459 RTGCPHYS GCPhys = pGuestPDPT->a[i].u & X86_PDPE_PG_MASK; 460 if (pVM->pgm.s.aGCPhysGstPaePDsMonitored[i] != GCPhys) 461 { 462 Assert(pVM->pgm.s.enmShadowMode == PGMMODE_PAE || pVM->pgm.s.enmShadowMode == PGMMODE_PAE_NX); 463 464 rc = pgmPoolMonitorMonitorCR3(pVM->pgm.s.CTX_SUFF(pPool), GCPhys); 465 } 466 467 if (RT_FAILURE(rc)) 468 { 469 AssertMsgFailed(("PGMHandlerPhysicalModify/PGMR3HandlerPhysicalRegister failed, rc=%Rrc GCPhysGstCR3Monitored=%RGp GCPhysCR3=%RGp\n", 470 rc, pVM->pgm.s.aGCPhysGstPaePDsMonitored[i], GCPhys)); 471 return rc; 472 } 473 pVM->pgm.s.aGCPhysGstPaePDsMonitored[i] = GCPhys; 474 } 475 else if (pVM->pgm.s.aGCPhysGstPaePDsMonitored[i] != NIL_RTGCPHYS) 476 { 477 rc = pgmPoolMonitorUnmonitorCR3(pVM->pgm.s.CTX_SUFF(pPool), pVM->pgm.s.aGCPhysGstPaePDsMonitored[i]); 478 AssertRC(rc); 479 pVM->pgm.s.aGCPhysGstPaePDsMonitored[i] = NIL_RTGCPHYS; 480 } 481 } 482 483 #else 484 /* prot/real/amd64 mode stub */ 485 486 #endif 487 488 #else 440 489 #if PGM_GST_TYPE == PGM_TYPE_32BIT 441 490 … … 525 574 526 575 #endif 576 #endif /* VBOX_WITH_PGMPOOL_PAGING_ONLY */ 527 577 return rc; 528 578 } … … 544 594 * before we enter GC again. 545 595 */ 596 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 597 598 /* Unmonitor the root. (pd or pdpt) */ 599 if (pVM->pgm.s.GCPhysGstCR3Monitored != NIL_RTGCPHYS) 600 { 601 rc = pgmPoolMonitorUnmonitorCR3(pVM->pgm.s.CTX_SUFF(pPool), pVM->pgm.s.GCPhysGstCR3Monitored); 602 AssertRCReturn(rc, rc); 603 pVM->pgm.s.GCPhysGstCR3Monitored = NIL_RTGCPHYS; 604 } 605 606 #if PGM_GST_TYPE == PGM_TYPE_PAE 607 /* The 4 PDs. */ 608 for (unsigned i = 0; i < X86_PG_PAE_PDPE_ENTRIES; i++) 609 { 610 if (pVM->pgm.s.aGCPhysGstPaePDsMonitored[i] != NIL_RTGCPHYS) 611 { 612 Assert(pVM->pgm.s.enmShadowMode == PGMMODE_PAE || pVM->pgm.s.enmShadowMode == PGMMODE_PAE_NX); 613 int rc2 = pgmPoolMonitorUnmonitorCR3(pVM->pgm.s.CTX_SUFF(pPool), pVM->pgm.s.aGCPhysGstPaePDsMonitored[i]); 614 AssertRC(rc2); 615 if (RT_FAILURE(rc2)) 616 rc = rc2; 617 pVM->pgm.s.aGCPhysGstPaePDsMonitored[i] = NIL_RTGCPHYS; 618 } 619 } 620 #else 621 /* prot/real/amd64 mode stub */ 622 #endif 623 624 #else 625 546 626 #if PGM_GST_TYPE == PGM_TYPE_32BIT 547 627 if (pVM->pgm.s.GCPhysGstCR3Monitored != NIL_RTGCPHYS) … … 589 669 /* prot/real/amd64 mode stub */ 590 670 #endif 671 #endif /* VBOX_WITH_PGMPOOL_PAGING_ONLY */ 591 672 return rc; 592 673 … … 595 676 #undef LOG_GROUP 596 677 #define LOG_GROUP LOG_GROUP_PGM 597 598 #endif /* VBOX_WITH_PGMPOOL_PAGING_ONLY */599 678 600 679 -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r16904 r16907 1235 1235 bool fReused = false; 1236 1236 if ( ( pPage->cModifications < 48 /** @todo #define */ /** @todo need to check that it's not mapping EIP. */ /** @todo adjust this! */ 1237 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY1238 1237 || pPage->fCR3Mix 1239 #endif1240 1238 ) 1241 1239 && !(fReused = pgmPoolMonitorIsReused(pVM, pPage, pRegFrame, &Cpu, pvFault)) … … 1947 1945 PPGMPOOLPAGE pNewHead = &pPool->aPages[pPage->iMonitoredNext]; 1948 1946 pNewHead->iMonitoredPrev = NIL_PGMPOOL_IDX; 1949 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY1950 1947 pNewHead->fCR3Mix = pPage->fCR3Mix; 1951 #endif1952 1948 rc = PGMHandlerPhysicalChangeCallbacks(pVM, pPage->GCPhys & ~(RTGCPHYS)(PAGE_SIZE - 1), 1953 1949 pPool->pfnAccessHandlerR3, MMHyperCCToR3(pVM, pNewHead), … … 2031 2027 * @param GCPhysCR3 The (new) CR3 value. 2032 2028 */ 2029 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 2030 int pgmPoolMonitorMonitorCR3(PPGMPOOL pPool, RTGCPHYS GCPhysCR3) 2031 { 2032 return VINF_SUCCESS; 2033 } 2034 #else 2033 2035 int pgmPoolMonitorMonitorCR3(PPGMPOOL pPool, uint16_t idxRoot, RTGCPHYS GCPhysCR3) 2034 2036 { … … 2077 2079 return rc; 2078 2080 } 2081 #endif /* VBOX_WITH_PGMPOOL_PAGING_ONLY */ 2079 2082 2080 2083 … … 2086 2089 * @param idxRoot The CR3 (root) page index. 2087 2090 */ 2091 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 2092 int pgmPoolMonitorUnmonitorCR3(PPGMPOOL pPool, RTGCPHYS GCPhysCR3) 2093 { 2094 return VINF_SUCCESS; 2095 } 2096 #else 2088 2097 int pgmPoolMonitorUnmonitorCR3(PPGMPOOL pPool, uint16_t idxRoot) 2089 2098 { … … 2107 2116 return rc; 2108 2117 } 2118 #endif /* VBOX_WITH_PGMPOOL_PAGING_ONLY */ 2109 2119 2110 2120 # endif /* PGMPOOL_WITH_MIXED_PT_CR3 */ … … 4115 4125 pPage->fCached = false; 4116 4126 pPage->fReusedFlushPending = false; 4127 pPage->fCR3Mix = false; 4117 4128 #ifdef PGMPOOL_WITH_USER_TRACKING 4118 4129 pPage->iUserHead = NIL_PGMPOOL_USER_INDEX; 4119 #else4120 pPage->fCR3Mix = false;4121 4130 #endif 4122 4131 #ifdef PGMPOOL_WITH_CACHE … … 4502 4511 pPage->fCached = false; 4503 4512 pPage->fReusedFlushPending = false; 4513 pPage->fCR3Mix = false; 4504 4514 #ifdef PGMPOOL_WITH_MONITORING 4505 4515 pPage->cModifications = 0; 4506 4516 pPage->iModifiedNext = NIL_PGMPOOL_IDX; 4507 4517 pPage->iModifiedPrev = NIL_PGMPOOL_IDX; 4508 #else4509 pPage->fCR3Mix = false;4510 4518 #endif 4511 4519 #ifdef PGMPOOL_WITH_USER_TRACKING
Note:
See TracChangeset
for help on using the changeset viewer.