Changeset 25935 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Jan 20, 2010 2:43:56 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56774
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r25915 r25935 723 723 * Check for conflicts and pending CR3 monitoring updates. 724 724 */ 725 if ( !pVM->pgm.s.fMappingsFixed)725 if (pgmMapAreMappingsFloating(&pVM->pgm.s)) 726 726 { 727 727 if ( pgmGetMapping(pVM, GCPtrPage) … … 763 763 { 764 764 pVCpu->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3; 765 Assert(!pVM->pgm.s.fMappingsFixed); 765 Assert(!pVM->pgm.s.fMappingsFixed); Assert(!pVM->pgm.s.fMappingsDisabled); 766 766 } 767 767 … … 1690 1690 if (RT_LIKELY(rc == VINF_SUCCESS)) 1691 1691 { 1692 if (!pVM->pgm.s.fMappingsFixed) 1693 { 1692 if (pgmMapAreMappingsFloating(&pVM->pgm.s)) 1694 1693 pVCpu->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3; 1695 }1696 1694 } 1697 1695 else … … 1701 1699 pVCpu->pgm.s.GCPhysCR3 = GCPhysOldCR3; 1702 1700 pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_MAP_CR3; 1703 if ( !pVM->pgm.s.fMappingsFixed)1701 if (pgmMapAreMappingsFloating(&pVM->pgm.s)) 1704 1702 pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_MONITOR_CR3; 1705 1703 } … … 1727 1725 { 1728 1726 pVCpu->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3; 1729 Assert(!pVM->pgm.s.fMappingsFixed); 1727 Assert(!pVM->pgm.s.fMappingsFixed); Assert(!pVM->pgm.s.fMappingsDisabled); 1730 1728 } 1731 1729 if (fGlobal) … … 1764 1762 1765 1763 /* We assume we're only called in nested paging mode. */ 1766 Assert(pVM->pgm.s.fMappingsFixed); 1764 Assert(HWACCMIsNestedPagingActive(pVM) || pVCpu->pgm.s.enmShadowMode == PGMMODE_EPT); 1765 Assert(pVM->pgm.s.fMappingsDisabled); 1767 1766 Assert(!(pVCpu->pgm.s.fSyncFlags & PGM_SYNC_MONITOR_CR3)); 1768 Assert(HWACCMIsNestedPagingActive(pVM) || pVCpu->pgm.s.enmShadowMode == PGMMODE_EPT);1769 1767 1770 1768 /* … … 1911 1909 { 1912 1910 pVCpu->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3; 1913 Assert(!pVM->pgm.s.fMappingsFixed); 1911 Assert(!pVM->pgm.s.fMappingsFixed); Assert(!pVM->pgm.s.fMappingsDisabled); 1914 1912 } 1915 1913 } -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r25866 r25935 291 291 * The first thing we check is if we've got an undetected conflict. 292 292 */ 293 if ( !pVM->pgm.s.fMappingsFixed)293 if (pgmMapAreMappingsFloating(&pVM->pgm.s)) 294 294 { 295 295 unsigned iPT = pMapping->cb >> GST_PD_SHIFT; … … 2599 2599 # endif 2600 2600 } 2601 # else /* PGM_WITHOUT_MAPPINGS */ 2602 Assert(!pgmMapAreMappingsEnabled(&pVM->pgm.s)); 2603 # endif /* PGM_WITHOUT_MAPPINGS */ 2601 # endif /* !PGM_WITHOUT_MAPPINGS */ 2604 2602 Assert(!PdeDst.n.u1Present); /* We're only supposed to call SyncPT on PDE!P and conflicts.*/ 2605 2603 … … 3449 3447 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_MID_Z(Stat,SyncCR3Handlers), h); 3450 3448 pgmUnlock(pVM); 3451 #endif 3449 #endif /* !NESTED && !EPT */ 3452 3450 3453 3451 #if PGM_SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT … … 3457 3455 /** @todo check if this is really necessary; the call does it as well... */ 3458 3456 HWACCMFlushTLB(pVCpu); 3457 Assert(!pgmMapAreMappingsEnabled(&pVM->pgm.s)); 3459 3458 return VINF_SUCCESS; 3460 3459 … … 3464 3463 * out the shadow parts when the guest modifies its tables. 3465 3464 */ 3465 Assert(!pgmMapAreMappingsEnabled(&pVM->pgm.s)); 3466 3466 return VINF_SUCCESS; 3467 3467 3468 3468 #else /* PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT && PGM_SHW_TYPE != PGM_TYPE_AMD64 */ 3469 3469 3470 # ifdef PGM_WITHOUT_MAPPINGS 3471 Assert(pVM->pgm.s.fMappingsFixed); 3472 return VINF_SUCCESS; 3470 # ifndef PGM_WITHOUT_MAPPINGS 3471 /* 3472 * Check for and resolve conflicts with our guest mappings if they 3473 * are enabled and not fixed. 3474 */ 3475 if (pgmMapAreMappingsFloating(&pVM->pgm.s)) 3476 { 3477 int rc = pgmMapResolveConflicts(pVM); 3478 Assert(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3); 3479 if (rc == VINF_PGM_SYNC_CR3) 3480 { 3481 LogFlow(("SyncCR3: detected conflict -> VINF_PGM_SYNC_CR3\n")); 3482 return VINF_PGM_SYNC_CR3; 3483 } 3484 } 3473 3485 # else 3474 /* Nothing to do when mappings are fixed. */ 3475 if (pVM->pgm.s.fMappingsFixed) 3476 return VINF_SUCCESS; 3477 3478 int rc = PGMMapResolveConflicts(pVM); 3479 Assert(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3); 3480 if (rc == VINF_PGM_SYNC_CR3) 3481 { 3482 LogFlow(("SyncCR3: detected conflict -> VINF_PGM_SYNC_CR3\n")); 3483 return VINF_PGM_SYNC_CR3; 3484 } 3486 Assert(!pgmMapAreMappingsEnabled(&pVM->pgm.s)); 3485 3487 # endif 3486 3488 return VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMAll/PGMAllMap.cpp
r22890 r25935 389 389 Log(("pgmMapClearShadowPDEs: old pde %x (cPTs=%x) (mappings enabled %d) fDeactivateCR3=%RTbool\n", iOldPDE, pMap->cPTs, pgmMapAreMappingsEnabled(&pVM->pgm.s), fDeactivateCR3)); 390 390 391 /* 392 * Skip this if disabled or if it doesn't apply. 393 */ 391 394 if ( !pgmMapAreMappingsEnabled(&pVM->pgm.s) 392 395 || pVM->cCpus > 1) … … 602 605 return; 603 606 607 /* This only applies to raw mode where we only support 1 VCPU. */ 604 608 Assert(pVM->cCpus == 1); 605 606 /* This only applies to raw mode where we only support 1 VCPU. */607 609 PVMCPU pVCpu = VMMGetCpu0(pVM); 608 610 Assert(pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)); … … 633 635 { 634 636 /* 635 * Can skip this if mappings are disabled.637 * Skip this if disabled or if it doesn't apply. 636 638 */ 637 639 if ( !pgmMapAreMappingsEnabled(&pVM->pgm.s) … … 639 641 return VINF_SUCCESS; 640 642 641 /* Note. A log flush (in RC) can cause problems when called from MapCR3 (inconsistent state will trigger assertions). */ 642 Log4(("pgmMapActivateCR3: fixed mappings=%d idxShwPageCR3=%#x\n", pVM->pgm.s.fMappingsFixed, pShwPageCR3 ? pShwPageCR3->idx : NIL_PGMPOOL_IDX)); 643 /* Note! This might not be logged successfully in RC because we usually 644 cannot flush the log at this point. */ 645 Log4(("pgmMapActivateCR3: fixed mappings=%RTbool idxShwPageCR3=%#x\n", pVM->pgm.s.fMappingsFixed, pShwPageCR3 ? pShwPageCR3->idx : NIL_PGMPOOL_IDX)); 643 646 644 647 #ifdef VBOX_STRICT … … 669 672 { 670 673 /* 671 * Can skip this if mappings are disabled.674 * Skip this if disabled or if it doesn't apply. 672 675 */ 673 676 if ( !pgmMapAreMappingsEnabled(&pVM->pgm.s) … … 702 705 * Can skip this if mappings are safely fixed. 703 706 */ 704 if ( pVM->pgm.s.fMappingsFixed)707 if (!pgmMapAreMappingsFloating(&pVM->pgm.s)) 705 708 return false; 706 709 … … 788 791 789 792 /** 790 * Checks and resolves (ring 3 only) guest conflicts with VMM GCmappings.793 * Checks and resolves (ring 3 only) guest conflicts with the guest mappings. 791 794 * 792 795 * @returns VBox status. 793 796 * @param pVM The virtual machine. 794 797 */ 795 VMMDECL(int) PGMMapResolveConflicts(PVM pVM) 796 { 797 /* 798 * Can skip this if mappings are safely fixed. 799 */ 800 if (pVM->pgm.s.fMappingsFixed) 801 return VINF_SUCCESS; 802 798 int pgmMapResolveConflicts(PVM pVM) 799 { 800 /* The caller is expected to check these two conditions. */ 801 Assert(!pVM->pgm.s.fMappingsFixed); 802 Assert(!pVM->pgm.s.fMappingsDisabled); 803 804 /* This only applies to raw mode where we only support 1 VCPU. */ 803 805 Assert(pVM->cCpus == 1); 804 805 /* This only applies to raw mode where we only support 1 VCPU. */ 806 PVMCPU pVCpu = &pVM->aCpus[0]; 807 808 PGMMODE const enmGuestMode = PGMGetGuestMode(pVCpu); 806 PVMCPU pVCpu = &pVM->aCpus[0]; 807 PGMMODE const enmGuestMode = PGMGetGuestMode(pVCpu); 809 808 Assert(enmGuestMode <= PGMMODE_PAE_NX); 810 809
Note:
See TracChangeset
for help on using the changeset viewer.