Changeset 14145 in vbox
- Timestamp:
- Nov 12, 2008 9:59:25 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMInternal.h
r14141 r14145 3481 3481 * @param GCPtr The address. 3482 3482 */ 3483 DECLINLINE( uint64_t) pgmGstGetPaePDE(PPGM pPGM, RTGCPTR GCPtr)3483 DECLINLINE(X86PDEPAE) pgmGstGetPaePDE(PPGM pPGM, RTGCPTR GCPtr) 3484 3484 { 3485 3485 AssertGCPtr32(GCPtr); … … 3487 3487 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3488 3488 PX86PDPT pGuestPDPT = pgmGstGetPaePDPTPtr(pPGM); 3489 AssertReturn(pGuestPDPT, 0);3489 if (LIKELY(pGuestPDPT)) 3490 3490 #else 3491 3491 PX86PDPT pGuestPDPT = pPGM->CTX_SUFF(pGstPaePDPT); 3492 3492 #endif 3493 const unsigned iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE;3494 if (pGuestPDPT->a[iPdPt].n.u1Present)3495 3493 { 3496 const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 3494 const unsigned iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE; 3495 if (pGuestPDPT->a[iPdPt].n.u1Present) 3496 { 3497 const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 3497 3498 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3498 if ((pGuestPDPT->a[iPdPt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPt]) 3499 return pPGM->CTX_SUFF(apGstPaePDs)[iPdPt]->a[iPD].u; 3500 #endif 3501 3502 /* cache is out-of-sync. */ 3503 PX86PDPAE pPD; 3504 int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), pGuestPDPT->a[iPdPt].u & X86_PDPE_PG_MASK, &pPD); 3505 if (RT_SUCCESS(rc)) 3506 return pPD->a[iPD].u; 3507 AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, pGuestPDPT->a[iPdPt].u)); 3499 if ((pGuestPDPT->a[iPdPt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPt]) 3500 return pPGM->CTX_SUFF(apGstPaePDs)[iPdPt]->a[iPD]; 3501 #endif 3502 3503 /* cache is out-of-sync. */ 3504 PX86PDPAE pPD; 3505 int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), pGuestPDPT->a[iPdPt].u & X86_PDPE_PG_MASK, &pPD); 3506 if (RT_SUCCESS(rc)) 3507 return pPD->a[iPD]; 3508 AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, pGuestPDPT->a[iPdPt])); 3509 } 3508 3510 } 3509 return 0; 3511 X86PDEPAE ZeroPde = {0}; 3512 return ZeroPde; 3510 3513 } 3511 3514 … … 3665 3668 * @param pPdpe Page directory pointer table entry (out) 3666 3669 */ 3667 DECLINLINE(uint64_t) pgmGstGetLongModePDE(PPGM pPGM, RTGCPTR64 GCPtr, PX86PML4E *ppPml4e, PX86PDPE pPdpe) 3668 { 3670 DECLINLINE(X86PDEPAE) pgmGstGetLongModePDEEx(PPGM pPGM, RTGCPTR64 GCPtr, PX86PML4E *ppPml4e, PX86PDPE pPdpe) 3671 { 3672 X86PDEPAE ZeroPde = {0}; 3669 3673 PX86PML4 pGuestPml4 = pgmGstGetLongModePML4Ptr(pPGM); 3670 3674 const unsigned iPml4 = (GCPtr >> X86_PML4_SHIFT) & X86_PML4_MASK; … … 3674 3678 PCX86PDPT pPdptTemp; 3675 3679 int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), pPml4e->u & X86_PML4E_PG_MASK, &pPdptTemp); 3676 AssertRCReturn(rc, 0);3680 AssertRCReturn(rc, ZeroPde); 3677 3681 3678 3682 const unsigned iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64; … … 3682 3686 PCX86PDPAE pPD; 3683 3687 rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), pPdptTemp->a[iPdPt].u & X86_PDPE_PG_MASK, &pPD); 3684 AssertRCReturn(rc, 0);3688 AssertRCReturn(rc, ZeroPde); 3685 3689 3686 3690 const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 3687 return pPD->a[iPD] .u;3691 return pPD->a[iPD]; 3688 3692 } 3689 3693 } 3690 return 0; 3694 3695 return ZeroPde; 3691 3696 } 3692 3697 … … 3700 3705 * @param GCPtr The address. 3701 3706 */ 3702 DECLINLINE(uint64_t) pgmGstGetLongModePDE(PPGM pPGM, RTGCPTR64 GCPtr) 3703 { 3707 DECLINLINE(X86PDEPAE) pgmGstGetLongModePDE(PPGM pPGM, RTGCPTR64 GCPtr) 3708 { 3709 X86PDEPAE ZeroPde = {0}; 3704 3710 PCX86PML4 pGuestPml4 = pgmGstGetLongModePML4Ptr(pPGM); 3705 3711 const unsigned iPml4 = (GCPtr >> X86_PML4_SHIFT) & X86_PML4_MASK; … … 3708 3714 PCX86PDPT pPdptTemp; 3709 3715 int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), pGuestPml4->a[iPml4].u & X86_PML4E_PG_MASK, &pPdptTemp); 3710 AssertRCReturn(rc, 0);3716 AssertRCReturn(rc, ZeroPde); 3711 3717 3712 3718 const unsigned iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64; … … 3715 3721 PCX86PDPAE pPD; 3716 3722 rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), pPdptTemp->a[iPdPt].u & X86_PDPE_PG_MASK, &pPD); 3717 AssertRCReturn(rc, 0);3723 AssertRCReturn(rc, ZeroPde); 3718 3724 3719 3725 const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 3720 return pPD->a[iPD] .u;3726 return pPD->a[iPD]; 3721 3727 } 3722 3728 } 3723 return 0;3729 return ZeroPde; 3724 3730 } 3725 3731 -
trunk/src/VBox/VMM/PGMMap.cpp
r14133 r14145 1103 1103 for (PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; pCur; pCur = pCur->pNextR3) 1104 1104 { 1105 X86PDEPAE Pde;1106 1105 RTGCPTR GCPtr = pCur->GCPtr; 1107 1106 … … 1109 1108 while (iPT-- > 0) 1110 1109 { 1111 Pde.u= pgmGstGetPaePDE(&pVM->pgm.s, GCPtr);1110 X86PDEPAE Pde = pgmGstGetPaePDE(&pVM->pgm.s, GCPtr); 1112 1111 1113 1112 if ( Pde.n.u1Present -
trunk/src/VBox/VMM/VMMAll/PGMAllGst.h
r14141 r14145 182 182 183 183 #elif PGM_GST_TYPE == PGM_TYPE_PAE 184 X86PDEPAE Pde; 184 /* pgmGstGetPaePDE will return 0 if the PDPTE is marked as not present. 185 * All the other bits in the PDPTE are only valid in long mode (r/w, u/s, nx). */ 186 X86PDEPAE Pde = pgmGstGetPaePDE(&pVM->pgm.s, GCPtr); 185 187 bool fNoExecuteBitValid = !!(CPUMGetGuestEFER(pVM) & MSR_K6_EFER_NXE); 186 187 /* pgmGstGetPaePDE will return 0 if the PDPTE is marked as not present188 * All the other bits in the PDPTE are only valid in long mode (r/w, u/s, nx)189 */190 Pde.u = pgmGstGetPaePDE(&pVM->pgm.s, GCPtr);191 188 192 189 #elif PGM_GST_TYPE == PGM_TYPE_AMD64 193 190 PX86PML4E pPml4e; 194 191 X86PDPE Pdpe; 195 X86PDEPAE Pde ;192 X86PDEPAE Pde = pgmGstGetLongModePDEEx(&pVM->pgm.s, GCPtr, &pPml4e, &Pdpe); 196 193 bool fNoExecuteBitValid = !!(CPUMGetGuestEFER(pVM) & MSR_K6_EFER_NXE); 197 194 198 Pde.u = pgmGstGetLongModePDE(&pVM->pgm.s, GCPtr, &pPml4e, &Pdpe);199 195 Assert(pPml4e); 200 196 if (!(pPml4e->n.u1Present & Pdpe.n.u1Present)) … … 402 398 X86PDE Pde = pgmGstGet32bitPDE(&pVM->pgm.s, GCPtr); 403 399 # elif PGM_GST_TYPE == PGM_TYPE_PAE 404 X86PDEPAE Pde; 405 Pde.u = pgmGstGetPaePDE(&pVM->pgm.s, GCPtr); 400 X86PDEPAE Pde = pgmGstGetPaePDE(&pVM->pgm.s, GCPtr); 406 401 # elif PGM_GST_TYPE == PGM_TYPE_AMD64 407 X86PDEPAE Pde; 408 Pde.u = pgmGstGetLongModePDE(&pVM->pgm.s, GCPtr); 402 X86PDEPAE Pde = pgmGstGetLongModePDE(&pVM->pgm.s, GCPtr); 409 403 # endif 410 404 … … 840 834 X86PDE Pde = pPDSrc->a[GCPtr >> X86_PD_SHIFT]; 841 835 #elif PGM_GST_TYPE == PGM_TYPE_PAE 842 X86PDEPAE Pde; 843 Pde.u = pgmGstGetPaePDE(&pState->pVM->pgm.s, GCPtr); 836 X86PDEPAE Pde = pgmGstGetPaePDE(&pState->pVM->pgm.s, GCPtr); 844 837 #elif PGM_GST_TYPE == PGM_TYPE_AMD64 845 X86PDEPAE Pde; 846 Pde.u = pgmGstGetLongModePDE(&pState->pVM->pgm.s, GCPtr); 838 X86PDEPAE Pde = pgmGstGetLongModePDE(&pState->pVM->pgm.s, GCPtr); 847 839 #endif 848 840 if (Pde.n.u1Present)
Note:
See TracChangeset
for help on using the changeset viewer.