Changeset 14145 in vbox for trunk/src/VBox/VMM/PGMInternal.h
- Timestamp:
- Nov 12, 2008 9:59:25 PM (16 years ago)
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.