Changeset 16172 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Jan 22, 2009 3:09:31 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r15990 r16172 931 931 * trustworthy? (Remove pgmGstGetLongModePML4E if pGstPml4e and pGstPdpe 932 932 * are fine.) */ 933 Assert(pVM->pgm.s.CTX_SUFF(pShw Amd64CR3));933 Assert(pVM->pgm.s.CTX_SUFF(pShwPageCR3)); 934 934 Pml4eGst = pgmGstGetLongModePML4E(&pVM->pgm.s, iPml4); 935 935 936 936 rc = pgmPoolAlloc(pVM, Pml4eGst.u & X86_PML4E_PG_MASK, 937 PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT, pVM->pgm.s.CTX_SUFF(pShw Amd64CR3)->idx, iPml4, &pShwPage);937 PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4, &pShwPage); 938 938 } 939 939 else … … 1275 1275 case PGMMODE_AMD64: 1276 1276 case PGMMODE_AMD64_NX: 1277 return pVM->pgm.s.HCPhysShw PaePml4;1277 return pVM->pgm.s.HCPhysShwCR3; 1278 1278 1279 1279 case PGMMODE_EPT: … … 1308 1308 case PGMMODE_AMD64: 1309 1309 case PGMMODE_AMD64_NX: 1310 return pVM->pgm.s.HCPhysShw PaePml4;1310 return pVM->pgm.s.HCPhysShwCR3; 1311 1311 1312 1312 default: … … 1357 1357 VMMDECL(RTHCPHYS) PGMGetHyperAmd64CR3(PVM pVM) 1358 1358 { 1359 return pVM->pgm.s.HCPhysShw PaePml4;1359 return pVM->pgm.s.HCPhysShwCR3; 1360 1360 } 1361 1361 -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r15410 r16172 910 910 # else /* PGM_SHW_TYPE == PGM_TYPE_AMD64 */ 911 911 /* PML4 */ 912 AssertReturn( pVM->pgm.s.pShwPaePml4R3, VERR_INTERNAL_ERROR);912 AssertReturn(CTX_SUFF(pVM->pgm.s.pShwRoot), VERR_INTERNAL_ERROR); 913 913 914 914 const unsigned iPml4 = (GCPtrPage >> X86_PML4_SHIFT) & X86_PML4_MASK; … … 1021 1021 LogFlow(("InvalidatePage: Out-of-sync PML4E (P/GCPhys) at %RGv GCPhys=%RGp vs %RGp Pml4eSrc=%RX64 Pml4eDst=%RX64\n", 1022 1022 GCPtrPage, pShwPdpt->GCPhys, GCPhysPdpt, (uint64_t)pPml4eSrc->u, (uint64_t)pPml4eDst->u)); 1023 pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.CTX_SUFF(pShw Amd64CR3)->idx, iPml4);1023 pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4); 1024 1024 pPml4eDst->u = 0; 1025 1025 STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNPs)); … … 1035 1035 LogFlow(("InvalidatePage: Out-of-sync PML4E at %RGv Pml4eSrc=%RX64 Pml4eDst=%RX64\n", 1036 1036 GCPtrPage, (uint64_t)pPml4eSrc->u, (uint64_t)pPml4eDst->u)); 1037 pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.CTX_SUFF(pShw Amd64CR3)->idx, iPml4);1037 pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4); 1038 1038 pPml4eDst->u = 0; 1039 1039 STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDOutOfSync)); … … 1047 1047 LogFlow(("InvalidatePage: Out-of-sync PML4E (A) at %RGv Pml4eSrc=%RX64 Pml4eDst=%RX64\n", 1048 1048 GCPtrPage, (uint64_t)pPml4eSrc->u, (uint64_t)pPml4eDst->u)); 1049 pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.CTX_SUFF(pShw Amd64CR3)->idx, iPml4);1049 pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4); 1050 1050 pPml4eDst->u = 0; 1051 1051 STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNAs)); -
trunk/src/VBox/VMM/VMMAll/PGMAllGst.h
r15410 r16172 517 517 /** @todo Move this into PGMAllBth.h. */ 518 518 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 519 if (pVM->pgm.s.CTX_SUFF(pShw Amd64CR3))519 if (pVM->pgm.s.CTX_SUFF(pShwPageCR3)) 520 520 { 521 521 /* It might have been freed already by a pool flush (see e.g. PGMR3MappingsUnfix). */ 522 522 /** @todo Coordinate this better with the pool. */ 523 if (pVM->pgm.s.CTX_SUFF(pShw Amd64CR3)->enmKind != PGMPOOLKIND_FREE)524 pgmPoolFreeByPage(pPool, pVM->pgm.s.CTX_SUFF(pShw Amd64CR3), PGMPOOL_IDX_AMD64_CR3, pVM->pgm.s.CTX_SUFF(pShwAmd64CR3)->GCPhys >> PAGE_SHIFT);525 pVM->pgm.s.pShw Amd64CR3R3= 0;526 pVM->pgm.s.pShw Amd64CR3R0= 0;527 pVM->pgm.s.pShw PaePml4R3 = 0;523 if (pVM->pgm.s.CTX_SUFF(pShwPageCR3)->enmKind != PGMPOOLKIND_FREE) 524 pgmPoolFreeByPage(pPool, pVM->pgm.s.CTX_SUFF(pShwPageCR3), PGMPOOL_IDX_AMD64_CR3, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->GCPhys >> PAGE_SHIFT); 525 pVM->pgm.s.pShwPageCR3R3 = 0; 526 pVM->pgm.s.pShwPageCR3R0 = 0; 527 pVM->pgm.s.pShwRootR3 = 0; 528 528 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 529 pVM->pgm.s.pShw PaePml4R0 = 0;529 pVM->pgm.s.pShwRootR0 = 0; 530 530 # endif 531 pVM->pgm.s.HCPhysShw PaePml4= 0;531 pVM->pgm.s.HCPhysShwCR3 = 0; 532 532 } 533 533 534 534 Assert(!(GCPhysCR3 >> (PAGE_SHIFT + 32))); 535 rc = pgmPoolAlloc(pVM, GCPhysCR3, PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4, PGMPOOL_IDX_AMD64_CR3, GCPhysCR3 >> PAGE_SHIFT, &pVM->pgm.s.CTX_SUFF(pShw Amd64CR3));535 rc = pgmPoolAlloc(pVM, GCPhysCR3, PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4, PGMPOOL_IDX_AMD64_CR3, GCPhysCR3 >> PAGE_SHIFT, &pVM->pgm.s.CTX_SUFF(pShwPageCR3)); 536 536 if (rc == VERR_PGM_POOL_FLUSHED) 537 537 { … … 542 542 AssertRCReturn(rc, rc); 543 543 # ifdef IN_RING0 544 pVM->pgm.s.pShw Amd64CR3R3 = MMHyperCCToR3(pVM, pVM->pgm.s.CTX_SUFF(pShwAmd64CR3));544 pVM->pgm.s.pShwPageCR3R3 = MMHyperCCToR3(pVM, pVM->pgm.s.CTX_SUFF(pShwPageCR3)); 545 545 # else 546 pVM->pgm.s.pShw Amd64CR3R0 = MMHyperCCToR0(pVM, pVM->pgm.s.CTX_SUFF(pShwAmd64CR3));546 pVM->pgm.s.pShwPageCR3R0 = MMHyperCCToR0(pVM, pVM->pgm.s.CTX_SUFF(pShwPageCR3)); 547 547 # endif 548 pVM->pgm.s.pShw PaePml4R3 = (R3PTRTYPE(PX86PML4))pVM->pgm.s.CTX_SUFF(pShwAmd64CR3)->pvPageR3;549 Assert(pVM->pgm.s.pShw PaePml4R3);548 pVM->pgm.s.pShwRootR3 = (R3PTRTYPE(void *))pVM->pgm.s.CTX_SUFF(pShwPageCR3)->pvPageR3; 549 Assert(pVM->pgm.s.pShwRootR3); 550 550 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 551 pVM->pgm.s.pShw PaePml4R0 = (R0PTRTYPE(PX86PML4))PGMPOOL_PAGE_2_PTR(pPool->CTX_SUFF(pVM), pVM->pgm.s.CTX_SUFF(pShwAmd64CR3));551 pVM->pgm.s.pShwRootR0 = (R0PTRTYPE(void *))PGMPOOL_PAGE_2_PTR(pPool->CTX_SUFF(pVM), pVM->pgm.s.CTX_SUFF(pShwPageCR3)); 552 552 # endif 553 pVM->pgm.s.HCPhysShw PaePml4 = pVM->pgm.s.CTX_SUFF(pShwAmd64CR3)->Core.Key;553 pVM->pgm.s.HCPhysShwCR3 = pVM->pgm.s.CTX_SUFF(pShwPageCR3)->Core.Key; 554 554 rc = VINF_SUCCESS; /* clear it - pgmPoolAlloc returns hints. */ 555 555 } … … 611 611 if (!HWACCMIsNestedPagingActive(pVM)) 612 612 { 613 pVM->pgm.s.pShw PaePml4R3 = 0;613 pVM->pgm.s.pShwRootR3 = 0; 614 614 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 615 pVM->pgm.s.pShw PaePml4R0 = 0;616 # endif 617 pVM->pgm.s.HCPhysShw PaePml4= 0;618 if (pVM->pgm.s.CTX_SUFF(pShw Amd64CR3))615 pVM->pgm.s.pShwRootR0 = 0; 616 # endif 617 pVM->pgm.s.HCPhysShwCR3 = 0; 618 if (pVM->pgm.s.CTX_SUFF(pShwPageCR3)) 619 619 { 620 620 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 621 pgmPoolFreeByPage(pPool, pVM->pgm.s.CTX_SUFF(pShw Amd64CR3), PGMPOOL_IDX_AMD64_CR3, pVM->pgm.s.CTX_SUFF(pShwAmd64CR3)->GCPhys >> PAGE_SHIFT);622 pVM->pgm.s.pShw Amd64CR3R3 = 0;623 pVM->pgm.s.pShw Amd64CR3R0 = 0;621 pgmPoolFreeByPage(pPool, pVM->pgm.s.CTX_SUFF(pShwPageCR3), PGMPOOL_IDX_AMD64_CR3, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->GCPhys >> PAGE_SHIFT); 622 pVM->pgm.s.pShwPageCR3R3 = 0; 623 pVM->pgm.s.pShwPageCR3R0 = 0; 624 624 } 625 625 }
Note:
See TracChangeset
for help on using the changeset viewer.