Changeset 86475 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Oct 7, 2020 7:02:36 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 140785
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r86472 r86475 265 265 for (unsigned i = 0; i < 2; i++) 266 266 { 267 if (uShw.pPDPae->a[iShw+i].n.u1Present) 267 X86PGPAEUINT const uPde = uShw.pPDPae->a[iShw + i].u; 268 if (uPde & X86_PDE_P) 268 269 { 269 LogFlow(("pgmPoolMonitorChainChanging: pae pd iShw=%#x: %RX64 -> freeing it!\n", iShw+i, uShw.pPDPae->a[iShw+i].u)); 270 pgmPoolFree(pVM, 271 uShw.pPDPae->a[iShw+i].u & X86_PDE_PAE_PG_MASK, 272 pPage->idx, 273 iShw + i); 274 ASMAtomicWriteU64(&uShw.pPDPae->a[iShw+i].u, 0); 270 LogFlow(("pgmPoolMonitorChainChanging: pae pd iShw=%#x: %RX64 -> freeing it!\n", iShw + i, uPde)); 271 pgmPoolFree(pVM, uPde & X86_PDE_PAE_PG_MASK, pPage->idx, iShw + i); 272 ASMAtomicWriteU64(&uShw.pPDPae->a[iShw + i].u, 0); 275 273 } 276 274 … … 282 280 if (iShw2 < RT_ELEMENTS(uShw.pPDPae->a)) 283 281 { 284 if (uShw.pPDPae->a[iShw2].n.u1Present) 282 X86PGPAEUINT const uPde2 = uShw.pPDPae->a[iShw2].u; 283 if (uPde2 & X86_PDE_P) 285 284 { 286 LogFlow(("pgmPoolMonitorChainChanging: pae pd iShw=%#x: %RX64 -> freeing it!\n", iShw2, uShw.pPDPae->a[iShw2].u)); 287 pgmPoolFree(pVM, 288 uShw.pPDPae->a[iShw2].u & X86_PDE_PAE_PG_MASK, 289 pPage->idx, 290 iShw2); 285 LogFlow(("pgmPoolMonitorChainChanging: pae pd iShw=%#x: %RX64 -> freeing it!\n", iShw2, uPde2)); 286 pgmPoolFree(pVM, uPde2 & X86_PDE_PAE_PG_MASK, pPage->idx, iShw2); 291 287 ASMAtomicWriteU64(&uShw.pPDPae->a[iShw2].u, 0); 292 288 } … … 400 396 * table entries -> recheck; probably only applies to the RC case.) 401 397 */ 402 if (uShw.pPDPae->a[iShw].n.u1Present) 398 X86PGPAEUINT const uPde = uShw.pPDPae->a[iShw].u; 399 if (uPde & X86_PDE_P) 403 400 { 404 LogFlow(("pgmPoolMonitorChainChanging: pae pd iShw=%#x: %RX64 -> freeing it!\n", iShw, uShw.pPDPae->a[iShw].u)); 405 pgmPoolFree(pVM, 406 uShw.pPDPae->a[iShw].u & X86_PDE_PAE_PG_MASK, 407 pPage->idx, 408 iShw); 401 LogFlow(("pgmPoolMonitorChainChanging: pae pd iShw=%#x: %RX64 -> freeing it!\n", iShw, uPde)); 402 pgmPoolFree(pVM, uPde & X86_PDE_PAE_PG_MASK, pPage->idx, iShw); 409 403 ASMAtomicWriteU64(&uShw.pPDPae->a[iShw].u, 0); 410 404 } … … 417 411 AssertBreak(iShw2 < RT_ELEMENTS(uShw.pPDPae->a)); 418 412 419 if (uShw.pPDPae->a[iShw2].n.u1Present) 413 X86PGPAEUINT const uPde2 = uShw.pPDPae->a[iShw2].u; 414 if (uPde2 & X86_PDE_P) 420 415 { 421 LogFlow(("pgmPoolMonitorChainChanging: pae pd iShw2=%#x: %RX64 -> freeing it!\n", iShw2, uShw.pPDPae->a[iShw2].u)); 422 pgmPoolFree(pVM, 423 uShw.pPDPae->a[iShw2].u & X86_PDE_PAE_PG_MASK, 424 pPage->idx, 425 iShw2); 416 LogFlow(("pgmPoolMonitorChainChanging: pae pd iShw2=%#x: %RX64 -> freeing it!\n", iShw2, uPde2)); 417 pgmPoolFree(pVM, uPde2 & X86_PDE_PAE_PG_MASK, pPage->idx, iShw2); 426 418 ASMAtomicWriteU64(&uShw.pPDPae->a[iShw2].u, 0); 427 419 } … … 479 471 uShw.pv = PGMPOOL_PAGE_2_PTR(pVM, pPage); 480 472 const unsigned iShw = off / sizeof(X86PDEPAE); 473 X86PGPAEUINT const uPde = uShw.pPDPae->a[iShw].u; 481 474 #ifndef PGM_WITHOUT_MAPPINGS 482 Assert(!(u Shw.pPDPae->a[iShw].u& PGM_PDFLAGS_MAPPING));475 Assert(!(uPde & PGM_PDFLAGS_MAPPING)); 483 476 #endif 484 if (u Shw.pPDPae->a[iShw].n.u1Present)477 if (uPde & X86_PDE_P) 485 478 { 486 LogFlow(("pgmPoolMonitorChainChanging: pae pd iShw=%#x: %RX64 -> freeing it!\n", iShw, uShw.pPDPae->a[iShw].u)); 487 pgmPoolFree(pVM, 488 uShw.pPDPae->a[iShw].u & X86_PDE_PAE_PG_MASK, 489 pPage->idx, 490 iShw); 479 LogFlow(("pgmPoolMonitorChainChanging: pae pd iShw=%#x: %RX64 -> freeing it!\n", iShw, uPde)); 480 pgmPoolFree(pVM, uPde & X86_PDE_PAE_PG_MASK, pPage->idx, iShw); 491 481 ASMAtomicWriteU64(&uShw.pPDPae->a[iShw].u, 0); 492 482 } 483 493 484 /* paranoia / a bit assumptive. */ 494 485 if ( (off & 7) … … 497 488 const unsigned iShw2 = (off + cbWrite - 1) / sizeof(X86PDEPAE); 498 489 AssertBreak(iShw2 < RT_ELEMENTS(uShw.pPDPae->a)); 499 490 X86PGPAEUINT const uPde2 = uShw.pPDPae->a[iShw2].u; 500 491 #ifndef PGM_WITHOUT_MAPPINGS 501 Assert(!(u Shw.pPDPae->a[iShw2].u& PGM_PDFLAGS_MAPPING));492 Assert(!(uPde2 & PGM_PDFLAGS_MAPPING)); 502 493 #endif 503 if (u Shw.pPDPae->a[iShw2].n.u1Present)494 if (uPde2 & X86_PDE_P) 504 495 { 505 LogFlow(("pgmPoolMonitorChainChanging: pae pd iShw2=%#x: %RX64 -> freeing it!\n", iShw2, uShw.pPDPae->a[iShw2].u)); 506 pgmPoolFree(pVM, 507 uShw.pPDPae->a[iShw2].u & X86_PDE_PAE_PG_MASK, 508 pPage->idx, 509 iShw2); 496 LogFlow(("pgmPoolMonitorChainChanging: pae pd iShw2=%#x: %RX64 -> freeing it!\n", iShw2, uPde2)); 497 pgmPoolFree(pVM, uPde2 & X86_PDE_PAE_PG_MASK, pPage->idx, iShw2); 510 498 ASMAtomicWriteU64(&uShw.pPDPae->a[iShw2].u, 0); 511 499 } … … 4522 4510 for (unsigned i = 0; i < RT_ELEMENTS(pShwPD->a); i++) 4523 4511 { 4524 if ( pShwPD->a[i].n.u1Present4512 X86PGPAEUINT const uPde = pShwPD->a[i].u; 4525 4513 #ifndef PGM_WITHOUT_MAPPINGS 4526 && !(pShwPD->a[i].u & PGM_PDFLAGS_MAPPING) 4514 if ((uPde & (X86_PDE_P | PGM_PDFLAGS_MAPPING)) == X86_PDE_P) 4515 #else 4516 if (uPde & X86_PDE_P) 4527 4517 #endif 4528 )4529 4518 { 4530 4519 #ifdef PGM_WITH_LARGE_PAGES 4531 if ( pShwPD->a[i].b.u1Size)4520 if (uPde & X86_PDE_PS) 4532 4521 { 4533 4522 Log4(("pgmPoolTrackDerefPDPae: i=%d pde=%RX64 GCPhys=%RX64\n", 4534 i, pShwPD->a[i].u& X86_PDE2M_PAE_PG_MASK, pPage->GCPhys));4535 pgmPoolTracDerefGCPhys(pPool, pPage, pShwPD->a[i].u& X86_PDE2M_PAE_PG_MASK,4523 i, uPde & X86_PDE2M_PAE_PG_MASK, pPage->GCPhys)); 4524 pgmPoolTracDerefGCPhys(pPool, pPage, uPde & X86_PDE2M_PAE_PG_MASK, 4536 4525 pPage->GCPhys + i * 2 * _1M /* pPage->GCPhys = base address of the memory described by the PD */, 4537 4526 i); … … 4540 4529 #endif 4541 4530 { 4542 Assert(( pShwPD->a[i].u& (X86_PDE_PAE_MBZ_MASK_NX | UINT64_C(0x7ff0000000000000))) == 0);4543 PPGMPOOLPAGE pSubPage = (PPGMPOOLPAGE)RTAvloHCPhysGet(&pPool->HCPhysTree, pShwPD->a[i].u& X86_PDE_PAE_PG_MASK);4531 Assert((uPde & (X86_PDE_PAE_MBZ_MASK_NX | UINT64_C(0x7ff0000000000000))) == 0); 4532 PPGMPOOLPAGE pSubPage = (PPGMPOOLPAGE)RTAvloHCPhysGet(&pPool->HCPhysTree, uPde & X86_PDE_PAE_PG_MASK); 4544 4533 if (pSubPage) 4545 4534 pgmPoolTrackFreeUser(pPool, pSubPage, pPage->idx, i); 4546 4535 else 4547 AssertFatalMsgFailed(("%RX64\n", pShwPD->a[i].u& X86_PDE_PAE_PG_MASK));4536 AssertFatalMsgFailed(("%RX64\n", uPde & X86_PDE_PAE_PG_MASK)); 4548 4537 /** @todo 64-bit guests: have to ensure that we're not exhausting the dynamic mappings! */ 4549 4538 }
Note:
See TracChangeset
for help on using the changeset viewer.