VirtualBox

Changeset 7842 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 9, 2008 3:19:16 PM (17 years ago)
Author:
vboxsync
Message:

AssertCR3 for PAE guest mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r7822 r7842  
    29712971    unsigned    cErrors = 0;
    29722972
    2973 #if PGM_GST_TYPE == PGM_TYPE_32BIT
     2973#if    PGM_GST_TYPE == PGM_TYPE_32BIT \
     2974    || PGM_GST_TYPE == PGM_TYPE_PAE
     2975
    29742976    PPGM        pPGM = &pVM->pgm.s;
    29752977    RTHCPHYS    HCPhysShw;              /* page address derived from the shadow page tables. */
     
    29792981
    29802982    /*
    2981      * Check that the Guest CR3 and all it's mappings are correct.
    2982      */
     2983     * Check that the Guest CR3 and all its mappings are correct.
     2984     */
     2985# if PGM_GST_TYPE == PGM_TYPE_32BIT
    29832986    AssertMsgReturn(pPGM->GCPhysCR3 == (cr3 & GST_CR3_PAGE_MASK),
    29842987                    ("Invalid GCPhysCR3=%VGp cr3=%VGp\n", pPGM->GCPhysCR3, (RTGCPHYS)cr3),
    29852988                    false);
    29862989    rc = PGMShwGetPage(pVM, pPGM->pGuestPDGC, NULL, &HCPhysShw);
     2990# else
     2991    rc = PGMShwGetPage(pVM, pPGM->pGstPaePDPTGC, NULL, &HCPhysShw);
     2992# endif
    29872993    AssertRCReturn(rc, 1);
    29882994    HCPhys = NIL_RTHCPHYS;
    29892995    rc = pgmRamGCPhys2HCPhys(pPGM, cr3 & GST_CR3_PAGE_MASK, &HCPhys);
    29902996    AssertMsgReturn(HCPhys == HCPhysShw, ("HCPhys=%VHp HCPhyswShw=%VHp (cr3)\n", HCPhys, HCPhysShw), false);
    2991 # ifdef IN_RING3
     2997# if PGM_GST_TYPE == PGM_TYPE_32BIT && defined(IN_RING3)
    29922998    RTGCPHYS GCPhys;
    29932999    rc = PGMR3DbgHCPtr2GCPhys(pVM, pPGM->pGuestPDHC, &GCPhys);
     
    29953001    AssertMsgReturn((cr3 & GST_CR3_PAGE_MASK) == GCPhys, ("GCPhys=%VGp cr3=%VGp\n", GCPhys, (RTGCPHYS)cr3), false);
    29963002# endif
    2997     const X86PD *pPDSrc = CTXSUFF(pPGM->pGuestPD);
     3003
     3004# if PGM_GST_TYPE == PGM_TYPE_32BIT
     3005    const GSTPD    *pPDSrc = CTXSUFF(pPGM->pGuestPD);
     3006# endif
    29983007
    29993008    /*
     
    30223031         iPDDst++, GCPtr += _4G / cPDEs)
    30233032    {
     3033# if PGM_GST_TYPE == PGM_TYPE_PAE
     3034        const PX86PDPAE pPDSrc = pPGM->CTXMID(ap,PaePDs)[(GCPtr >> GST_PDPT_SHIFT) & GST_PDPT_MASK];
     3035#endif
     3036
    30243037        const SHWPDE PdeDst = pPDDst->a[iPDDst];
    30253038        if (PdeDst.u & PGM_PDFLAGS_MAPPING)
     
    30623075            }
    30633076
    3064             const X86PDE    PdeSrc = pPDSrc->a[iPDDst >> (GST_PD_SHIFT - SHW_PD_SHIFT)];
     3077            const GSTPDE PdeSrc = pPDSrc->a[(iPDDst >> (GST_PD_SHIFT - SHW_PD_SHIFT)) & GST_PD_MASK];
    30653078            if (!PdeSrc.n.u1Present)
    30663079            {
     
    30813094            else
    30823095            {
     3096# if PGM_GST_TYPE == PGM_TYPE_32BIT
    30833097                if (PdeSrc.u & X86_PDE4M_PG_HIGH_MASK)
    30843098                {
     
    30883102                    continue;
    30893103                }
     3104# endif
    30903105                GCPhysGst = PdeSrc.u & GST_PDE_BIG_PG_MASK;
    30913106# if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette