Changeset 14102 in vbox for trunk/src/VBox
- Timestamp:
- Nov 11, 2008 5:49:53 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r14101 r14102 3186 3186 Assert(PGMPhysGCPhys2HCPtrAssert(pVM, (RTGCPHYS)(cr3 & GST_CR3_PAGE_MASK), sizeof(*pPDSrc)) == pPDSrc); 3187 3187 # endif 3188 # endif 3188 # endif /* PGM_GST_TYPE == PGM_TYPE_32BIT */ 3189 3189 3190 3190 /* 3191 * Iterate the page directory.3191 * Iterate the the CR3 page. 3192 3192 */ 3193 3193 PPGMMAPPING pMapping; … … 3207 3207 iPdNoMapping = ~0U; 3208 3208 } 3209 3209 3210 # if PGM_GST_TYPE == PGM_TYPE_PAE 3210 3211 for (uint64_t iPdpt = 0; iPdpt < GST_PDPE_ENTRIES; iPdpt++) … … 3245 3246 # if PGM_SHW_TYPE == PGM_TYPE_32BIT 3246 3247 Assert(&pVM->pgm.s.CTXMID(p,32BitPD)->a[iPD] == pPDEDst); 3247 # elif PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT 3248 AssertMsg(&pVM->pgm.s.CTXMID(ap,PaePDs)[iPD * 2 / 512]->a[iPD * 2 % 512] == pPDEDst, ("%p vs %p\n", &pVM->pgm.s.CTXMID(ap,PaePDs)[iPD * 2 / 512]->a[iPD * 2 % 512], pPDEDst)); 3248 # elif PGM_SHW_TYPE == PGM_TYPE_PAE 3249 # ifdef VBOX_STRICT 3250 RTGCPTR GCPtrStrict = (uint32_t)iPD << GST_PD_SHIFT; 3251 # if PGM_GST_TYPE == PGM_TYPE_PAE 3252 GCPtrStrict |= iPdpt << X86_PDPT_SHIFT; 3253 # endif 3254 AssertMsg(pgmShwGetPaePDEPtr(&pVM->pgm.s, GCPtrStrict) == pPDEDst, ("%p vs %p (%RGv)\n", pgmShwGetPaePDEPtr(&pVM->pgm.s, GCPtrStrict), pPDEDst, GCPtrStrict)); 3255 # endif /* VBOX_STRICT */ 3249 3256 # endif 3250 3257 GSTPDE PdeSrc = pPDSrc->a[iPD]; … … 3291 3298 pMapping = pMapping->pNextR3; 3292 3299 iPdNoMapping = pMapping ? pMapping->GCPtr >> GST_PD_SHIFT : ~0U; 3293 # else 3300 # else /* !IN_RING3 */ 3294 3301 LogFlow(("SyncCR3: detected conflict -> VINF_PGM_SYNC_CR3\n")); 3295 3302 return VINF_PGM_SYNC_CR3; 3296 # endif 3303 # endif /* !IN_RING3 */ 3297 3304 } 3298 3305 # else /* (PGM_GST_TYPE != PGM_TYPE_32BIT && PGM_GST_TYPE != PGM_TYPE_PAE) || PGM_WITHOUT_MAPPINGS */ … … 3310 3317 for (unsigned i = 0, iPdShw = iPD * 2; i < 2; i++, iPdShw++) /* pray that the compiler unrolls this */ 3311 3318 # elif PGM_GST_TYPE == PGM_TYPE_PAE 3312 3319 const unsigned iPdShw = iPD + iPdpt * X86_PG_PAE_ENTRIES; NOREF(iPdShw); 3313 3320 # else 3314 3321 const unsigned iPdShw = iPD; NOREF(iPdShw); … … 3384 3391 else 3385 3392 MY_STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3DstNotPresent)); 3393 3394 /* advance */ 3386 3395 pPDEDst++; 3387 } 3396 } /* foreach 2MB PAE PDE in 4MB guest PDE */ 3388 3397 } 3389 3398 # if PGM_GST_TYPE == PGM_TYPE_PAE … … 3399 3408 for (unsigned i = 0, iPdShw = iPD * 2; i < 2; i++, iPdShw++) /* pray that the compiler unrolls this */ 3400 3409 # elif PGM_GST_TYPE == PGM_TYPE_PAE 3401 const unsigned iPdShw = iPD + iPdpt * X86_PG_PAE_ENTRIES; NOREF(iPdShw);3410 const unsigned iPdShw = iPD + iPdpt * X86_PG_PAE_ENTRIES; 3402 3411 # else 3403 const unsigned iPdShw = iPD; NOREF(iPdShw);3412 const unsigned iPdShw = iPD; 3404 3413 # endif 3405 3414 { … … 3431 3440 { 3432 3441 /* 3433 * Check for conflicts for subsequent pagetables3434 * and advance to the next mapping.3435 */3442 * Check for conflicts for subsequent pagetables 3443 * and advance to the next mapping. 3444 */ 3436 3445 iPdNoMapping = ~0U; 3437 3446 unsigned iPT = cPTs; … … 3451 3460 3452 3461 /* 3453 * Update iPdNoMapping and pMapping.3454 */3462 * Update iPdNoMapping and pMapping. 3463 */ 3455 3464 pMapping = pVM->pgm.s.CTX_SUFF(pMappings); 3456 3465 while (pMapping && pMapping->GCPtr < (iPD << GST_PD_SHIFT)) … … 3547 3556 || PGM_GST_TYPE == PGM_TYPE_AMD64 3548 3557 3549 # 3558 # if PGM_GST_TYPE == PGM_TYPE_AMD64 3550 3559 bool fBigPagesSupported = true; 3551 # 3560 # else 3552 3561 bool fBigPagesSupported = !!(CPUMGetGuestCR4(pVM) & X86_CR4_PSE); 3553 # 3562 # endif 3554 3563 PPGM pPGM = &pVM->pgm.s; 3555 3564 RTGCPHYS GCPhysGst; /* page address derived from the guest page tables. */ … … 3582 3591 AssertMsgReturn((cr3 & GST_CR3_PAGE_MASK) == GCPhys, ("GCPhys=%RGp cr3=%RGp\n", GCPhys, (RTGCPHYS)cr3), false); 3583 3592 # endif 3584 # endif /* !IN_RING0 */3593 # endif /* !IN_RING0 */ 3585 3594 3586 3595 /* … … 3674 3683 PX86PDPE pPdpeDst; 3675 3684 RTGCPHYS GCPhysPdeSrc; 3676 # 3685 # if PGM_GST_TYPE == PGM_TYPE_PAE 3677 3686 X86PDPE PdpeSrc; 3678 3687 PGSTPD pPDSrc = pgmGstGetPaePDPtr(&pVM->pgm.s, GCPtr, &iPDSrc, &PdpeSrc); 3679 3688 PX86PDPT pPdptDst = pgmShwGetPaePDPTPtr(&pVM->pgm.s); 3680 # 3689 # else 3681 3690 PX86PML4E pPml4eSrc; 3682 3691 X86PDPE PdpeSrc; … … 3693 3702 } 3694 3703 Assert(pPDDst); 3695 # 3704 # endif 3696 3705 Assert(iPDSrc == 0); 3697 3706 … … 3739 3748 # endif 3740 3749 3741 # else 3750 # else /* PGM_GST_TYPE != PGM_TYPE_AMD64 && PGM_GST_TYPE != PGM_TYPE_PAE */ 3742 3751 { 3743 # endif 3752 # endif /* PGM_GST_TYPE != PGM_TYPE_AMD64 && PGM_GST_TYPE != PGM_TYPE_PAE */ 3744 3753 # if PGM_GST_TYPE == PGM_TYPE_32BIT 3745 3754 GSTPD const *pPDSrc = pgmGstGet32bitPDPtr(&pVM->pgm.s); … … 3747 3756 PCX86PD pPDDst = pPGM->CTXMID(p,32BitPD); 3748 3757 # endif 3749 # endif 3758 # endif /* PGM_GST_TYPE == PGM_TYPE_32BIT */ 3750 3759 /* 3751 3760 * Iterate the shadow page directory. … … 3758 3767 iPDDst++, GCPtr += cIncrement) 3759 3768 { 3760 # 3769 # if PGM_SHW_TYPE == PGM_TYPE_PAE 3761 3770 const SHWPDE PdeDst = *pgmShwGetPaePDEPtr(pPGM, GCPtr); 3762 # 3771 # else 3763 3772 const SHWPDE PdeDst = pPDDst->a[iPDDst]; 3764 # 3773 # endif 3765 3774 if (PdeDst.u & PGM_PDFLAGS_MAPPING) 3766 3775 { … … 4268 4277 # endif 4269 4278 4270 #endif 4279 #endif /* GST == 32BIT, PAE or AMD64 */ 4271 4280 return cErrors; 4272 4281
Note:
See TracChangeset
for help on using the changeset viewer.