Changeset 18125 in vbox
- Timestamp:
- Mar 22, 2009 4:52:36 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
-
PGM.cpp (modified) (1 diff)
-
PGMInternal.h (modified) (21 diffs)
-
VMMAll/PGMAll.cpp (modified) (1 diff)
-
VMMAll/PGMAllBth.h (modified) (5 diffs)
-
VMMAll/PGMAllPhys.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGM.cpp
r18046 r18125 3123 3123 * Get page directory addresses. 3124 3124 */ 3125 PX86PD pPDSrc = p VM->pgm.s.pGst32BitPdR3;3125 PX86PD pPDSrc = pgmGstGet32bitPDPtr(&pVM->pgm.s); 3126 3126 Assert(pPDSrc); 3127 3127 Assert(PGMPhysGCPhys2R3PtrAssert(pVM, (RTGCPHYS)(CPUMGetGuestCR3(pVM) & X86_CR3_PAGE_MASK), sizeof(*pPDSrc)) == pPDSrc); -
trunk/src/VBox/VMM/PGMInternal.h
r18046 r18125 2930 2930 void pgmMapClearShadowPDEs(PVM pVM, PPGMPOOLPAGE pShwPageCR3, PPGMMAPPING pMap, unsigned iOldPDE); 2931 2931 void pgmMapSetShadowPDEs(PVM pVM, PPGMMAPPING pMap, unsigned iNewPDE); 2932 int pgmShwSyncPaePDPtr(PVM pVM, RTGCPTR GCPtr, PX86PDPE pGstPdpe, PX86PDPAE *ppPD);2933 2932 int pgmMapDeactivateCR3(PVM pVM, PPGMPOOLPAGE pShwPageCR3); 2934 2933 int pgmMapActivateCR3(PVM pVM, PPGMPOOLPAGE pShwPageCR3); 2935 2934 2935 int pgmShwSyncPaePDPtr(PVM pVM, RTGCPTR GCPtr, PX86PDPE pGstPdpe, PX86PDPAE *ppPD); 2936 2936 #ifndef IN_RC 2937 2937 int pgmShwSyncLongModePDPtr(PVM pVM, RTGCPTR64 GCPtr, PX86PML4E pGstPml4e, PX86PDPE pGstPdpe, PX86PDPAE *ppPD); 2938 2938 #endif 2939 2939 int pgmShwGetEPTPDPtr(PVM pVM, RTGCPTR64 GCPtr, PEPTPDPT *ppPdpt, PEPTPD *ppPD); 2940 2941 PX86PD pgmGstLazyMap32BitPD(PPGM pPGM); 2942 PX86PDPT pgmGstLazyMapPaePDPT(PPGM pPGM); 2943 PX86PDPAE pgmGstLazyMapPaePD(PPGM pPGM, uint32_t iPdpt); 2944 PX86PML4 pgmGstLazyMapPml4(PPGM pPGM); 2940 2945 2941 2946 __END_DECLS … … 3522 3527 { 3523 3528 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3524 PCX86PD pGuestPD = 0;3529 PCX86PD pGuestPD = NULL; 3525 3530 int rc = pgmR0DynMapGCPageInlined(pPGM, pPGM->GCPhysCR3, (void **)&pGuestPD); 3526 3531 if (RT_FAILURE(rc)) … … 3529 3534 AssertMsgFailedReturn(("%Rrc\n", rc), ZeroPde); 3530 3535 } 3536 #else 3537 PX86PD pGuestPD = pPGM->CTX_SUFF(pGst32BitPd); 3538 # ifdef VBOX_WITH_NEW_PHYS_CODE 3539 # ifdef IN_RING3 3540 if (!pGuestPD) 3541 pGuestPD = pgmGstLazyMap32BitPD(pPGM); 3542 # endif 3543 # endif 3544 #endif 3531 3545 return pGuestPD->a[GCPtr >> X86_PD_SHIFT]; 3532 #else3533 return pPGM->CTX_SUFF(pGst32BitPd)->a[GCPtr >> X86_PD_SHIFT];3534 #endif3535 3546 } 3536 3547 … … 3546 3557 { 3547 3558 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3548 PX86PD pGuestPD = 0;3559 PX86PD pGuestPD = NULL; 3549 3560 int rc = pgmR0DynMapGCPageInlined(pPGM, pPGM->GCPhysCR3, (void **)&pGuestPD); 3550 AssertRCReturn(rc, 0); 3561 AssertRCReturn(rc, NULL); 3562 #else 3563 PX86PD pGuestPD = pPGM->CTX_SUFF(pGst32BitPd); 3564 # ifdef VBOX_WITH_NEW_PHYS_CODE 3565 # ifdef IN_RING3 3566 if (!pGuestPD) 3567 pGuestPD = pgmGstLazyMap32BitPD(pPGM); 3568 # endif 3569 # endif 3570 #endif 3551 3571 return &pGuestPD->a[GCPtr >> X86_PD_SHIFT]; 3552 #else3553 return &pPGM->CTX_SUFF(pGst32BitPd)->a[GCPtr >> X86_PD_SHIFT];3554 #endif3555 3572 } 3556 3573 … … 3565 3582 { 3566 3583 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3567 PX86PD pGuestPD = 0;3584 PX86PD pGuestPD = NULL; 3568 3585 int rc = pgmR0DynMapGCPageInlined(pPGM, pPGM->GCPhysCR3, (void **)&pGuestPD); 3569 AssertRCReturn(rc, 0); 3586 AssertRCReturn(rc, NULL); 3587 #else 3588 PX86PD pGuestPD = pPGM->CTX_SUFF(pGst32BitPd); 3589 # ifdef VBOX_WITH_NEW_PHYS_CODE 3590 # ifdef IN_RING3 3591 if (!pGuestPD) 3592 pGuestPD = pgmGstLazyMap32BitPD(pPGM); 3593 # endif 3594 # endif 3595 #endif 3570 3596 return pGuestPD; 3571 #else3572 return pPGM->CTX_SUFF(pGst32BitPd);3573 #endif3574 3597 } 3575 3598 … … 3584 3607 DECLINLINE(PX86PDPT) pgmGstGetPaePDPTPtr(PPGM pPGM) 3585 3608 { 3609 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3610 PX86PDPT pGuestPDPT = NULL; 3611 int rc = pgmR0DynMapGCPageInlined(pPGM, pPGM->GCPhysCR3, (void **)&pGuestPDPT); 3612 AssertRCReturn(rc, NULL); 3613 #else 3614 PX86PDPT pGuestPDPT = pPGM->CTX_SUFF(pGstPaePdpt); 3615 # ifdef VBOX_WITH_NEW_PHYS_CODE 3616 # ifdef IN_RING3 3617 if (!pGuestPDPT) 3618 pGuestPDPT = pgmGstLazyMapPaePDPT(pPGM); 3619 # endif 3620 # endif 3621 #endif 3622 return pGuestPDPT; 3623 } 3624 3625 3626 /** 3627 * Gets the guest page directory pointer table entry for the specified address. 3628 * 3629 * @returns Pointer to the page directory in question. 3630 * @returns NULL if the page directory is not present or on an invalid page. 3631 * @param pPGM Pointer to the PGM instance data. 3632 * @param GCPtr The address. 3633 */ 3634 DECLINLINE(PX86PDPE) pgmGstGetPaePDPEPtr(PPGM pPGM, RTGCPTR GCPtr) 3635 { 3636 AssertGCPtr32(GCPtr); 3637 3586 3638 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3587 3639 PX86PDPT pGuestPDPT = 0; 3588 3640 int rc = pgmR0DynMapGCPageInlined(pPGM, pPGM->GCPhysCR3, (void **)&pGuestPDPT); 3589 3641 AssertRCReturn(rc, 0); 3590 return pGuestPDPT;3591 3642 #else 3592 return pPGM->CTX_SUFF(pGstPaePdpt); 3593 #endif 3594 } 3595 3596 3597 /** 3598 * Gets the guest page directory pointer table entry for the specified address. 3643 PX86PDPT pGuestPDPT = pPGM->CTX_SUFF(pGstPaePdpt); 3644 # ifdef VBOX_WITH_NEW_PHYS_CODE 3645 # ifdef IN_RING3 3646 if (!pGuestPDPT) 3647 pGuestPDPT = pgmGstLazyMapPaePDPT(pPGM); 3648 # endif 3649 # endif 3650 #endif 3651 return &pGuestPDPT->a[(GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE]; 3652 } 3653 3654 3655 /** 3656 * Gets the page directory for the specified address. 3599 3657 * 3600 3658 * @returns Pointer to the page directory in question. … … 3603 3661 * @param GCPtr The address. 3604 3662 */ 3605 DECLINLINE(PX86PDP E) pgmGstGetPaePDPEPtr(PPGM pPGM, RTGCPTR GCPtr)3663 DECLINLINE(PX86PDPAE) pgmGstGetPaePD(PPGM pPGM, RTGCPTR GCPtr) 3606 3664 { 3607 3665 AssertGCPtr32(GCPtr); 3608 3666 3667 PX86PDPT pGuestPDPT = pgmGstGetPaePDPTPtr(pPGM); 3668 AssertReturn(pGuestPDPT, NULL); 3669 const unsigned iPdpt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE; 3670 if (pGuestPDPT->a[iPdpt].n.u1Present) 3671 { 3672 #ifdef VBOX_WITH_NEW_PHYS_CODE 3609 3673 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3610 PX86PDPT pGuestPDPT = 0; 3611 int rc = pgmR0DynMapGCPageInlined(pPGM, pPGM->GCPhysCR3, (void **)&pGuestPDPT); 3612 AssertRCReturn(rc, 0); 3613 return &pGuestPDPT->a[(GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE]; 3674 PX86PDPAE pGuestPD = NULL; 3675 int rc = pgmR0DynMapGCPageInlined(pPGM, pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK, (void **)&pGuestPD); 3676 AssertRCReturn(rc, NULL); 3614 3677 #else 3615 return &pPGM->CTX_SUFF(pGstPaePdpt)->a[(GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE]; 3616 #endif 3617 } 3618 3619 3620 /** 3621 * Gets the page directory for the specified address. 3622 * 3623 * @returns Pointer to the page directory in question. 3624 * @returns NULL if the page directory is not present or on an invalid page. 3625 * @param pPGM Pointer to the PGM instance data. 3626 * @param GCPtr The address. 3627 */ 3628 DECLINLINE(PX86PDPAE) pgmGstGetPaePD(PPGM pPGM, RTGCPTR GCPtr) 3629 { 3630 AssertGCPtr32(GCPtr); 3631 3632 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3633 PX86PDPT pGuestPDPT = pgmGstGetPaePDPTPtr(pPGM); 3634 AssertReturn(pGuestPDPT, 0); 3635 #else 3636 PX86PDPT pGuestPDPT = pPGM->CTX_SUFF(pGstPaePdpt); 3637 #endif 3638 const unsigned iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE; 3639 if (pGuestPDPT->a[iPdPt].n.u1Present) 3640 { 3678 PX86PDPAE pGuestPD = pPGM->CTX_SUFF(apGstPaePDs)[iPdpt]; 3679 if ( !pGuestPD 3680 || (pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK) != pPGM->aGCPhysGstPaePDs[iPdpt]) 3681 pGuestPD = pgmGstLazyMapPaePD(pPGM, iPdpt); 3682 #endif 3683 return pGuestPD; 3684 #else /* !VBOX_WITH_NEW_PHYS_CODE */ 3641 3685 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3642 if ((pGuestPDPT->a[iPd Pt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPt])3643 return pPGM->CTX_SUFF(apGstPaePDs)[iPd Pt];3686 if ((pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdpt]) 3687 return pPGM->CTX_SUFF(apGstPaePDs)[iPdpt]; 3644 3688 #endif 3645 3689 3646 3690 /* cache is out-of-sync. */ 3647 3691 PX86PDPAE pPD; 3648 int rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pGuestPDPT->a[iPd Pt].u & X86_PDPE_PG_MASK, &pPD);3692 int rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK, &pPD); 3649 3693 if (RT_SUCCESS(rc)) 3650 3694 return pPD; 3651 AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, pGuestPDPT->a[iPdPt].u)); 3695 AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, pGuestPDPT->a[iPdpt].u)); 3696 #endif /* !VBOX_WITH_NEW_PHYS_CODE */ 3652 3697 /* returning NULL is ok if we assume it's just an invalid page of some kind emulated as all 0s. (not quite true) */ 3653 3698 } … … 3668 3713 AssertGCPtr32(GCPtr); 3669 3714 3670 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3671 PX86PDPT pGuestPDPT = pgmGstGetPaePDPTPtr(pPGM); 3672 AssertReturn(pGuestPDPT, 0); 3673 #else 3674 PX86PDPT pGuestPDPT = pPGM->CTX_SUFF(pGstPaePdpt); 3675 #endif 3676 const unsigned iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE; 3677 if (pGuestPDPT->a[iPdPt].n.u1Present) 3715 PX86PDPT pGuestPDPT = pgmGstGetPaePDPTPtr(pPGM); 3716 AssertReturn(pGuestPDPT, NULL); 3717 const unsigned iPdpt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE; 3718 if (pGuestPDPT->a[iPdpt].n.u1Present) 3678 3719 { 3679 3720 const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 3721 #ifdef VBOX_WITH_NEW_PHYS_CODE 3722 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3723 PX86PDPAE pGuestPD = NULL; 3724 int rc = pgmR0DynMapGCPageInlined(pPGM, pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK, (void **)&pGuestPD); 3725 AssertRCReturn(rc, NULL); 3726 #else 3727 PX86PDPAE pGuestPD = pPGM->CTX_SUFF(apGstPaePDs)[iPdpt]; 3728 if ( !pGuestPD 3729 || (pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK) != pPGM->aGCPhysGstPaePDs[iPdpt]) 3730 pGuestPD = pgmGstLazyMapPaePD(pPGM, iPdpt); 3731 #endif 3732 return &pGuestPD->a[iPD]; 3733 #else /* !VBOX_WITH_NEW_PHYS_CODE */ 3680 3734 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3681 if ((pGuestPDPT->a[iPd Pt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPt])3682 return &pPGM->CTX_SUFF(apGstPaePDs)[iPd Pt]->a[iPD];3735 if ((pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdpt]) 3736 return &pPGM->CTX_SUFF(apGstPaePDs)[iPdpt]->a[iPD]; 3683 3737 #endif 3684 3738 3685 3739 /* The cache is out-of-sync. */ 3686 3740 PX86PDPAE pPD; 3687 int rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pGuestPDPT->a[iPd Pt].u & X86_PDPE_PG_MASK, &pPD);3741 int rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK, &pPD); 3688 3742 if (RT_SUCCESS(rc)) 3689 3743 return &pPD->a[iPD]; 3690 AssertMsgFailed(("Impossible! rc=%Rrc PDPE=%RX64\n", rc, pGuestPDPT->a[iPdPt].u)); 3744 AssertMsgFailed(("Impossible! rc=%Rrc PDPE=%RX64\n", rc, pGuestPDPT->a[iPdpt].u)); 3745 #endif /* !VBOX_WITH_NEW_PHYS_CODE */ 3691 3746 /* returning NIL_RTGCPHYS is ok if we assume it's just an invalid page or something which we'll emulate as all 0s. (not quite true) */ 3692 3747 } … … 3706 3761 { 3707 3762 AssertGCPtr32(GCPtr); 3708 3709 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3710 PX86PDPT pGuestPDPT = pgmGstGetPaePDPTPtr(pPGM); 3763 X86PDEPAE ZeroPde = {0}; 3764 PX86PDPT pGuestPDPT = pgmGstGetPaePDPTPtr(pPGM); 3711 3765 if (RT_LIKELY(pGuestPDPT)) 3712 #else3713 PX86PDPT pGuestPDPT = pPGM->CTX_SUFF(pGstPaePdpt);3714 #endif3715 3766 { 3716 const unsigned iPd Pt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE;3717 if (pGuestPDPT->a[iPd Pt].n.u1Present)3767 const unsigned iPdpt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE; 3768 if (pGuestPDPT->a[iPdpt].n.u1Present) 3718 3769 { 3719 3770 const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 3771 #ifdef VBOX_WITH_NEW_PHYS_CODE 3772 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3773 PX86PDPAE pGuestPD = NULL; 3774 int rc = pgmR0DynMapGCPageInlined(pPGM, pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK, (void **)&pGuestPD); 3775 AssertRCReturn(rc, ZeroPde); 3776 #else 3777 PX86PDPAE pGuestPD = pPGM->CTX_SUFF(apGstPaePDs)[iPdpt]; 3778 if ( !pGuestPD 3779 || (pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK) != pPGM->aGCPhysGstPaePDs[iPdpt]) 3780 pGuestPD = pgmGstLazyMapPaePD(pPGM, iPdpt); 3781 #endif 3782 return pGuestPD->a[iPD]; 3783 #else /* !VBOX_WITH_NEW_PHYS_CODE */ 3720 3784 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3721 if ((pGuestPDPT->a[iPd Pt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPt])3722 return pPGM->CTX_SUFF(apGstPaePDs)[iPd Pt]->a[iPD];3785 if ((pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdpt]) 3786 return pPGM->CTX_SUFF(apGstPaePDs)[iPdpt]->a[iPD]; 3723 3787 #endif 3724 3788 3725 3789 /* cache is out-of-sync. */ 3726 3790 PX86PDPAE pPD; 3727 int rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pGuestPDPT->a[iPd Pt].u & X86_PDPE_PG_MASK, &pPD);3791 int rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK, &pPD); 3728 3792 if (RT_SUCCESS(rc)) 3729 3793 return pPD->a[iPD]; 3730 AssertMsgFailed(("Impossible! rc=%d PDPE=%RX64\n", rc, pGuestPDPT->a[iPdPt].u)); 3794 AssertMsgFailed(("Impossible! rc=%d PDPE=%RX64\n", rc, pGuestPDPT->a[iPdpt].u)); 3795 #endif /* !VBOX_WITH_NEW_PHYS_CODE */ 3731 3796 } 3732 3797 } 3733 X86PDEPAE ZeroPde = {0};3734 3798 return ZeroPde; 3735 3799 } … … 3751 3815 AssertGCPtr32(GCPtr); 3752 3816 3753 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3754 PX86PDPT pGuestPDPT = pgmGstGetPaePDPTPtr(pPGM); 3755 AssertReturn(pGuestPDPT, 0); 3756 #else 3757 PX86PDPT pGuestPDPT = pPGM->CTX_SUFF(pGstPaePdpt); 3758 #endif 3759 const unsigned iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE; 3817 PX86PDPT pGuestPDPT = pgmGstGetPaePDPTPtr(pPGM); 3818 AssertReturn(pGuestPDPT, NULL); 3819 const unsigned iPdpt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE; 3760 3820 if (pPdpe) 3761 *pPdpe = pGuestPDPT->a[iPd Pt];3762 if (pGuestPDPT->a[iPd Pt].n.u1Present)3821 *pPdpe = pGuestPDPT->a[iPdpt]; 3822 if (pGuestPDPT->a[iPdpt].n.u1Present) 3763 3823 { 3764 3824 const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 3825 #ifdef VBOX_WITH_NEW_PHYS_CODE 3826 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3827 PX86PDPAE pGuestPD = NULL; 3828 int rc = pgmR0DynMapGCPageInlined(pPGM, pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK, (void **)&pGuestPD); 3829 AssertRCReturn(rc, NULL); 3830 #else 3831 PX86PDPAE pGuestPD = pPGM->CTX_SUFF(apGstPaePDs)[iPdpt]; 3832 if ( !pGuestPD 3833 || (pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK) != pPGM->aGCPhysGstPaePDs[iPdpt]) 3834 pGuestPD = pgmGstLazyMapPaePD(pPGM, iPdpt); 3835 #endif 3836 *piPD = iPD; 3837 return pGuestPD; 3838 #else /* !VBOX_WITH_NEW_PHYS_CODE */ 3765 3839 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3766 if ((pGuestPDPT->a[iPd Pt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPt])3840 if ((pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdpt]) 3767 3841 { 3768 3842 *piPD = iPD; 3769 return pPGM->CTX_SUFF(apGstPaePDs)[iPd Pt];3843 return pPGM->CTX_SUFF(apGstPaePDs)[iPdpt]; 3770 3844 } 3771 3845 #endif … … 3773 3847 /* cache is out-of-sync. */ 3774 3848 PX86PDPAE pPD; 3775 int rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pGuestPDPT->a[iPd Pt].u & X86_PDPE_PG_MASK, &pPD);3849 int rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK, &pPD); 3776 3850 if (RT_SUCCESS(rc)) 3777 3851 { … … 3779 3853 return pPD; 3780 3854 } 3781 AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, pGuestPDPT->a[iPdPt].u)); 3855 AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, pGuestPDPT->a[iPdpt].u)); 3856 #endif /* !VBOX_WITH_NEW_PHYS_CODE */ 3782 3857 /* returning NIL_RTGCPHYS is ok if we assume it's just an invalid page of some kind emulated as all 0s. */ 3783 3858 } … … 3799 3874 int rc = pgmR0DynMapGCPageInlined(pPGM, pPGM->GCPhysCR3, (void **)&pGuestPml4); 3800 3875 AssertRCReturn(rc, NULL); 3876 #else 3877 PX86PML4 pGuestPml4 = pPGM->CTX_SUFF(pGstAmd64Pml4); 3878 # ifdef VBOX_WITH_NEW_PHYS_CODE 3879 # ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 3880 if (!pGuestPml4) 3881 pGuestPml4 = pgmGstLazyMapPml4(pPGM); 3882 # endif 3883 # endif 3884 Assert(pGuestPml4); 3885 #endif 3801 3886 return pGuestPml4; 3802 #else3803 Assert(pPGM->CTX_SUFF(pGstAmd64Pml4));3804 return pPGM->CTX_SUFF(pGstAmd64Pml4);3805 #endif3806 3887 } 3807 3888 … … 3820 3901 int rc = pgmR0DynMapGCPageInlined(pPGM, pPGM->GCPhysCR3, (void **)&pGuestPml4); 3821 3902 AssertRCReturn(rc, NULL); 3903 #else 3904 PX86PML4 pGuestPml4 = pPGM->CTX_SUFF(pGstAmd64Pml4); 3905 # ifdef VBOX_WITH_NEW_PHYS_CODE 3906 # ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 3907 if (!pGuestPml4) 3908 pGuestPml4 = pgmGstLazyMapPml4(pPGM); 3909 # endif 3910 # endif 3911 Assert(pGuestPml4); 3912 #endif 3822 3913 return &pGuestPml4->a[iPml4]; 3823 #else3824 Assert(pPGM->CTX_SUFF(pGstAmd64Pml4));3825 return &pPGM->CTX_SUFF(pGstAmd64Pml4)->a[iPml4];3826 #endif3827 3914 } 3828 3915 … … 3845 3932 AssertMsgFailedReturn(("%Rrc\n", rc), ZeroPml4e); 3846 3933 } 3934 #else 3935 PX86PML4 pGuestPml4 = pPGM->CTX_SUFF(pGstAmd64Pml4); 3936 # ifdef VBOX_WITH_NEW_PHYS_CODE 3937 # ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 3938 if (!pGuestPml4) 3939 pGuestPml4 = pgmGstLazyMapPml4(pPGM); 3940 # endif 3941 # endif 3942 Assert(pGuestPml4); 3943 #endif 3847 3944 return pGuestPml4->a[iPml4]; 3848 #else3849 Assert(pPGM->CTX_SUFF(pGstAmd64Pml4));3850 return pPGM->CTX_SUFF(pGstAmd64Pml4)->a[iPml4];3851 #endif3852 3945 } 3853 3946 … … 3873 3966 AssertRCReturn(rc, NULL); 3874 3967 3875 const unsigned iPd Pt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64;3876 return &pPdpt->a[iPd Pt];3968 const unsigned iPdpt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64; 3969 return &pPdpt->a[iPdpt]; 3877 3970 } 3878 3971 return NULL; … … 3902 3995 AssertRCReturn(rc, ZeroPde); 3903 3996 3904 const unsigned iPd Pt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64;3905 *pPdpe = pPdptTemp->a[iPd Pt];3906 if (pPdptTemp->a[iPd Pt].n.u1Present)3997 const unsigned iPdpt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64; 3998 *pPdpe = pPdptTemp->a[iPdpt]; 3999 if (pPdptTemp->a[iPdpt].n.u1Present) 3907 4000 { 3908 4001 PCX86PDPAE pPD; 3909 rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pPdptTemp->a[iPd Pt].u & X86_PDPE_PG_MASK, &pPD);4002 rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pPdptTemp->a[iPdpt].u & X86_PDPE_PG_MASK, &pPD); 3910 4003 AssertRCReturn(rc, ZeroPde); 3911 4004 … … 3938 4031 AssertRCReturn(rc, ZeroPde); 3939 4032 3940 const unsigned iPd Pt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64;3941 if (pPdptTemp->a[iPd Pt].n.u1Present)4033 const unsigned iPdpt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64; 4034 if (pPdptTemp->a[iPdpt].n.u1Present) 3942 4035 { 3943 4036 PCX86PDPAE pPD; 3944 rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pPdptTemp->a[iPd Pt].u & X86_PDPE_PG_MASK, &pPD);4037 rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pPdptTemp->a[iPdpt].u & X86_PDPE_PG_MASK, &pPD); 3945 4038 AssertRCReturn(rc, ZeroPde); 3946 4039 … … 3971 4064 AssertRCReturn(rc, NULL); 3972 4065 3973 const unsigned iPd Pt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64;3974 if (pPdptTemp->a[iPd Pt].n.u1Present)4066 const unsigned iPdpt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64; 4067 if (pPdptTemp->a[iPdpt].n.u1Present) 3975 4068 { 3976 4069 PX86PDPAE pPD; 3977 rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pPdptTemp->a[iPd Pt].u & X86_PDPE_PG_MASK, &pPD);4070 rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pPdptTemp->a[iPdpt].u & X86_PDPE_PG_MASK, &pPD); 3978 4071 AssertRCReturn(rc, NULL); 3979 4072 … … 4008 4101 AssertRCReturn(rc, NULL); 4009 4102 4010 const unsigned iPd Pt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64;4011 *pPdpe = pPdptTemp->a[iPd Pt];4012 if (pPdptTemp->a[iPd Pt].n.u1Present)4103 const unsigned iPdpt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64; 4104 *pPdpe = pPdptTemp->a[iPdpt]; 4105 if (pPdptTemp->a[iPdpt].n.u1Present) 4013 4106 { 4014 4107 PX86PDPAE pPD; 4015 rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pPdptTemp->a[iPd Pt].u & X86_PDPE_PG_MASK, &pPD);4108 rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pPdptTemp->a[iPdpt].u & X86_PDPE_PG_MASK, &pPD); 4016 4109 AssertRCReturn(rc, NULL); 4017 4110 … … 4240 4333 AssertRCReturn(rc, NULL); 4241 4334 4242 const unsigned iPd Pt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64;4243 if (pPdptTemp->a[iPd Pt].n.u1Present)4335 const unsigned iPdpt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64; 4336 if (pPdptTemp->a[iPdpt].n.u1Present) 4244 4337 { 4245 4338 PX86PDPAE pPD; 4246 rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pPdptTemp->a[iPd Pt].u & X86_PDPE_PG_MASK, &pPD);4339 rc = PGM_GCPHYS_2_PTR_BY_PGM(pPGM, pPdptTemp->a[iPdpt].u & X86_PDPE_PG_MASK, &pPD); 4247 4340 AssertRCReturn(rc, NULL); 4248 4341 -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r17667 r18125 1310 1310 } 1311 1311 1312 #ifdef VBOX_WITH_NEW_PHYS_CODE 1313 #ifdef IN_RING3 1314 1315 /** 1316 * Performs the lazy mapping of the 32-bit guest PD. 1317 * 1318 * @returns Pointer to the mapping. 1319 * @param pPGM The PGM instance data. 1320 */ 1321 PX86PD pgmGstLazyMap32BitPD(PPGM pPGM) 1322 { 1323 Assert(!pPGM->CTX_SUFF(pGst32BitPd)); 1324 PVM pVM = PGM2VM(pPGM); 1325 pgmLock(pVM); 1326 1327 PPGMPAGE pPage = pgmPhysGetPage(pPGM, pPGM->GCPhysCR3); 1328 AssertReturn(pPage, NULL); 1329 1330 RTHCPTR HCPtrGuestCR3; 1331 int rc = pgmPhysGCPhys2CCPtrInternal(pVM, pPage, pPGM->GCPhysCR3 & X86_CR3_PAGE_MASK, (void **)&HCPtrGuestCR3); 1332 AssertRCReturn(rc, NULL); 1333 1334 pPGM->pGst32BitPdR3 = (R3PTRTYPE(PX86PD))HCPtrGuestCR3; 1335 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 1336 pPGM->pGst32BitPdR0 = (R0PTRTYPE(PX86PD))HCPtrGuestCR3; 1337 # endif 1338 1339 pgmUnlock(pVM); 1340 return pPGM->CTX_SUFF(pGst32BitPd); 1341 } 1342 1343 1344 /** 1345 * Performs the lazy mapping of the PAE guest PDPT. 1346 * 1347 * @returns Pointer to the mapping. 1348 * @param pPGM The PGM instance data. 1349 */ 1350 PX86PDPT pgmGstLazyMapPaePDPT(PPGM pPGM) 1351 { 1352 Assert(!pPGM->CTX_SUFF(pGstPaePdpt)); 1353 PVM pVM = PGM2VM(pPGM); 1354 pgmLock(pVM); 1355 1356 PPGMPAGE pPage = pgmPhysGetPage(pPGM, pPGM->GCPhysCR3); 1357 AssertReturn(pPage, NULL); 1358 1359 RTHCPTR HCPtrGuestCR3; 1360 int rc = pgmPhysGCPhys2CCPtrInternal(pVM, pPage, pPGM->GCPhysCR3 & X86_CR3_PAE_PAGE_MASK, (void **)&HCPtrGuestCR3); 1361 AssertRCReturn(rc, NULL); 1362 1363 pPGM->pGstPaePdptR3 = (R3PTRTYPE(PX86PDPT))HCPtrGuestCR3; 1364 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 1365 pPGM->pGstPaePdptR0 = (R0PTRTYPE(PX86PDPT))HCPtrGuestCR3; 1366 # endif 1367 1368 pgmUnlock(pVM); 1369 return pPGM->CTX_SUFF(pGstPaePdpt); 1370 } 1371 1372 #endif /* IN_RING3 */ 1373 1374 /** 1375 * Performs the lazy mapping / updating of a PAE guest PD. 1376 * 1377 * @returns Pointer to the mapping. 1378 * @param pPGM The PGM instance data. 1379 * @param iPdpt Which PD entry to map (0..3). 1380 */ 1381 PX86PDPAE pgmGstLazyMapPaePD(PPGM pPGM, uint32_t iPdpt) 1382 { 1383 PVM pVM = PGM2VM(pPGM); 1384 pgmLock(pVM); 1385 1386 PX86PDPT pGuestPDPT = pPGM->CTX_SUFF(pGstPaePdpt); 1387 Assert(pGuestPDPT); 1388 Assert(pGuestPDPT->a[iPdpt].n.u1Present); 1389 RTGCPHYS GCPhys = pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK; 1390 bool const fChanged = pPGM->aGCPhysGstPaePDs[iPdpt] != GCPhys; 1391 1392 PPGMPAGE pPage = pgmPhysGetPage(pPGM, GCPhys); 1393 if (RT_LIKELY(pPage)) 1394 { 1395 int rc = VINF_SUCCESS; 1396 RTRCPTR RCPtr = NIL_RTRCPTR; 1397 RTHCPTR HCPtr = NIL_RTHCPTR; 1398 #if !defined(IN_RC) && !defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) 1399 rc = pgmPhysGCPhys2CCPtrInternal(pVM, pPage, GCPhys, &HCPtr); 1400 AssertRC(rc); 1401 #endif 1402 if (RT_SUCCESS(rc) && fChanged) 1403 { 1404 RCPtr = (RTRCPTR)(RTRCUINTPTR)(pPGM->GCPtrCR3Mapping + (1 + iPdpt) * PAGE_SIZE); 1405 rc = PGMMap(pVM, (RTRCUINTPTR)RCPtr, PGM_PAGE_GET_HCPHYS(pPage), PAGE_SIZE, 0); 1406 } 1407 if (RT_SUCCESS(rc)) 1408 { 1409 pPGM->apGstPaePDsR3[iPdpt] = (R3PTRTYPE(PX86PDPAE))HCPtr; 1410 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 1411 pPGM->apGstPaePDsR0[iPdpt] = (R0PTRTYPE(PX86PDPAE))HCPtr; 1412 # endif 1413 if (fChanged) 1414 { 1415 pPGM->aGCPhysGstPaePDs[iPdpt] = GCPhys; 1416 pPGM->apGstPaePDsRC[iPdpt] = (RCPTRTYPE(PX86PDPAE))RCPtr; 1417 } 1418 1419 pgmUnlock(pVM); 1420 return pPGM->CTX_SUFF(apGstPaePDs)[iPdpt]; 1421 } 1422 } 1423 1424 /* Invalid page or some failure, invalidate the entry. */ 1425 pPGM->aGCPhysGstPaePDs[iPdpt] = NIL_RTGCPHYS; 1426 pPGM->apGstPaePDsR3[iPdpt] = 0; 1427 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 1428 pPGM->apGstPaePDsR0[iPdpt] = 0; 1429 # endif 1430 pPGM->apGstPaePDsRC[iPdpt] = 0; 1431 1432 pgmUnlock(pVM); 1433 return NULL; 1434 } 1435 1436 1437 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 1438 /** 1439 * Performs the lazy mapping of the 32-bit guest PD. 1440 * 1441 * @returns Pointer to the mapping. 1442 * @param pPGM The PGM instance data. 1443 */ 1444 PX86PML4 pgmGstLazyMapPml4(PPGM pPGM) 1445 { 1446 Assert(!pPGM->CTX_SUFF(pGstAmd64Pml4)); 1447 PVM pVM = PGM2VM(pPGM); 1448 pgmLock(pVM); 1449 1450 PPGMPAGE pPage = pgmPhysGetPage(pPGM, pPGM->GCPhysCR3); 1451 AssertReturn(pPage, NULL); 1452 1453 RTHCPTR HCPtrGuestCR3; 1454 int rc = pgmPhysGCPhys2CCPtrInternal(pVM, pPage, pPGM->GCPhysCR3 & X86_CR3_AMD64_PAGE_MASK, (void **)&HCPtrGuestCR3); 1455 AssertRCReturn(rc, NULL); 1456 1457 pPGM->pGstAmd64Pml4R3 = (R3PTRTYPE(PX86PML4))HCPtrGuestCR3; 1458 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 1459 pPGM->pGstAmd64Pml4R0 = (R0PTRTYPE(PX86PML4))HCPtrGuestCR3; 1460 # endif 1461 1462 pgmUnlock(pVM); 1463 return pPGM->CTX_SUFF(pGstAmd64Pml4); 1464 } 1465 #endif /* VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 */ 1466 1467 #endif /* VBOX_WITH_NEW_PHYS_CODE */ 1312 1468 1313 1469 /** -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r18093 r18125 3416 3416 AssertMsgReturn(HCPhys == HCPhysShw, ("HCPhys=%RHp HCPhyswShw=%RHp (cr3)\n", HCPhys, HCPhysShw), false); 3417 3417 # if PGM_GST_TYPE == PGM_TYPE_32BIT && defined(IN_RING3) 3418 pgmGstGet32bitPDPtr(pPGM); 3418 3419 RTGCPHYS GCPhys; 3419 3420 rc = PGMR3DbgR3Ptr2GCPhys(pVM, pPGM->pGst32BitPdR3, &GCPhys); … … 4139 4140 RTHCPHYS HCPhysGuestCR3; 4140 4141 # ifdef VBOX_WITH_NEW_PHYS_CODE 4141 /** @todo this needs some reworking. current code is just a big hack. */ 4142 pgmLock(pVM); 4143 PPGMPAGE pPage = pgmPhysGetPage(&pVM->pgm.s, GCPhysCR3); 4144 AssertReturn(pPage, VERR_INTERNAL_ERROR); 4145 HCPhysGuestCR3 = PGM_PAGE_GET_HCPHYS(pPage); 4146 /** @todo this needs some reworking wrt. locking. */ 4142 4147 # if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) 4143 # if 1 /* temp hack */ 4144 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3); 4145 return VINF_PGM_SYNC_CR3; 4146 # else 4147 AssertFailedReturn(VERR_INTERNAL_ERROR); 4148 # endif 4149 int rc = VERR_INTERNAL_ERROR; 4148 HCPtrGuestCR3 = NIL_RTHCPTR; 4149 int rc = VINF_SUCCESS; 4150 4150 # else 4151 pgmLock(pVM);4152 PPGMPAGE pPage = pgmPhysGetPage(&pVM->pgm.s, GCPhysCR3);4153 AssertReturn(pPage, VERR_INTERNAL_ERROR);4154 4151 int rc = pgmPhysGCPhys2CCPtrInternal(pVM, pPage, GCPhysCR3 & GST_CR3_PAGE_MASK, (void **)&HCPtrGuestCR3); 4155 HCPhysGuestCR3 = PGM_PAGE_GET_HCPHYS(pPage); 4152 # endif 4156 4153 pgmUnlock(pVM); 4157 # endif4158 4154 # else /* !VBOX_WITH_NEW_PHYS_CODE */ 4159 4155 int rc = pgmRamGCPhys2HCPtrAndHCPhys(&pVM->pgm.s, GCPhysCR3 & GST_CR3_PAGE_MASK, &HCPtrGuestCR3, &HCPhysGuestCR3); … … 4187 4183 */ 4188 4184 PX86PDPT pGuestPDPT = pgmGstGetPaePDPTPtr(&pVM->pgm.s); 4189 RTGCPTR GCPtr= pVM->pgm.s.GCPtrCR3Mapping + PAGE_SIZE;4185 RTGCPTR GCPtr = pVM->pgm.s.GCPtrCR3Mapping + PAGE_SIZE; 4190 4186 for (unsigned i = 0; i < X86_PG_PAE_PDPE_ENTRIES; i++, GCPtr += PAGE_SIZE) 4191 4187 { … … 4196 4192 RTGCPHYS GCPhys = pGuestPDPT->a[i].u & X86_PDPE_PG_MASK; 4197 4193 # ifdef VBOX_WITH_NEW_PHYS_CODE 4194 pgmLock(pVM); 4195 PPGMPAGE pPage = pgmPhysGetPage(&pVM->pgm.s, GCPhys); 4196 AssertReturn(pPage, VERR_INTERNAL_ERROR); 4197 HCPhys = PGM_PAGE_GET_HCPHYS(pPage); 4198 4198 # if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) 4199 AssertFailedReturn(VERR_INTERNAL_ERROR);4200 int rc2 = V ERR_INTERNAL_ERROR;4199 HCPtr = NIL_RTHCPTR; 4200 int rc2 = VINF_SUCCESS; 4201 4201 # else 4202 pgmLock(pVM);4203 PPGMPAGE pPage = pgmPhysGetPage(&pVM->pgm.s, GCPhys);4204 AssertReturn(pPage, VERR_INTERNAL_ERROR);4205 4202 int rc2 = pgmPhysGCPhys2CCPtrInternal(pVM, pPage, GCPhys, (void **)&HCPtr); 4206 HCPhys = PGM_PAGE_GET_HCPHYS(pPage); 4203 # endif 4207 4204 pgmUnlock(pVM); 4208 # endif4209 4205 # else /* !VBOX_WITH_NEW_PHYS_CODE */ 4210 4206 int rc2 = pgmRamGCPhys2HCPtrAndHCPhys(&pVM->pgm.s, GCPhys, &HCPtr, &HCPhys); … … 4299 4295 4300 4296 # ifndef PGM_WITHOUT_MAPPINGS 4301 /* Apply all hypervisor mappings to the new CR3. 4297 /* 4298 * Apply all hypervisor mappings to the new CR3. 4302 4299 * Note that SyncCR3 will be executed in case CR3 is changed in a guest paging mode; this will 4303 4300 * make sure we check for conflicts in the new CR3 root. -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r18101 r18125 1007 1007 */ 1008 1008 PPGMPAGEMAP pMap = pTlbe->pMap; 1009 pMap->cRefs++; 1009 if (pMap) 1010 pMap->cRefs++; 1010 1011 #if 0 /** @todo implement locking properly */ 1011 1012 if (RT_LIKELY(pPage->cLocks != PGM_PAGE_MAX_LOCKS)) … … 1013 1014 { 1014 1015 AssertMsgFailed(("%RGp is entering permanent locked state!\n", GCPhys)); 1015 pMap->cRefs++; /* Extra ref to prevent it from going away. */ 1016 if (pMap) 1017 pMap->cRefs++; /* Extra ref to prevent it from going away. */ 1016 1018 } 1017 1019 #endif … … 1113 1115 */ 1114 1116 PPGMPAGEMAP pMap = pTlbe->pMap; 1115 pMap->cRefs++; 1117 if (pMap) 1118 pMap->cRefs++; 1116 1119 #if 0 /** @todo implement locking properly */ 1117 1120 if (RT_LIKELY(pPage->cLocks != PGM_PAGE_MAX_LOCKS)) … … 1119 1122 { 1120 1123 AssertMsgFailed(("%RGp is entering permanent locked state!\n", GCPhys)); 1121 pMap->cRefs++; /* Extra ref to prevent it from going away. */ 1124 if (pMap) 1125 pMap->cRefs++; /* Extra ref to prevent it from going away. */ 1122 1126 } 1123 1127 #endif
Note:
See TracChangeset
for help on using the changeset viewer.

