VirtualBox

Changeset 16408 in vbox for trunk/src/VBox/VMM/PGMMap.cpp


Ignore:
Timestamp:
Jan 30, 2009 12:14:26 PM (16 years ago)
Author:
vboxsync
Message:

Fixed disabling of hypervisor mappings in VT-x/AMD-V mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGMMap.cpp

    r16321 r16408  
    640640}
    641641
     642/**
     643 * Disable the hypervisor mappings in the shadow page tables (doesn't touch the intermediate table!)
     644 *
     645 * @returns VBox status code.
     646 * @param   pVM         The VM.
     647 */
     648VMMR3DECL(int) PGMR3MappingsDisable(PVM pVM)
     649{
     650    uint32_t cb;
     651    int rc = PGMR3MappingsSize(pVM, &cb);
     652    AssertRCReturn(rc, rc);
     653
     654    rc = PGMMapDeactivateAll(pVM);
     655    AssertRCReturn(rc, rc);
     656
     657    /*
     658     * Mark the mappings as fixed (using fake values) and disabled.
     659     */
     660    pVM->pgm.s.fDisableMappings  = true;
     661    pVM->pgm.s.fMappingsFixed    = true;
     662    pVM->pgm.s.GCPtrMappingFixed = MM_HYPER_AREA_ADDRESS;
     663    pVM->pgm.s.cbMappingFixed    = cb;
     664    pVM->pgm.s.fSyncFlags       &= ~PGM_SYNC_MONITOR_CR3;
     665    VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);
     666    return VINF_SUCCESS;
     667}
     668
    642669
    643670/**
     
    968995         */
    969996#ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY
     997        Assert(!pPGM->pShw32BitPdR3->a[iNewPDE].n.u1Present || pgmMapAreMappingsEnabled(&pVM->pgm.s));
    970998        if (    pgmMapAreMappingsEnabled(&pVM->pgm.s)
    971999            &&  pPGM->pShw32BitPdR3->a[iNewPDE].n.u1Present)
     
    9891017        unsigned iPDE = iNewPDE * 2 % 512;
    9901018#ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY
     1019        Assert(!pPGM->apShwPaePDsR3[iPD]->a[iPDE].n.u1Present || pgmMapAreMappingsEnabled(&pVM->pgm.s));
    9911020        if (   pgmMapAreMappingsEnabled(&pVM->pgm.s)
    9921021            && pPGM->apShwPaePDsR3[iPD]->a[iPDE].n.u1Present)
     
    10061035        AssertFatal(iPDE < 512);
    10071036#ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY
     1037        Assert(!pPGM->apShwPaePDsR3[iPD]->a[iPDE].n.u1Present || pgmMapAreMappingsEnabled(&pVM->pgm.s));
    10081038        if (   pgmMapAreMappingsEnabled(&pVM->pgm.s)
    10091039            && pPGM->apShwPaePDsR3[iPD]->a[iPDE].n.u1Present)
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