Changeset 14141 in vbox for trunk/src/VBox
- Timestamp:
- Nov 12, 2008 7:12:30 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMInternal.h
r14138 r14141 3297 3297 * @param GCPtr The address. 3298 3298 */ 3299 DECLINLINE(X86P GUINT) pgmGstGet32bitPDE(PPGM pPGM, RTGCPTR GCPtr)3299 DECLINLINE(X86PDE) pgmGstGet32bitPDE(PPGM pPGM, RTGCPTR GCPtr) 3300 3300 { 3301 3301 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3302 3302 PCX86PD pGuestPD = 0; 3303 3303 int rc = PGMDynMapGCPage(PGM2VM(pPGM), pPGM->GCPhysCR3, (void **)pGuestPD); 3304 AssertRCReturn(rc, 0); 3305 return pGuestPD->a[GCPtr >> X86_PD_SHIFT].u; 3306 #else 3307 return pPGM->CTX_SUFF(pGuestPD)->a[GCPtr >> X86_PD_SHIFT].u; 3304 if (RT_FAILURE(rc)) 3305 { 3306 X86PDE ZeroPde = {0}; 3307 AssertMsgFailedReturn(("%Rrc\n", rc), ZeroPde); 3308 } 3309 return pGuestPD->a[GCPtr >> X86_PD_SHIFT]; 3310 #else 3311 return pPGM->CTX_SUFF(pGuestPD)->a[GCPtr >> X86_PD_SHIFT]; 3308 3312 #endif 3309 3313 } … … 3606 3610 * @param iPml4 The index. 3607 3611 */ 3608 DECLINLINE(X86P GPAEUINT) pgmGstGetLongModePML4E(PPGM pPGM, unsigned int iPml4)3612 DECLINLINE(X86PML4E) pgmGstGetLongModePML4E(PPGM pPGM, unsigned int iPml4) 3609 3613 { 3610 3614 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 3611 3615 PX86PML4 pGuestPml4; 3612 3616 int rc = PGMDynMapGCPage(PGM2VM(pPGM), pPGM->GCPhysCR3, (void **)pGuestPml4); 3613 AssertRCReturn(rc, 0); 3614 return pGuestPml4->a[iPml4].u; 3617 if (RT_FAILURE(rc)) 3618 { 3619 X86PML4E ZeroPml4e = {0}; 3620 AssertMsgFailedReturn(("%Rrc\n", rc), ZeroPml4e); 3621 } 3622 return pGuestPml4->a[iPml4]; 3615 3623 #else 3616 3624 Assert(pPGM->CTX_SUFF(pGstAmd64PML4)); 3617 return pPGM->CTX_SUFF(pGstAmd64PML4)->a[iPml4] .u;3625 return pPGM->CTX_SUFF(pGstAmd64PML4)->a[iPml4]; 3618 3626 #endif 3619 3627 } … … 3848 3856 if (RT_FAILURE(rc)) 3849 3857 { 3850 X86PDEPAE ZeroP DE= {0};3851 return ZeroPDE;3858 X86PDEPAE ZeroPde = {0}; 3859 AssertMsgFailedReturn(("%Rrc\n", rc), ZeroPde); 3852 3860 } 3853 3861 return pPD->a[iPd]; … … 3910 3918 * @param GCPtr The address. 3911 3919 */ 3912 DECLINLINE(X86P GPAEUINT) pgmShwGetLongModePML4E(PPGM pPGM, RTGCPTR GCPtr)3920 DECLINLINE(X86PML4E) pgmShwGetLongModePML4E(PPGM pPGM, RTGCPTR GCPtr) 3913 3921 { 3914 3922 const unsigned iPml4 = ((RTGCUINTPTR64)GCPtr >> X86_PML4_SHIFT) & X86_PML4_MASK; … … 3917 3925 Assert(pPGM->HCPhysPaePML4 != 0 && pPGM->HCPhysPaePML4 != NIL_RTHCPHYS); 3918 3926 int rc = PGM_HCPHYS_2_PTR(PGM2VM(pPGM), pPGM->HCPhysPaePML4, &pShwPml4); 3919 AssertRCReturn(rc, 0); 3920 return pShwPml4->a[iPml4].u; 3927 if (RT_FAILURE(rc)) 3928 { 3929 X86PML4E ZeroPml4e = {0}; 3930 AssertMsgFailedReturn(("%Rrc\n", rc), ZeroPml4e); 3931 } 3932 return pShwPml4->a[iPml4]; 3921 3933 # else 3922 3934 Assert(pPGM->CTX_SUFF(pShwPaePml4)); 3923 return pPGM->CTX_SUFF(pShwPaePml4)->a[iPml4] .u;3935 return pPGM->CTX_SUFF(pShwPaePml4)->a[iPml4]; 3924 3936 # endif 3925 3937 } -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r14114 r14141 932 932 * are fine.) */ 933 933 Assert(pVM->pgm.s.CTX_SUFF(pShwAmd64CR3)); 934 Pml4eGst .u= pgmGstGetLongModePML4E(&pVM->pgm.s, iPml4);934 Pml4eGst = pgmGstGetLongModePML4E(&pVM->pgm.s, iPml4); 935 935 936 936 rc = pgmPoolAlloc(pVM, Pml4eGst.u & X86_PML4E_PG_MASK, … … 971 971 /** @todo why are we looking up the guest PDPTE here? Isn't pGstPdpe 972 972 * trustworthy? */ 973 Pml4eGst .u= pgmGstGetLongModePML4E(&pVM->pgm.s, iPml4);973 Pml4eGst = pgmGstGetLongModePML4E(&pVM->pgm.s, iPml4); 974 974 PX86PDPT pPdptGst; 975 975 rc = PGM_GCPHYS_2_PTR(pVM, Pml4eGst.u & X86_PML4E_PG_MASK, &pPdptGst); -
trunk/src/VBox/VMM/VMMAll/PGMAllGst.h
r14010 r14141 179 179 */ 180 180 # if PGM_GST_TYPE == PGM_TYPE_32BIT 181 X86PDE Pde; 182 Pde.u = pgmGstGet32bitPDE(&pVM->pgm.s, GCPtr); 181 X86PDE Pde = pgmGstGet32bitPDE(&pVM->pgm.s, GCPtr); 183 182 184 183 #elif PGM_GST_TYPE == PGM_TYPE_PAE 185 X86PDEPAE 186 bool 184 X86PDEPAE Pde; 185 bool fNoExecuteBitValid = !!(CPUMGetGuestEFER(pVM) & MSR_K6_EFER_NXE); 187 186 188 187 /* pgmGstGetPaePDE will return 0 if the PDPTE is marked as not present … … 192 191 193 192 #elif PGM_GST_TYPE == PGM_TYPE_AMD64 194 PX86PML4E 195 X86PDPE 196 X86PDEPAE 197 bool 193 PX86PML4E pPml4e; 194 X86PDPE Pdpe; 195 X86PDEPAE Pde; 196 bool fNoExecuteBitValid = !!(CPUMGetGuestEFER(pVM) & MSR_K6_EFER_NXE); 198 197 199 198 Pde.u = pgmGstGetLongModePDE(&pVM->pgm.s, GCPtr, &pPml4e, &Pdpe); … … 401 400 402 401 # if PGM_GST_TYPE == PGM_TYPE_32BIT 403 X86PDE Pde; 404 Pde.u = pgmGstGet32bitPDE(&pVM->pgm.s, GCPtr); 402 X86PDE Pde = pgmGstGet32bitPDE(&pVM->pgm.s, GCPtr); 405 403 # elif PGM_GST_TYPE == PGM_TYPE_PAE 406 404 X86PDEPAE Pde; -
trunk/src/VBox/VMM/VMMAll/PGMAllShw.h
r14138 r14141 149 149 150 150 /* PML4 */ 151 X86PML4E Pml4e; 152 Pml4e.u = pgmShwGetLongModePML4E(&pVM->pgm.s, GCPtr); 151 X86PML4E Pml4e = pgmShwGetLongModePML4E(&pVM->pgm.s, GCPtr); 153 152 if (!Pml4e.n.u1Present) 154 153 return VERR_PAGE_TABLE_NOT_PRESENT; … … 294 293 X86PDEPAE Pde; 295 294 /* PML4 */ 296 X86PML4E Pml4e; 297 Pml4e.u = pgmShwGetLongModePML4E(&pVM->pgm.s, GCPtr); 295 X86PML4E Pml4e = pgmShwGetLongModePML4E(&pVM->pgm.s, GCPtr); 298 296 if (!Pml4e.n.u1Present) 299 297 return VERR_PAGE_TABLE_NOT_PRESENT;
Note:
See TracChangeset
for help on using the changeset viewer.