Changeset 4917 in vbox
- Timestamp:
- Sep 20, 2007 10:06:48 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 24659
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm.h
r4811 r4917 91 91 /** Set the VM runtime error message. */ 92 92 VMMCALLHOST_VM_SET_RUNTIME_ERROR, 93 /** Signal a ring 0 hypervisor assertion. */ 94 VMMCALLHOST_VM_R0_HYPER_ASSERTION, 93 95 /** The usual 32-bit hack. */ 94 96 VMMCALLHOST_32BIT_HACK = 0x7fffffff -
trunk/include/iprt/assert.h
r4071 r4917 496 496 # endif 497 497 #elif defined(_MSC_VER) 498 # define AssertReleaseBreakpoint() __debugbreak() 498 # ifdef IN_VMM_R0 499 # define AssertReleaseBreakpoint() RTR0AssertBreakpoint(pVM) 500 # else 501 # define AssertReleaseBreakpoint() __debugbreak() 502 # endif 499 503 #else 500 504 # error "Unknown compiler" … … 1184 1188 1185 1189 1190 /** 1191 * Ring 0 VMM breakpoint function. 1192 * 1193 * Generates a guru meditation 1194 * 1195 * @remark does not return 1196 */ 1197 RTDECL(void) RTR0AssertBreakpoint(void *pVM); 1198 1186 1199 /** The last assert message, 1st part. */ 1187 1200 extern RTDATADECL(char) g_szRTAssertMsg1[1024]; -
trunk/src/VBox/VMM/PGMHandler.cpp
r4787 r4917 180 180 { 181 181 PPGMPHYSHANDLER pCur = (PPGMPHYSHANDLER)pNode; 182 unsigned fFlags = pgmHandlerPhysicalCalcFlags( pCur);182 unsigned fFlags = pgmHandlerPhysicalCalcFlags((PVM)pvUser, pCur); 183 183 PPGMRAMRANGE pRamHint = NULL; 184 184 RTGCPHYS GCPhys = pCur->Core.Key; … … 434 434 for (unsigned iPage = 0; iPage < pCur->cPages; iPage++) 435 435 if (pCur->aPhysToVirt[iPage].offNextAlias & PGMPHYS2VIRTHANDLER_IN_TREE) 436 pgmHandlerVirtualClearPage(p PGM, pCur, iPage);436 pgmHandlerVirtualClearPage(pVM, pPGM, pCur, iPage); 437 437 438 438 /* -
trunk/src/VBox/VMM/PGMInternal.h
r4787 r4917 2872 2872 * 2873 2873 * @returns The ram flags. 2874 * @param pCur The physical handler in question. 2875 */ 2876 DECLINLINE(unsigned) pgmHandlerPhysicalCalcFlags(PPGMPHYSHANDLER pCur) 2874 * @param pVM The VM handle. 2875 * @param pCur The physical handler in question. 2876 */ 2877 DECLINLINE(unsigned) pgmHandlerPhysicalCalcFlags(PVM pVM, PPGMPHYSHANDLER pCur) 2877 2878 { 2878 2879 switch (pCur->enmType) … … 2897 2898 * Clears one physical page of a virtual handler 2898 2899 * 2899 * @param p PGM Pointer to the PGM instance.2900 * @param pVM The VM handle. 2900 2901 * @param pCur Virtual handler structure 2901 2902 * @param iPage Physical page index 2902 2903 */ 2903 DECLINLINE(void) pgmHandlerVirtualClearPage(P PGM pPGM, PPGMVIRTHANDLER pCur, unsigned iPage)2904 DECLINLINE(void) pgmHandlerVirtualClearPage(PVM pVM, PPGM pPGM, PPGMVIRTHANDLER pCur, unsigned iPage) 2904 2905 { 2905 2906 const PPGMPHYS2VIRTHANDLER pPhys2Virt = &pCur->aPhysToVirt[iPage]; … … 3000 3001 * 3001 3002 * @returns Pointer to the shadow page structure. 3003 * @param pVM The VM handle. 3002 3004 * @param pPool The pool. 3003 3005 * @param HCPhys The HC physical address of the shadow page. 3004 3006 */ 3005 DECLINLINE(PPGMPOOLPAGE) pgmPoolGetPage(P PGMPOOL pPool, RTHCPHYS HCPhys)3007 DECLINLINE(PPGMPOOLPAGE) pgmPoolGetPage(PVM pVM, PPGMPOOL pPool, RTHCPHYS HCPhys) 3006 3008 { 3007 3009 /* … … 3018 3020 * 3019 3021 * @returns Pointer to the shadow page structure. 3022 * @param pVM The VM handle. 3020 3023 * @param pPool The pool. 3021 3024 * @param idx The pool page index. 3022 3025 */ 3023 DECLINLINE(PPGMPOOLPAGE) pgmPoolGetPageByIdx(P PGMPOOL pPool, unsigned idx)3026 DECLINLINE(PPGMPOOLPAGE) pgmPoolGetPageByIdx(PVM pVM, PPGMPOOL pPool, unsigned idx) 3024 3027 { 3025 3028 AssertFatalMsg(idx >= PGMPOOL_IDX_FIRST && idx < pPool->cCurPages, ("idx=%d\n", idx)); -
trunk/src/VBox/VMM/VMM.cpp
r4811 r4917 2233 2233 break; 2234 2234 2235 /* 2236 * Signal a ring 0 hypervisor assertion. 2237 */ 2238 case VMMCALLHOST_VM_R0_HYPER_ASSERTION: 2239 return VINF_EM_DBG_HYPER_ASSERTION; 2240 2235 2241 default: 2236 2242 AssertMsgFailed(("enmCallHostOperation=%d\n", pVM->vmm.s.enmCallHostOperation)); -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r4788 r4917 2673 2673 if (PdeDst.n.u1Present) 2674 2674 { 2675 PPGMPOOLPAGE pShwPage = pgmPoolGetPage(p Pool, PdeDst.u & SHW_PDE_PG_MASK);2675 PPGMPOOLPAGE pShwPage = pgmPoolGetPage(pVM, pPool, PdeDst.u & SHW_PDE_PG_MASK); 2676 2676 RTGCPHYS GCPhys; 2677 2677 if ( !PdeSrc.b.u1Size … … 2753 2753 if (pPDEDst->n.u1Present) 2754 2754 { 2755 pgmPoolFreeByPage(pPool, pgmPoolGetPage(p Pool, pPDEDst->u & SHW_PDE_PG_MASK), SHW_POOL_ROOT_IDX, iPdShw);2755 pgmPoolFreeByPage(pPool, pgmPoolGetPage(pVM, pPool, pPDEDst->u & SHW_PDE_PG_MASK), SHW_POOL_ROOT_IDX, iPdShw); 2756 2756 pPDEDst->u = 0; 2757 2757 MY_STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,SyncCR3DstFreedSrcNP)); -
trunk/src/VBox/VMM/VMMAll/PGMAllGst.h
r4787 r4917 609 609 PPGMVIRTHANDLER pCur = (PPGMVIRTHANDLER)pNode; 610 610 PPGMHVUSTATE pState = (PPGMHVUSTATE)pvUser; 611 PVM pVM = pState->pVM; 611 612 612 613 #if PGM_GST_TYPE == PGM_TYPE_32BIT 613 PX86PD pPDSrc = p State->pVM->pgm.s.CTXSUFF(pGuestPD);614 PX86PD pPDSrc = pVM->pgm.s.CTXSUFF(pGuestPD); 614 615 #endif 615 616 … … 667 668 { 668 669 if (pCur->aPhysToVirt[iPage].Core.Key != NIL_RTGCPHYS) 669 pgmHandlerVirtualClearPage( &pState->pVM->pgm.s, pCur, iPage);670 pgmHandlerVirtualClearPage(pState->pVM, &pState->pVM->pgm.s, pCur, iPage); 670 671 #ifdef VBOX_STRICT_PGM_HANDLER_VIRTUAL 671 672 AssertReleaseMsg(!pCur->aPhysToVirt[iPage].offNextAlias, … … 690 691 if (pCur->aPhysToVirt[iPage].Core.Key != NIL_RTGCPHYS) 691 692 { 692 pgmHandlerVirtualClearPage( &pState->pVM->pgm.s, pCur, iPage);693 pgmHandlerVirtualClearPage(pState->pVM, &pState->pVM->pgm.s, pCur, iPage); 693 694 #ifdef VBOX_STRICT_PGM_HANDLER_VIRTUAL 694 695 AssertReleaseMsg(!pCur->aPhysToVirt[iPage].offNextAlias, … … 717 718 { 718 719 if (pCur->aPhysToVirt[iPage].Core.Key != NIL_RTGCPHYS) 719 pgmHandlerVirtualClearPage( &pState->pVM->pgm.s, pCur, iPage);720 pgmHandlerVirtualClearPage(pState->pVM, &pState->pVM->pgm.s, pCur, iPage); 720 721 #ifdef VBOX_STRICT_PGM_HANDLER_VIRTUAL 721 722 AssertReleaseMsg(!pCur->aPhysToVirt[iPage].offNextAlias, … … 739 740 if (pCur->aPhysToVirt[iPage].Core.Key != NIL_RTGCPHYS) 740 741 { 741 pgmHandlerVirtualClearPage( &pState->pVM->pgm.s, pCur, iPage);742 pgmHandlerVirtualClearPage(pState->pVM, &pState->pVM->pgm.s, pCur, iPage); 742 743 pCur->aPhysToVirt[iPage].Core.Key = NIL_RTGCPHYS; 743 744 pState->fTodo |= PGM_SYNC_UPDATE_PAGE_BIT_VIRTUAL; -
trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
r4620 r4917 45 45 * Internal Functions * 46 46 *******************************************************************************/ 47 DECLINLINE(unsigned) pgmHandlerPhysicalCalcFlags(PPGMPHYSHANDLER pCur);48 47 static int pgmHandlerPhysicalSetRamFlagsAndFlushShadowPTs(PVM pVM, PPGMPHYSHANDLER pCur, PPGMRAMRANGE pRam); 49 48 static void pgmHandlerPhysicalDeregisterNotifyREM(PVM pVM, PPGMPHYSHANDLER pCur); … … 234 233 const int rc = VINF_PGM_GCPHYS_ALIASED; 235 234 #endif 236 const unsigned fFlags = pgmHandlerPhysicalCalcFlags(p Cur); Assert(!(fFlags & X86_PTE_PAE_PG_MASK));235 const unsigned fFlags = pgmHandlerPhysicalCalcFlags(pVM, pCur); Assert(!(fFlags & X86_PTE_PAE_PG_MASK)); 237 236 RTUINT cPages = pCur->cPages; 238 237 RTUINT i = (pCur->Core.Key - pRam->GCPhys) >> PAGE_SHIFT; … … 433 432 || (pBelow->Core.KeyLast >> PAGE_SHIFT) != (pCur->Core.Key >> PAGE_SHIFT)) 434 433 break; 435 pgmRamFlagsSetByGCPhysWithHint(pPGM, GCPhys, pgmHandlerPhysicalCalcFlags(p Cur), &pRamHint);434 pgmRamFlagsSetByGCPhysWithHint(pPGM, GCPhys, pgmHandlerPhysicalCalcFlags(pVM, pCur), &pRamHint); 436 435 437 436 /* next? */ … … 455 454 || (pAbove->Core.Key >> PAGE_SHIFT) != (pCur->Core.KeyLast >> PAGE_SHIFT)) 456 455 break; 457 pgmRamFlagsSetByGCPhysWithHint(pPGM, GCPhys, pgmHandlerPhysicalCalcFlags(p Cur), &pRamHint);456 pgmRamFlagsSetByGCPhysWithHint(pPGM, GCPhys, pgmHandlerPhysicalCalcFlags(pVM, pCur), &pRamHint); 458 457 459 458 /* next? */ -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r4620 r4917 43 43 static void pgmPoolFlushAllInt(PPGMPOOL pPool); 44 44 #ifdef PGMPOOL_WITH_USER_TRACKING 45 DECLINLINE(unsigned) pgmPoolTrackGetShadowEntrySize(P GMPOOLKIND enmKind);46 DECLINLINE(unsigned) pgmPoolTrackGetGuestEntrySize(P GMPOOLKIND enmKind);45 DECLINLINE(unsigned) pgmPoolTrackGetShadowEntrySize(PVM pVM, PGMPOOLKIND enmKind); 46 DECLINLINE(unsigned) pgmPoolTrackGetGuestEntrySize(PVM pVM, PGMPOOLKIND enmKind); 47 47 static void pgmPoolTrackDeref(PPGMPOOL pPool, PPGMPOOLPAGE pPage); 48 48 #endif … … 203 203 204 204 #elif defined(IN_RING0) 205 PVM pVM = pPool->CTXSUFF(pVM); 205 206 void *pvRet; 207 206 208 int rc = pgmRamGCPhys2HCPtr(&pPool->pVMHC->pgm.s, GCPhysFault & ~(RTGCPHYS)(cbEntry - 1), &pvRet); 207 209 AssertFatalRCSuccess(rc); … … 236 238 #endif 237 239 { 240 const PVM pVM = pPool->CTXSUFF(pVM); 241 238 242 Assert(pPage->iMonitoredPrev == NIL_PGMPOOL_IDX); 239 243 const unsigned off = GCPhysFault & PAGE_OFFSET_MASK; … … 248 252 PX86PDPAE pPDPae; 249 253 } uShw; 250 uShw.pv = PGMPOOL_PAGE_2_PTR(p Pool->CTXSUFF(pVM), pPage);254 uShw.pv = PGMPOOL_PAGE_2_PTR(pVM, pPage); 251 255 252 256 switch (pPage->enmKind) … … 310 314 if (uShw.pPD->a[iShw].u & PGM_PDFLAGS_MAPPING) 311 315 { 312 Assert(pgmMapAreMappingsEnabled(&p Pool->CTXSUFF(pVM)->pgm.s));313 VM_FF_SET(p Pool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3);316 Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 317 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3); 314 318 LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw=%#x!\n", iShw)); 315 319 } … … 324 328 && uShw.pPD->a[iShw2].u & PGM_PDFLAGS_MAPPING) 325 329 { 326 Assert(pgmMapAreMappingsEnabled(&p Pool->CTXSUFF(pVM)->pgm.s));327 VM_FF_SET(p Pool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3);330 Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 331 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3); 328 332 LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw2=%#x!\n", iShw2)); 329 333 } … … 331 335 #if 0 /* useful when running PGMAssertCR3(), a bit too troublesome for general use (TLBs). */ 332 336 if ( uShw.pPD->a[iShw].n.u1Present 333 && !VM_FF_ISSET(p Pool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3))337 && !VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3)) 334 338 { 335 339 LogFlow(("pgmPoolMonitorChainChanging: iShw=%#x: %RX32 -> freeing it!\n", iShw, uShw.pPD->a[iShw].u)); … … 337 341 ASMProbeReadByte(pvAddress); 338 342 # endif 339 pgmPoolFree(p Pool->CTXSUFF(pVM), uShw.pPD->a[iShw].u & X86_PDE_PG_MASK, pPage->idx, iShw);343 pgmPoolFree(pVM, uShw.pPD->a[iShw].u & X86_PDE_PG_MASK, pPage->idx, iShw); 340 344 uShw.pPD->a[iShw].u = 0; 341 345 } … … 351 355 if ((uShw.pPDPae->a[iShw].u & (PGM_PDFLAGS_MAPPING | X86_PDE_P)) == (PGM_PDFLAGS_MAPPING | X86_PDE_P)) 352 356 { 353 Assert(pgmMapAreMappingsEnabled(&p Pool->CTXSUFF(pVM)->pgm.s));354 VM_FF_SET(p Pool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3);357 Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 358 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3); 355 359 LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw=%#x!\n", iShw)); 356 360 } … … 364 368 && (uShw.pPDPae->a[iShw2].u & (PGM_PDFLAGS_MAPPING | X86_PDE_P)) == (PGM_PDFLAGS_MAPPING | X86_PDE_P)) 365 369 { 366 Assert(pgmMapAreMappingsEnabled(&p Pool->CTXSUFF(pVM)->pgm.s));367 VM_FF_SET(p Pool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3);370 Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 371 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3); 368 372 LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw2=%#x!\n", iShw2)); 369 373 } … … 371 375 #if 0 /* useful when running PGMAssertCR3(), a bit too troublesome for general use (TLBs). */ 372 376 if ( uShw.pPDPae->a[iShw].n.u1Present 373 && !VM_FF_ISSET(p Pool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3))377 && !VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3)) 374 378 { 375 379 LogFlow(("pgmPoolMonitorChainChanging: iShw=%#x: %RX64 -> freeing it!\n", iShw, uShw.pPDPae->a[iShw].u)); … … 377 381 ASMProbeReadByte(pvAddress); 378 382 # endif 379 pgmPoolFree(p Pool->CTXSUFF(pVM), uShw.pPDPae->a[iShw].u & X86_PDE_PAE_PG_MASK, pPage->idx, iShw);383 pgmPoolFree(pVM, uShw.pPDPae->a[iShw].u & X86_PDE_PAE_PG_MASK, pPage->idx, iShw); 380 384 uShw.pPDPae->a[iShw].u = 0; 381 385 } … … 781 785 DECLINLINE(void) pgmPoolHashRemove(PPGMPOOL pPool, PPGMPOOLPAGE pPage) 782 786 { 787 const PVM pVM = pPool->CTXSUFF(pVM); 788 783 789 uint16_t iHash = PGMPOOL_HASH(pPage->GCPhys); 784 790 if (pPool->aiHash[iHash] == pPage->idx) … … 818 824 static int pgmPoolCacheFreeOne(PPGMPOOL pPool, uint16_t iUser) 819 825 { 826 const PVM pVM = pPool->CTXSUFF(pVM); 827 820 828 Assert(pPool->iAgeHead != pPool->iAgeTail); /* We shouldn't be here if there < 2 cached entries! */ 821 829 STAM_COUNTER_INC(&pPool->StatCacheFreeUpOne); … … 856 864 * @returns true if reused and the cached page (enmKind1) should be flushed 857 865 * @returns false if not reused. 866 * @param pVM The VM handle. 858 867 * @param enmKind1 The kind of the cached page. 859 868 * @param enmKind2 The kind of the requested page. 860 869 */ 861 static bool pgmPoolCacheReusedByKind(P GMPOOLKIND enmKind1, PGMPOOLKIND enmKind2)870 static bool pgmPoolCacheReusedByKind(PVM pVM, PGMPOOLKIND enmKind1, PGMPOOLKIND enmKind2) 862 871 { 863 872 switch (enmKind1) … … 942 951 static int pgmPoolCacheAlloc(PPGMPOOL pPool, RTGCPHYS GCPhys, PGMPOOLKIND enmKind, uint16_t iUser, uint16_t iUserTable, PPPGMPOOLPAGE ppPage) 943 952 { 953 const PVM pVM = pPool->CTXSUFF(pVM); 954 944 955 /* 945 956 * Look up the GCPhys in the hash. … … 971 982 * different way than the other kinds. 972 983 */ 973 if (pgmPoolCacheReusedByKind( (PGMPOOLKIND)pPage->enmKind, enmKind))984 if (pgmPoolCacheReusedByKind(pVM, (PGMPOOLKIND)pPage->enmKind, enmKind)) 974 985 { 975 986 STAM_COUNTER_INC(&pPool->StatCacheKindMismatches); … … 1080 1091 { 1081 1092 #ifdef PGMPOOL_WITH_CACHE 1093 const PVM pVM = pPool->CTXSUFF(pVM); 1094 1082 1095 /* 1083 1096 * Look up the GCPhys in the hash. … … 1145 1158 static int pgmPoolMonitorInsert(PPGMPOOL pPool, PPGMPOOLPAGE pPage) 1146 1159 { 1160 const PVM pVM = pPool->CTXSUFF(pVM); 1161 1147 1162 /* 1148 1163 * Filter out the relevant kinds. … … 1196 1211 { 1197 1212 Assert(pPage->iMonitoredNext == NIL_PGMPOOL_IDX); Assert(pPage->iMonitoredPrev == NIL_PGMPOOL_IDX); 1198 PVM pVM = pPool->CTXSUFF(pVM);1199 1213 const RTGCPHYS GCPhysPage = pPage->GCPhys & ~(RTGCPHYS)(PAGE_SIZE - 1); 1200 1214 rc = PGMHandlerPhysicalRegisterEx(pVM, PGMPHYSHANDLERTYPE_PHYSICAL_WRITE, … … 1226 1240 static int pgmPoolMonitorFlush(PPGMPOOL pPool, PPGMPOOLPAGE pPage) 1227 1241 { 1242 const PVM pVM = pPool->CTXSUFF(pVM); 1243 1228 1244 /* 1229 1245 * Filter out the relevant kinds. … … 1261 1277 * Remove the page from the monitored list or uninstall it if last. 1262 1278 */ 1263 const PVM pVM = pPool->CTXSUFF(pVM);1264 1279 int rc; 1265 1280 if ( pPage->iMonitoredNext != NIL_PGMPOOL_IDX … … 1354 1369 int pgmPoolMonitorMonitorCR3(PPGMPOOL pPool, uint16_t idxRoot, RTGCPHYS GCPhysCR3) 1355 1370 { 1371 const PVM pVM = pPool->CTXSUFF(pVM); 1372 1356 1373 Assert(idxRoot != NIL_PGMPOOL_IDX && idxRoot < PGMPOOL_IDX_FIRST); 1357 1374 PPGMPOOLPAGE pPage = &pPool->aPages[idxRoot]; … … 1409 1426 int pgmPoolMonitorUnmonitorCR3(PPGMPOOL pPool, uint16_t idxRoot) 1410 1427 { 1428 const PVM pVM = pPool->CTXSUFF(pVM); 1429 1411 1430 Assert(idxRoot != NIL_PGMPOOL_IDX && idxRoot < PGMPOOL_IDX_FIRST); 1412 1431 PPGMPOOLPAGE pPage = &pPool->aPages[idxRoot]; … … 1851 1870 static void pgmPoolTrackFreeUser(PPGMPOOL pPool, PPGMPOOLPAGE pPage, uint16_t iUser, uint16_t iUserTable) 1852 1871 { 1872 const PVM pVM = pPool->CTXSUFF(pVM); 1873 1853 1874 /* 1854 1875 * Unlink and free the specified user entry. … … 1900 1921 * Gets the entry size of a shadow table. 1901 1922 * 1902 * @param enmKind1903 * 1923 * @param pVM The VM handle. 1924 * @param enmKind The kind of page. 1904 1925 * 1905 1926 * @returns The size of the entry in bytes. That is, 4 or 8. … … 1907 1928 * returned. 1908 1929 */ 1909 DECLINLINE(unsigned) pgmPoolTrackGetShadowEntrySize(P GMPOOLKIND enmKind)1930 DECLINLINE(unsigned) pgmPoolTrackGetShadowEntrySize(PVM pVM, PGMPOOLKIND enmKind) 1910 1931 { 1911 1932 switch (enmKind) … … 1939 1960 * Gets the entry size of a guest table. 1940 1961 * 1941 * @param enmKind1942 * 1962 * @param pVM The VM handle. 1963 * @param enmKind The kind of page. 1943 1964 * 1944 1965 * @returns The size of the entry in bytes. That is, 0, 4 or 8. … … 1946 1967 * returned. 1947 1968 */ 1948 DECLINLINE(unsigned) pgmPoolTrackGetGuestEntrySize(P GMPOOLKIND enmKind)1969 DECLINLINE(unsigned) pgmPoolTrackGetGuestEntrySize(PVM pVM, PGMPOOLKIND enmKind) 1949 1970 { 1950 1971 switch (enmKind) … … 2250 2271 uint32_t *pau32; 2251 2272 } u; 2252 u.pau64 = (uint64_t *)PGMPOOL_PAGE_2_PTR(pPool->CTXSUFF(pVM), pUserPage); 2273 const PVM pVM = pPool->CTXSUFF(pVM); 2274 2275 u.pau64 = (uint64_t *)PGMPOOL_PAGE_2_PTR(pVM, pUserPage); 2253 2276 2254 2277 #ifdef VBOX_STRICT … … 2524 2547 { 2525 2548 const unsigned cRefs = pPhysPage->HCPhys >> MM_RAM_FLAGS_CREFS_SHIFT; /** @todo PAGE FLAGS */ 2549 const PVM pVM = pPool->CTXSUFF(pVM); 2550 2526 2551 AssertFatalMsg(cRefs == MM_RAM_FLAGS_CREFS_PHYSEXT, ("cRefs=%d HCPhys=%RHp pPage=%p:{.idx=%d}\n", cRefs, pPhysPage->HCPhys, pPage, pPage->idx)); 2527 2552 … … 2552 2577 2553 2578 /* we can free the node. */ 2554 PVM pVM = pPool->CTXSUFF(pVM);2555 2579 const uint16_t iPhysExtNext = paPhysExts[iPhysExt].iNext; 2556 2580 if ( iPhysExtPrev == NIL_PGMPOOL_PHYSEXT_INDEX … … 2610 2634 static void pgmPoolTracDerefGCPhys(PPGMPOOL pPool, PPGMPOOLPAGE pPage, RTHCPHYS HCPhys, RTGCPHYS GCPhys) 2611 2635 { 2636 const PVM pVM = pPool->CTXSUFF(pVM); 2612 2637 /* 2613 2638 * Walk range list. 2614 2639 */ 2615 PPGMRAMRANGE pRam = p Pool->CTXSUFF(pVM)->pgm.s.CTXSUFF(pRamRanges);2640 PPGMRAMRANGE pRam = pVM->pgm.s.CTXSUFF(pRamRanges); 2616 2641 while (pRam) 2617 2642 { … … 2645 2670 static void pgmPoolTracDerefGCPhysHint(PPGMPOOL pPool, PPGMPOOLPAGE pPage, RTHCPHYS HCPhys, RTGCPHYS GCPhysHint) 2646 2671 { 2672 const PVM pVM = pPool->CTXSUFF(pVM); 2647 2673 /* 2648 2674 * Walk range list. 2649 2675 */ 2650 PPGMRAMRANGE pRam = p Pool->CTXSUFF(pVM)->pgm.s.CTXSUFF(pRamRanges);2676 PPGMRAMRANGE pRam = pVM->pgm.s.CTXSUFF(pRamRanges); 2651 2677 while (pRam) 2652 2678 { … … 2671 2697 */ 2672 2698 STAM_COUNTER_INC(&pPool->StatTrackLinearRamSearches); 2673 pRam = p Pool->CTXSUFF(pVM)->pgm.s.CTXSUFF(pRamRanges);2699 pRam = pVM->pgm.s.CTXSUFF(pRamRanges); 2674 2700 while (pRam) 2675 2701 { … … 2804 2830 DECLINLINE(void) pgmPoolTrackDerefPDPae(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PDPAE pShwPD) 2805 2831 { 2832 const PVM pVM = pPool->CTXSUFF(pVM); 2833 2806 2834 for (unsigned i = 0; i < ELEMENTS(pShwPD->a); i++) 2807 2835 { … … 2828 2856 DECLINLINE(void) pgmPoolTrackDerefPDPTR64Bit(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PDPTR pShwPdPtr) 2829 2857 { 2858 const PVM pVM = pPool->CTXSUFF(pVM); 2859 2830 2860 for (unsigned i = 0; i < ELEMENTS(pShwPdPtr->a); i++) 2831 2861 { … … 2853 2883 static void pgmPoolTrackDeref(PPGMPOOL pPool, PPGMPOOLPAGE pPage) 2854 2884 { 2885 const PVM pVM = pPool->CTXSUFF(pVM); 2886 2855 2887 /* 2856 2888 * Map the shadow page and take action according to the page kind. … … 3143 3175 if (pPage->fMonitored) 3144 3176 { 3145 PVM pVM = pPool->CTXSUFF(pVM);3177 const PVM pVM = pPool->CTXSUFF(pVM); 3146 3178 int rc = PGMHandlerPhysicalChangeCallbacks(pVM, pPage->GCPhys & ~(RTGCPHYS)(PAGE_SIZE - 1), 3147 3179 pPool->pfnAccessHandlerR3, MMHyperCCToR3(pVM, pPage), … … 3463 3495 LogFlow(("pgmPoolFree: HCPhys=%VHp iUser=%#x iUserTable=%#x\n", HCPhys, iUser, iUserTable)); 3464 3496 PPGMPOOL pPool = pVM->pgm.s.CTXSUFF(pPool); 3465 pgmPoolFreeByPage(pPool, pgmPoolGetPage(p Pool, HCPhys), iUser, iUserTable);3497 pgmPoolFreeByPage(pPool, pgmPoolGetPage(pVM, pPool, HCPhys), iUser, iUserTable); 3466 3498 } 3467 3499 … … 3479 3511 /** @todo profile this! */ 3480 3512 PPGMPOOL pPool = pVM->pgm.s.CTXSUFF(pPool); 3481 PPGMPOOLPAGE pPage = pgmPoolGetPage(p Pool, HCPhys);3513 PPGMPOOLPAGE pPage = pgmPoolGetPage(pVM, pPool, HCPhys); 3482 3514 Log3(("pgmPoolGetPageByHCPhys: HCPhys=%VHp -> %p:{.idx=%d .GCPhys=%VGp .enmKind=%d}\n", 3483 3515 HCPhys, pPage, pPage->idx, pPage->GCPhys, pPage->enmKind)); -
trunk/src/VBox/VMM/VMMAll/TMAll.cpp
r4787 r4917 696 696 TMDECL(uint64_t) TMTimerToNano(PTMTIMER pTimer, uint64_t u64Ticks) 697 697 { 698 PVM pVM = pTimer->CTXALLSUFF(pVM); NOREF(pVM); 699 698 700 switch (pTimer->enmClock) 699 701 { … … 729 731 TMDECL(uint64_t) TMTimerToMicro(PTMTIMER pTimer, uint64_t u64Ticks) 730 732 { 733 PVM pVM = pTimer->CTXALLSUFF(pVM); NOREF(pVM); 734 731 735 switch (pTimer->enmClock) 732 736 { … … 762 766 TMDECL(uint64_t) TMTimerToMilli(PTMTIMER pTimer, uint64_t u64Ticks) 763 767 { 768 PVM pVM = pTimer->CTXALLSUFF(pVM); NOREF(pVM); 769 764 770 switch (pTimer->enmClock) 765 771 { … … 794 800 TMDECL(uint64_t) TMTimerFromNano(PTMTIMER pTimer, uint64_t u64NanoTS) 795 801 { 802 PVM pVM = pTimer->CTXALLSUFF(pVM); NOREF(pVM); 803 796 804 switch (pTimer->enmClock) 797 805 { … … 826 834 TMDECL(uint64_t) TMTimerFromMicro(PTMTIMER pTimer, uint64_t u64MicroTS) 827 835 { 836 PVM pVM = pTimer->CTXALLSUFF(pVM); NOREF(pVM); 837 828 838 switch (pTimer->enmClock) 829 839 { … … 858 868 TMDECL(uint64_t) TMTimerFromMilli(PTMTIMER pTimer, uint64_t u64MilliTS) 859 869 { 870 PVM pVM = pTimer->CTXALLSUFF(pVM); NOREF(pVM); 871 860 872 switch (pTimer->enmClock) 861 873 { -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r4829 r4917 943 943 # define LOG_GROUP LOG_GROUP_EM 944 944 945 DECLEXPORT(void) RTCALL RTR0AssertBreakpoint(void *pvVM) 946 { 947 if (pvVM) 948 { 949 PVM pVM = (PVM)pvVM; 950 pVM->vmm.s.enmCallHostOperation = VMMCALLHOST_VM_R0_HYPER_ASSERTION; 951 pVM->vmm.s.u64CallHostArg = 0; 952 pVM->vmm.s.rcCallHost = VERR_INTERNAL_ERROR; 953 int rc = vmmR0CallHostLongJmp(&pVM->vmm.s.CallHostR0JmpBuf, VERR_INTERNAL_ERROR); 954 if (rc == VINF_SUCCESS) 955 rc = pVM->vmm.s.rcCallHost; 956 } 957 } 958 945 959 /** Runtime assert implementation for Native Win32 Ring-0. */ 946 960 DECLEXPORT(void) RTCALL AssertMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
Note:
See TracChangeset
for help on using the changeset viewer.