Changeset 73250 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Jul 19, 2018 5:57:31 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123856
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r73249 r73250 898 898 * Call the worker. 899 899 */ 900 uintptr_t const idxBth = pVCpu->pgm.s.idxBothModeData; 901 AssertReturn(idxBth < RT_ELEMENTS(g_aPgmBothModeData), VERR_PGM_MODE_IPE); 902 AssertReturn(g_aPgmBothModeData[idxBth].pfnTrap0eHandler, VERR_PGM_MODE_IPE); 900 903 bool fLockTaken = false; 901 int rc = PGM_BTH_PFN(Trap0eHandler, pVCpu)(pVCpu, uErr, pRegFrame, pvFault, &fLockTaken);904 int rc = g_aPgmBothModeData[idxBth].pfnTrap0eHandler(pVCpu, uErr, pRegFrame, pvFault, &fLockTaken); 902 905 if (fLockTaken) 903 906 { … … 953 956 { 954 957 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,Prefetch), a); 955 int rc = PGM_BTH_PFN(PrefetchPage, pVCpu)(pVCpu, GCPtrPage); 958 959 uintptr_t const idxBth = pVCpu->pgm.s.idxBothModeData; 960 AssertReturn(idxBth < RT_ELEMENTS(g_aPgmBothModeData), VERR_PGM_MODE_IPE); 961 AssertReturn(g_aPgmBothModeData[idxBth].pfnPrefetchPage, VERR_PGM_MODE_IPE); 962 int rc = g_aPgmBothModeData[idxBth].pfnPrefetchPage(pVCpu, GCPtrPage); 963 956 964 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,Prefetch), a); 957 965 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 || RT_FAILURE(rc), ("rc=%Rrc\n", rc)); … … 1095 1103 */ 1096 1104 Assert(X86_TRAP_PF_RW == X86_PTE_RW && X86_TRAP_PF_US == X86_PTE_US); 1097 uint32_t uErr = fAccess & (X86_TRAP_PF_RW | X86_TRAP_PF_US); 1098 rc = PGM_BTH_PFN(VerifyAccessSyncPage, pVCpu)(pVCpu, Addr, fPageGst, uErr); 1105 uint32_t const uErr = fAccess & (X86_TRAP_PF_RW | X86_TRAP_PF_US); 1106 uintptr_t const idxBth = pVCpu->pgm.s.idxBothModeData; 1107 AssertReturn(idxBth < RT_ELEMENTS(g_aPgmBothModeData), VERR_PGM_MODE_IPE); 1108 AssertReturn(g_aPgmBothModeData[idxBth].pfnVerifyAccessSyncPage, VERR_PGM_MODE_IPE); 1109 rc = g_aPgmBothModeData[idxBth].pfnVerifyAccessSyncPage(pVCpu, Addr, fPageGst, uErr); 1099 1110 if (rc != VINF_SUCCESS) 1100 1111 return rc; … … 1205 1216 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePage), a); 1206 1217 pgmLock(pVM); 1207 rc = PGM_BTH_PFN(InvalidatePage, pVCpu)(pVCpu, GCPtrPage); 1218 1219 uintptr_t const idxBth = pVCpu->pgm.s.idxBothModeData; 1220 AssertReturnStmt(idxBth < RT_ELEMENTS(g_aPgmBothModeData), pgmUnlock(pVM), VERR_PGM_MODE_IPE); 1221 AssertReturnStmt(g_aPgmBothModeData[idxBth].pfnInvalidatePage, pgmUnlock(pVM), VERR_PGM_MODE_IPE); 1222 rc = g_aPgmBothModeData[idxBth].pfnInvalidatePage(pVCpu, GCPtrPage); 1223 1208 1224 pgmUnlock(pVM); 1209 1225 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePage), a); … … 2558 2574 if (pVCpu->pgm.s.GCPhysCR3 != GCPhysCR3) 2559 2575 { 2560 RTGCPHYS GCPhysOldCR3 = pVCpu->pgm.s.GCPhysCR3; 2561 pVCpu->pgm.s.GCPhysCR3 = GCPhysCR3; 2562 rc = PGM_BTH_PFN(MapCR3, pVCpu)(pVCpu, GCPhysCR3); 2576 RTGCPHYS const GCPhysOldCR3 = pVCpu->pgm.s.GCPhysCR3; 2577 2578 uintptr_t const idxBth = pVCpu->pgm.s.idxBothModeData; 2579 AssertReturn(idxBth < RT_ELEMENTS(g_aPgmBothModeData), VERR_PGM_MODE_IPE); 2580 AssertReturn(g_aPgmBothModeData[idxBth].pfnMapCR3, VERR_PGM_MODE_IPE); 2581 2582 pVCpu->pgm.s.GCPhysCR3 = GCPhysCR3; 2583 rc = g_aPgmBothModeData[idxBth].pfnMapCR3(pVCpu, GCPhysCR3); 2563 2584 if (RT_LIKELY(rc == VINF_SUCCESS)) 2564 2585 { … … 2662 2683 if (pVCpu->pgm.s.GCPhysCR3 != GCPhysCR3) 2663 2684 { 2685 uintptr_t const idxBth = pVCpu->pgm.s.idxBothModeData; 2686 AssertReturn(idxBth < RT_ELEMENTS(g_aPgmBothModeData), VERR_PGM_MODE_IPE); 2687 AssertReturn(g_aPgmBothModeData[idxBth].pfnMapCR3, VERR_PGM_MODE_IPE); 2688 2664 2689 pVCpu->pgm.s.GCPhysCR3 = GCPhysCR3; 2665 rc = PGM_BTH_PFN(MapCR3, pVCpu)(pVCpu, GCPhysCR3); 2690 rc = g_aPgmBothModeData[idxBth].pfnMapCR3(pVCpu, GCPhysCR3); 2691 2666 2692 AssertRCSuccess(rc); /* Assumes VINF_PGM_SYNC_CR3 doesn't apply to nested paging. */ /** @todo this isn't true for the mac, but we need hw to test/fix this. */ 2667 2693 } … … 2752 2778 if (pVCpu->pgm.s.GCPhysCR3 != GCPhysCR3) 2753 2779 { 2780 uintptr_t const idxBth = pVCpu->pgm.s.idxBothModeData; 2781 AssertReturn(idxBth < RT_ELEMENTS(g_aPgmBothModeData), VERR_PGM_MODE_IPE); 2782 AssertReturn(g_aPgmBothModeData[idxBth].pfnMapCR3, VERR_PGM_MODE_IPE); 2754 2783 pVCpu->pgm.s.GCPhysCR3 = GCPhysCR3; 2755 rc = PGM_BTH_PFN(MapCR3, pVCpu)(pVCpu, GCPhysCR3);2784 rc = g_aPgmBothModeData[idxBth].pfnMapCR3(pVCpu, GCPhysCR3); 2756 2785 } 2757 2786 … … 2777 2806 */ 2778 2807 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncCR3), a); 2779 rc = PGM_BTH_PFN(SyncCR3, pVCpu)(pVCpu, cr0, cr3, cr4, fGlobal); 2808 2809 uintptr_t const idxBth = pVCpu->pgm.s.idxBothModeData; 2810 AssertReturn(idxBth < RT_ELEMENTS(g_aPgmBothModeData), VERR_PGM_MODE_IPE); 2811 AssertReturn(g_aPgmBothModeData[idxBth].pfnSyncCR3, VERR_PGM_MODE_IPE); 2812 rc = g_aPgmBothModeData[idxBth].pfnSyncCR3(pVCpu, cr0, cr3, cr4, fGlobal); 2813 2780 2814 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncCR3), a); 2781 2815 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 || RT_FAILURE(rc), ("rc=%Rrc\n", rc)); … … 3419 3453 { 3420 3454 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncCR3), a); 3455 3456 uintptr_t const idxBth = pVCpu->pgm.s.idxBothModeData; 3457 AssertReturn(idxBth < RT_ELEMENTS(g_aPgmBothModeData), -VERR_PGM_MODE_IPE); 3458 AssertReturn(g_aPgmBothModeData[idxBth].pfnAssertCR3, -VERR_PGM_MODE_IPE); 3459 3421 3460 pgmLock(pVM); 3422 unsigned cErrors = PGM_BTH_PFN(AssertCR3, pVCpu)(pVCpu, cr3, cr4, 0, ~(RTGCPTR)0);3461 unsigned cErrors = g_aPgmBothModeData[idxBth].pfnAssertCR3(pVCpu, cr3, cr4, 0, ~(RTGCPTR)0); 3423 3462 pgmUnlock(pVM); 3463 3424 3464 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncCR3), a); 3425 3465 return cErrors;
Note:
See TracChangeset
for help on using the changeset viewer.