Changeset 13919 in vbox for trunk/src/VBox
- Timestamp:
- Nov 6, 2008 2:11:41 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGM.cpp
r13841 r13919 1884 1884 AssertMsg(pVM->pgm.s.pGC32BitPD, ("Init order, no relocation before paging is initialized!\n")); 1885 1885 pVM->pgm.s.pGC32BitPD += offDelta; 1886 pVM->pgm.s.pGuestPD GC += offDelta;1886 pVM->pgm.s.pGuestPDRC += offDelta; 1887 1887 AssertCompile(RT_ELEMENTS(pVM->pgm.s.apGCPaePDs) == RT_ELEMENTS(pVM->pgm.s.apGstPaePDsGC)); 1888 1888 for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.apGCPaePDs); i++) … … 2592 2592 * Get page directory addresses. 2593 2593 */ 2594 PX86PD pPDSrc = pVM->pgm.s.pGuestPD HC;2594 PX86PD pPDSrc = pVM->pgm.s.pGuestPDR3; 2595 2595 Assert(pPDSrc); 2596 2596 Assert(PGMPhysGCPhys2HCPtrAssert(pVM, (RTGCPHYS)(CPUMGetGuestCR3(pVM) & X86_CR3_PAGE_MASK), sizeof(*pPDSrc)) == pPDSrc); -
trunk/src/VBox/VMM/PGMGst.h
r13840 r13919 300 300 const unsigned iPD2 = (offPD + cbBuf - 1) / sizeof(X86PDE); 301 301 Assert(iPD1 - iPD2 <= 1); 302 if ( ( pVM->pgm.s.pGuestPD HC->a[iPD1].n.u1Present302 if ( ( pVM->pgm.s.pGuestPDR3->a[iPD1].n.u1Present 303 303 && pgmGetMapping(pVM, iPD1 << X86_PD_SHIFT) ) 304 304 || ( iPD1 != iPD2 305 && pVM->pgm.s.pGuestPD HC->a[iPD2].n.u1Present305 && pVM->pgm.s.pGuestPDR3->a[iPD2].n.u1Present 306 306 && pgmGetMapping(pVM, iPD2 << X86_PD_SHIFT) ) 307 307 ) -
trunk/src/VBox/VMM/PGMInternal.h
r13832 r13919 1990 1990 /** @name 32-bit Guest Paging. 1991 1991 * @{ */ 1992 /** The guest's page directory, HCpointer. */1993 #if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE 1994 R3PTRTYPE(PX86PD) pGuestPDHC; 1995 #else 1996 R 3R0PTRTYPE(PX86PD) pGuestPDHC;1997 #endif 1998 /** The guest's page directory, static GC mapping. */1999 RCPTRTYPE(PX86PD) pGuestPD GC;1992 /** The guest's page directory, R3 pointer. */ 1993 R3PTRTYPE(PX86PD) pGuestPDR3; 1994 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 1995 /** The guest's page directory, R0 pointer. */ 1996 R0PTRTYPE(PX86PD) pGuestPDR0; 1997 #endif 1998 /** The guest's page directory, static RC mapping. */ 1999 RCPTRTYPE(PX86PD) pGuestPDRC; 2000 2000 /** @} */ 2001 2001 … … 2346 2346 { 2347 2347 /** The chunk tree, ordered by chunk id. */ 2348 #if 0///@tododef VBOX_WITH_2X_4GB_ADDR_SPACE2348 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE 2349 2349 R3PTRTYPE(PAVLU32NODECORE) pTree; 2350 2350 #else … … 3288 3288 3289 3289 /** 3290 * Gets the page directory entry for the specified address (32-bit paging). 3291 * 3292 * @returns The page directory entry in question. 3293 * @param pPGM Pointer to the PGM instance data. 3294 * @param GCPtr The address. 3295 */ 3296 DECLINLINE(X86PGUINT) pgmGstGet32bitPDE(PPGM pPGM, RTGCPTR GCPtr) 3297 { 3298 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3299 PCX86PD pGuestPD = 0; 3300 int rc = PGMDynMapGCPage(PGM2VM(pPGM), pPGM->GCPhysCR3, (void **)pGuestPD); 3301 AssertRCReturn(rc, 0); 3302 return pGuestPD->a[GCPtr >> X86_PD_SHIFT].u; 3303 #else 3304 return pPGM->CTX_SUFF(pGuestPD)->a[GCPtr >> X86_PD_SHIFT].u; 3305 #endif 3306 } 3307 3308 3309 /** 3310 * Gets the address of a specific page directory entry (32-bit paging). 3311 * 3312 * @returns Pointer the page directory entry in question. 3313 * @param pPGM Pointer to the PGM instance data. 3314 * @param GCPtr The address. 3315 */ 3316 DECLINLINE(PX86PDE) pgmGstGet32bitPDEPtr(PPGM pPGM, RTGCPTR GCPtr) 3317 { 3318 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3319 PX86PD pGuestPD = 0; 3320 int rc = PGMDynMapGCPage(PGM2VM(pPGM), pPGM->GCPhysCR3, (void **)pGuestPD); 3321 AssertRCReturn(rc, 0); 3322 return &pGuestPD->a[GCPtr >> X86_PD_SHIFT]; 3323 #else 3324 return &pPGM->CTX_SUFF(pGuestPD)->a[GCPtr >> X86_PD_SHIFT]; 3325 #endif 3326 } 3327 3328 3329 /** 3330 * Gets the address the guest page directory (32-bit paging). 3331 * 3332 * @returns Pointer the page directory entry in question. 3333 * @param pPGM Pointer to the PGM instance data. 3334 */ 3335 DECLINLINE(PX86PD) pgmGstGet32bitPDPtr(PPGM pPGM) 3336 { 3337 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3338 PX86PD pGuestPD = 0; 3339 int rc = PGMDynMapGCPage(PGM2VM(pPGM), pPGM->GCPhysCR3, (void **)pGuestPD); 3340 AssertRCReturn(rc, 0); 3341 return pGuestPD; 3342 #else 3343 return pPGM->CTX_SUFF(pGuestPD); 3344 #endif 3345 } 3346 3347 3348 /** 3290 3349 * Gets the page directory for the specified address. 3291 3350 * -
trunk/src/VBox/VMM/PGMMap.cpp
r13824 r13919 1057 1057 * Resolve the page directory. 1058 1058 */ 1059 PX86PD pPD = pVM->pgm.s.pGuestPD HC;1059 PX86PD pPD = pVM->pgm.s.pGuestPDR3; 1060 1060 Assert(pPD); 1061 1061 Assert(pPD == (PX86PD)PGMPhysGCPhys2HCPtrAssert(pVM, cr3 & X86_CR3_PAGE_MASK, sizeof(*pPD))); -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r13832 r13919 103 103 # if PGM_GST_TYPE == PGM_TYPE_32BIT 104 104 const unsigned iPDSrc = (RTGCUINTPTR)pvFault >> GST_PD_SHIFT; 105 PGSTPD pPDSrc = CTXSUFF(pVM->pgm.s.pGuestPD);105 PGSTPD pPDSrc = pgmGstGet32bitPDPtr(&pVM->pgm.s); 106 106 107 107 # elif PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64 … … 953 953 */ 954 954 # if PGM_GST_TYPE == PGM_TYPE_32BIT 955 P X86PD pPDSrc = CTXSUFF(pVM->pgm.s.pGuestPD);955 PGSTPD pPDSrc = pgmGstGet32bitPDPtr(&pVM->pgm.s); 956 956 const unsigned iPDSrc = GCPtrPage >> GST_PD_SHIFT; 957 957 GSTPDE PdeSrc = pPDSrc->a[iPDSrc]; … … 2810 2810 # if PGM_GST_TYPE == PGM_TYPE_32BIT 2811 2811 const unsigned iPDSrc = (RTGCUINTPTR)GCPtrPage >> GST_PD_SHIFT; 2812 PGSTPD pPDSrc = CTXSUFF(pVM->pgm.s.pGuestPD);2812 PGSTPD pPDSrc = pgmGstGet32bitPDPtr(&pVM->pgm.s); 2813 2813 # elif PGM_GST_TYPE == PGM_TYPE_PAE 2814 2814 unsigned iPDSrc; … … 2929 2929 # if PGM_GST_TYPE == PGM_TYPE_32BIT 2930 2930 const unsigned iPDSrc = (RTGCUINTPTR)GCPtrPage >> GST_PD_SHIFT; 2931 PGSTPD pPDSrc = CTXSUFF(pVM->pgm.s.pGuestPD);2931 PGSTPD pPDSrc = pgmGstGet32bitPDPtr(&pVM->pgm.s); 2932 2932 # elif PGM_GST_TYPE == PGM_TYPE_PAE 2933 2933 unsigned iPDSrc; … … 3158 3158 3159 3159 # if PGM_GST_TYPE == PGM_TYPE_32BIT 3160 PGSTPD pPDSrc = CTXSUFF(pVM->pgm.s.pGuestPD);3160 PGSTPD pPDSrc = pgmGstGet32bitPDPtr(&pVM->pgm.s); 3161 3161 Assert(pPDSrc); 3162 3162 # ifndef IN_RC … … 3653 3653 # if !defined(IN_RING0) && PGM_GST_TYPE != PGM_TYPE_AMD64 3654 3654 # if PGM_GST_TYPE == PGM_TYPE_32BIT 3655 rc = PGMShwGetPage(pVM, (RTGCPTR)pPGM->pGuestPD GC, NULL, &HCPhysShw);3655 rc = PGMShwGetPage(pVM, (RTGCPTR)pPGM->pGuestPDRC, NULL, &HCPhysShw); 3656 3656 # else 3657 3657 rc = PGMShwGetPage(pVM, (RTGCPTR)pPGM->pGstPaePDPTGC, NULL, &HCPhysShw); … … 3663 3663 # if PGM_GST_TYPE == PGM_TYPE_32BIT && defined(IN_RING3) 3664 3664 RTGCPHYS GCPhys; 3665 rc = PGMR3DbgR3Ptr2GCPhys(pVM, pPGM->pGuestPD HC, &GCPhys);3665 rc = PGMR3DbgR3Ptr2GCPhys(pVM, pPGM->pGuestPDR3, &GCPhys); 3666 3666 AssertRCReturn(rc, 1); 3667 3667 AssertMsgReturn((cr3 & GST_CR3_PAGE_MASK) == GCPhys, ("GCPhys=%RGp cr3=%RGp\n", GCPhys, (RTGCPHYS)cr3), false); … … 3833 3833 # endif 3834 3834 # if PGM_GST_TYPE == PGM_TYPE_32BIT 3835 const GSTPD *pPDSrc = CTXSUFF(pPGM->pGuestPD);3835 GSTPD const *pPDSrc = pgmGstGet32bitPDPtr(&pVM->pgm.s); 3836 3836 # if PGM_SHW_TYPE == PGM_TYPE_32BIT 3837 3837 PCX86PD pPDDst = pPGM->CTXMID(p,32BitPD); -
trunk/src/VBox/VMM/VMMAll/PGMAllGst.h
r13824 r13919 179 179 */ 180 180 # if PGM_GST_TYPE == PGM_TYPE_32BIT 181 const X86PDE Pde = CTXSUFF(pVM->pgm.s.pGuestPD)->a[GCPtr >> X86_PD_SHIFT]; 181 X86PDE Pde; 182 Pde.u = pgmGstGet32bitPDE(&pVM->pgm.s, GCPtr); 183 182 184 #elif PGM_GST_TYPE == PGM_TYPE_PAE 183 185 X86PDEPAE Pde; … … 188 190 */ 189 191 Pde.u = pgmGstGetPaePDE(&pVM->pgm.s, GCPtr); 192 190 193 #elif PGM_GST_TYPE == PGM_TYPE_AMD64 191 194 PX86PML4E pPml4e; … … 299 302 */ 300 303 # if PGM_GST_TYPE == PGM_TYPE_32BIT 301 PX86PDE pPde = &CTXSUFF(pVM->pgm.s.pGuestPD)->a[GCPtr >> X86_PD_SHIFT]; 304 PX86PDE pPde = pgmGstGet32bitPDEPtr(&pVM->pgm.s, GCPtr); 305 302 306 # elif PGM_GST_TYPE == PGM_TYPE_PAE 303 307 /* pgmGstGetPaePDEPtr will return 0 if the PDPTE is marked as not present … … 398 402 # if PGM_GST_TYPE == PGM_TYPE_32BIT 399 403 X86PDE Pde; 400 Pde = CTXSUFF(pVM->pgm.s.pGuestPD)->a[GCPtr >> GST_PD_SHIFT];404 Pde.u = pgmGstGet32bitPDE(&pVM->pgm.s, GCPtr); 401 405 # elif PGM_GST_TYPE == PGM_TYPE_PAE 402 406 X86PDEPAE Pde; … … 448 452 PGM_INVL_PG(pVM->pgm.s.GCPtrCR3Mapping); 449 453 # if PGM_GST_TYPE == PGM_TYPE_32BIT 450 pVM->pgm.s.pGuestPDHC = (R3R0PTRTYPE(PX86PD))HCPtrGuestCR3; 451 pVM->pgm.s.pGuestPDGC = (RCPTRTYPE(PX86PD))pVM->pgm.s.GCPtrCR3Mapping; 454 pVM->pgm.s.pGuestPDR3 = (R3PTRTYPE(PX86PD))HCPtrGuestCR3; 455 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 456 pVM->pgm.s.pGuestPDR0 = (R0PTRTYPE(PX86PD))HCPtrGuestCR3; 457 # endif 458 pVM->pgm.s.pGuestPDRC = (RCPTRTYPE(PX86PD))pVM->pgm.s.GCPtrCR3Mapping; 452 459 453 460 # elif PGM_GST_TYPE == PGM_TYPE_PAE … … 546 553 547 554 #if PGM_GST_TYPE == PGM_TYPE_32BIT 548 pVM->pgm.s.pGuestPDHC = 0; 549 pVM->pgm.s.pGuestPDGC = 0; 555 pVM->pgm.s.pGuestPDR3 = 0; 556 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 557 pVM->pgm.s.pGuestPDR0 = 0; 558 #endif 559 pVM->pgm.s.pGuestPDRC = 0; 550 560 551 561 #elif PGM_GST_TYPE == PGM_TYPE_PAE … … 777 787 778 788 #if PGM_GST_TYPE == PGM_TYPE_32BIT 779 PX86PD pPDSrc = p State->pVM->pgm.s.CTXSUFF(pGuestPD);789 PX86PD pPDSrc = pgmGstGet32bitPDPtr(&pState->pVM->pgm.s); 780 790 #endif 781 791 … … 1005 1015 1006 1016 Assert(cb > 0 && cb <= 8); 1007 Assert(iPD1 < RT_ELEMENTS(pVM->pgm.s.CTX SUFF(pGuestPD)->a)); /// @todo R3/R0 separation.1008 Assert(iPD2 < RT_ELEMENTS(pVM->pgm.s.CTX SUFF(pGuestPD)->a));1017 Assert(iPD1 < RT_ELEMENTS(pVM->pgm.s.CTX_SUFF(pGuestPD)->a)); /// @todo R3/R0 separation. 1018 Assert(iPD2 < RT_ELEMENTS(pVM->pgm.s.CTX_SUFF(pGuestPD)->a)); 1009 1019 1010 1020 #ifdef DEBUG … … 1016 1026 if (!pVM->pgm.s.fMappingsFixed) 1017 1027 { 1018 PX86PD pPDSrc = CTXSUFF(pVM->pgm.s.pGuestPD);1028 PX86PD pPDSrc = pVM->pgm.s.CTX_SUFF(pGuestPD); 1019 1029 if ( ( pPDSrc->a[iPD1].n.u1Present 1020 1030 && pgmGetMapping(pVM, (RTGCPTR)(iPD1 << X86_PD_SHIFT)) ) -
trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp
r13832 r13919 396 396 GEN_CHECK_OFF(PGM, GCPtrCR3Mapping); 397 397 GEN_CHECK_OFF(PGM, GCPhysGstCR3Monitored); 398 GEN_CHECK_OFF(PGM, pGuestPDHC); 399 GEN_CHECK_OFF(PGM, pGuestPDGC); 398 GEN_CHECK_OFF(PGM, pGuestPDR3); 399 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 400 GEN_CHECK_OFF(PGM, pGuestPDR0); 401 #endif 402 GEN_CHECK_OFF(PGM, pGuestPDRC); 400 403 GEN_CHECK_OFF(PGM, pGstPaePDPTHC); 401 404 GEN_CHECK_OFF(PGM, pGstPaePDPTGC);
Note:
See TracChangeset
for help on using the changeset viewer.