儲存庫 vbox 的更動 15228
- 時間撮記:
- 2008-12-10 上午04:51:43 (16 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r15227 r15228 3054 3054 DECLINLINE(PGMPOOLKIND) PGM_BTH_NAME(CalcPageKind)(const GSTPDE *pPdeSrc, uint32_t cr4) 3055 3055 { 3056 # if P GM_GST_TYPE == PGM_TYPE_AMD643056 # if PMG_GST_TYPE == PGM_TYPE_AMD64 3057 3057 if (!pPdeSrc->n.u1Size) 3058 3058 # else … … 3122 3122 #ifdef PGMPOOL_WITH_MONITORING 3123 3123 int rc = pgmPoolSyncCR3(pVM); 3124 if ( RT_UNLIKELY(rc != VINF_SUCCESS))3124 if (rc != VINF_SUCCESS) 3125 3125 return rc; 3126 3126 #endif … … 3159 3159 # else /* PGM_SHW_TYPE == PGM_TYPE_PAE */ 3160 3160 # if PGM_GST_TYPE == PGM_TYPE_32BIT 3161 PX86PDEPAE paPDEDst[4];3162 paPDEDst[0] = pgmShwGetPaePDEPtr(&pVM->pgm.s, UINT32_C(0x00000000));3163 paPDEDst[1] = pgmShwGetPaePDEPtr(&pVM->pgm.s, UINT32_C(0x40000000));3164 paPDEDst[2] = pgmShwGetPaePDEPtr(&pVM->pgm.s, UINT32_C(0x80000000));3165 paPDEDst[3] = pgmShwGetPaePDEPtr(&pVM->pgm.s, UINT32_C(0xc0000000));3166 3161 PX86PDEPAE pPDEDst = NULL; 3167 3162 # endif … … 3179 3174 * Iterate the the CR3 page. 3180 3175 */ 3176 PPGMMAPPING pMapping; 3177 unsigned iPdNoMapping; 3181 3178 const bool fRawR0Enabled = EMIsRawRing0Enabled(pVM); 3182 3179 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 3183 3180 3184 3181 /* Only check mappings if they are supposed to be put into the shadow page table. */ 3185 # ifndef PGM_WITHOUT_MAPPINGS3186 PPGMMAPPING pMapping;3187 unsigned iPdNoMapping;3188 3182 if (pgmMapAreMappingsEnabled(&pVM->pgm.s)) 3189 3183 { … … 3196 3190 iPdNoMapping = ~0U; 3197 3191 } 3198 # else /* PGM_WITHOUT_MAPPINGS */3199 Assert(!pgmMapAreMappingsEnabled(&pVM->pgm.s));3200 # endif /* PGM_WITHOUT_MAPPINGS */3201 3192 3202 3193 # if PGM_GST_TYPE == PGM_TYPE_PAE 3203 3194 for (uint64_t iPdpt = 0; iPdpt < GST_PDPE_ENTRIES; iPdpt++) 3204 # endif /* PGM_GST_TYPE == PGM_TYPE_PAE */ 3205 { 3206 # if PGM_GST_TYPE == PGM_TYPE_PAE 3195 { 3207 3196 unsigned iPDSrc; 3208 3197 X86PDPE PdpeSrc; … … 3232 3221 continue; 3233 3222 } 3234 # endif /* PGM_GST_TYPE == PGM_TYPE_PAE */ 3235 3223 # else /* PGM_GST_TYPE != PGM_TYPE_PAE */ 3224 { 3225 # endif /* PGM_GST_TYPE != PGM_TYPE_PAE */ 3236 3226 for (unsigned iPD = 0; iPD < RT_ELEMENTS(pPDSrc->a); iPD++) 3237 3227 { 3238 3228 # if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT 3239 if ( RT_UNLIKELY((iPD & 255) == 0)) /* Start of new PD. */3240 pPDEDst = p aPDEDst[iPD >> 8];3229 if ((iPD & 255) == 0) /* Start of new PD. */ 3230 pPDEDst = pgmShwGetPaePDEPtr(&pVM->pgm.s, (uint32_t)iPD << GST_PD_SHIFT); 3241 3231 # endif 3242 3232 # if PGM_SHW_TYPE == PGM_TYPE_32BIT 3243 3233 Assert(pgmShwGet32BitPDEPtr(&pVM->pgm.s, (uint32_t)iPD << SHW_PD_SHIFT) == pPDEDst); 3244 3234 # elif PGM_SHW_TYPE == PGM_TYPE_PAE 3245 # if defined(VBOX_STRICT) && !defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) /* Unfortu nately not reliable with PGMR0DynMap and multiple VMs. */3235 # if defined(VBOX_STRICT) && !defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) /* Unfortuantely not reliable with PGMR0DynMap and multiple VMs. */ 3246 3236 RTGCPTR GCPtrStrict = (uint32_t)iPD << GST_PD_SHIFT; 3247 3237 # if PGM_GST_TYPE == PGM_TYPE_PAE … … 3255 3245 && (PdeSrc.n.u1User || fRawR0Enabled)) 3256 3246 { 3257 # ifndef PGM_WITHOUT_MAPPINGS 3247 # if ( PGM_GST_TYPE == PGM_TYPE_32BIT \ 3248 || PGM_GST_TYPE == PGM_TYPE_PAE) \ 3249 && !defined(PGM_WITHOUT_MAPPINGS) 3250 3258 3251 /* 3259 3252 * Check for conflicts with GC mappings. … … 3262 3255 if (iPD + iPdpt * X86_PG_PAE_ENTRIES == iPdNoMapping) 3263 3256 # else 3264 if ( RT_UNLIKELY(iPD == iPdNoMapping))3257 if (iPD == iPdNoMapping) 3265 3258 # endif 3266 3259 { … … 3272 3265 iPD += cPTs - 1; 3273 3266 # if PGM_SHW_TYPE != PGM_GST_TYPE /* SHW==PAE && GST==32BIT */ 3274 pPDEDst = p aPDEDst[(iPD + 1) >> 8];3267 pPDEDst = pgmShwGetPaePDEPtr(&pVM->pgm.s, (uint32_t)(iPD + 1) << GST_PD_SHIFT); 3275 3268 # else 3276 3269 pPDEDst += cPTs; … … 3301 3294 # endif /* !IN_RING3 */ 3302 3295 } 3303 # endif /* !PGM_WITHOUT_MAPPINGS */ 3296 # else /* (PGM_GST_TYPE != PGM_TYPE_32BIT && PGM_GST_TYPE != PGM_TYPE_PAE) || PGM_WITHOUT_MAPPINGS */ 3297 Assert(!pgmMapAreMappingsEnabled(&pVM->pgm.s)); 3298 # endif /* (PGM_GST_TYPE != PGM_TYPE_32BIT && PGM_GST_TYPE != PGM_TYPE_PAE) || PGM_WITHOUT_MAPPINGS */ 3304 3299 3305 3300 /* … … 3392 3387 } /* foreach 2MB PAE PDE in 4MB guest PDE */ 3393 3388 } 3394 # ifdef PGM_WITHOUT_MAPPINGS 3395 else 3396 # elif PGM_GST_TYPE == PGM_TYPE_PAE 3389 # if PGM_GST_TYPE == PGM_TYPE_PAE 3397 3390 else if (iPD + iPdpt * X86_PG_PAE_ENTRIES != iPdNoMapping) 3398 3391 # else … … 3404 3397 */ 3405 3398 # if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT 3406 /* first half */ 3407 if (pPDEDst->n.u1Present) 3399 for (unsigned i = 0, iPdShw = iPD * 2; i < 2; i++, iPdShw++) /* pray that the compiler unrolls this */ 3400 # elif PGM_GST_TYPE == PGM_TYPE_PAE 3401 const unsigned iPdShw = iPD + iPdpt * X86_PG_PAE_ENTRIES; 3402 # else 3403 const unsigned iPdShw = iPD; 3404 # endif 3408 3405 { 3409 pgmPoolFree(pVM, pPDEDst->u & SHW_PDE_PG_MASK, SHW_POOL_ROOT_IDX, iPD * 2); 3410 pPDEDst->u = 0; 3411 MY_STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3DstFreedSrcNP)); 3406 if (pPDEDst->n.u1Present) 3407 { 3408 pgmPoolFree(pVM, pPDEDst->u & SHW_PDE_PG_MASK, SHW_POOL_ROOT_IDX, iPdShw); 3409 pPDEDst->u = 0; 3410 MY_STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3DstFreedSrcNP)); 3411 } 3412 pPDEDst++; 3412 3413 } 3413 pPDEDst++;3414 /* second half */3415 if (pPDEDst->n.u1Present)3416 {3417 pgmPoolFree(pVM, pPDEDst->u & SHW_PDE_PG_MASK, SHW_POOL_ROOT_IDX, iPD * 2 + 1);3418 pPDEDst->u = 0;3419 MY_STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3DstFreedSrcNP));3420 }3421 pPDEDst++;3422 # else /* 1:1 */3423 if (pPDEDst->n.u1Present)3424 {3425 # if PGM_GST_TYPE == PGM_TYPE_PAE3426 const unsigned iPdShw = iPD + iPdpt * X86_PG_PAE_ENTRIES;3427 # else3428 const unsigned iPdShw = iPD;3429 # endif3430 pgmPoolFree(pVM, pPDEDst->u & SHW_PDE_PG_MASK, SHW_POOL_ROOT_IDX, iPdShw);3431 pPDEDst->u = 0;3432 MY_STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3DstFreedSrcNP));3433 }3434 pPDEDst++;3435 # endif /* 1:1 */3436 3414 } 3437 # ifndef PGM_WITHOUT_MAPPINGS3438 3415 else 3439 3416 { 3417 # if ( PGM_GST_TYPE == PGM_TYPE_32BIT \ 3418 || PGM_GST_TYPE == PGM_TYPE_PAE) \ 3419 && !defined(PGM_WITHOUT_MAPPINGS) 3420 3440 3421 const unsigned cPTs = pMapping->cb >> GST_PD_SHIFT; 3441 3422 … … 3477 3458 iPdNoMapping = pMapping ? pMapping->GCPtr >> GST_PD_SHIFT : ~0U; 3478 3459 break; 3479 # else /* !IN_RING3 */3460 # else 3480 3461 LogFlow(("SyncCR3: detected conflict -> VINF_PGM_SYNC_CR3\n")); 3481 3462 return VINF_PGM_SYNC_CR3; 3482 # endif /* !IN_RING3 */3463 # endif 3483 3464 } 3484 3465 } … … 3495 3476 iPD += cPTs - 1; 3496 3477 # if PGM_SHW_TYPE != PGM_GST_TYPE /* SHW==PAE && GST==32BIT */ 3497 pPDEDst = p aPDEDst[(iPD + 1) >> 8];3478 pPDEDst = pgmShwGetPaePDEPtr(&pVM->pgm.s, (uint32_t)(iPD + 1) << GST_PD_SHIFT); 3498 3479 # else 3499 3480 pPDEDst += cPTs; … … 3502 3483 AssertCompile(PGM_GST_TYPE == PGM_TYPE_32BIT && PGM_SHW_TYPE == PGM_TYPE_PAE); 3503 3484 # endif 3485 # else /* (PGM_GST_TYPE != PGM_TYPE_32BIT && PGM_GST_TYPE != PGM_TYPE_PAE) || PGM_WITHOUT_MAPPINGS */ 3486 Assert(!pgmMapAreMappingsEnabled(&pVM->pgm.s)); 3487 # endif /* (PGM_GST_TYPE != PGM_TYPE_32BIT && PGM_GST_TYPE != PGM_TYPE_PAE) || PGM_WITHOUT_MAPPINGS */ 3504 3488 } 3505 # endif /* !PGM_WITHOUT_MAPPINGS */3506 3489 3507 3490 } /* for iPD */
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器