VirtualBox

儲存庫 vbox 的更動 16408


忽略:
時間撮記:
2009-1-30 下午12:14:26 (16 年 以前)
作者:
vboxsync
訊息:

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

位置:
trunk
檔案:
修改 6 筆資料

圖例:

未更動
新增
刪除
  • trunk/include/VBox/pgm.h

    r16321 r16408  
    503503VMMR3DECL(int)      PGMR3TermCPU(PVM pVM);
    504504VMMR3DECL(int)      PGMR3LockCall(PVM pVM);
    505 VMMR3DECL(int)      PGMR3ChangeShwPDMappings(PVM pVM, bool fEnable);
    506505VMMR3DECL(int)      PGMR3ChangeMode(PVM pVM, PGMMODE enmGuestMode);
    507506
     
    548547VMMR3DECL(int)      PGMR3MappingsFix(PVM pVM, RTGCPTR GCPtrBase, uint32_t cb);
    549548VMMR3DECL(int)      PGMR3MappingsUnfix(PVM pVM);
     549VMMR3DECL(int)      PGMR3MappingsDisable(PVM pVM);
    550550VMMR3DECL(int)      PGMR3MapIntermediate(PVM pVM, RTUINTPTR Addr, RTHCPHYS HCPhys, unsigned cbPages);
    551551VMMR3DECL(bool)     PGMR3MapHasConflicts(PVM pVM, uint64_t cr3, bool fRawR0);
  • trunk/src/VBox/VMM/HWACCM.cpp

    r16136 r16408  
    416416
    417417    /* Disable mapping of the hypervisor into the shadow page table. */
    418     PGMR3ChangeShwPDMappings(pVM, false);
     418    PGMR3MappingsDisable(pVM);
    419419
    420420    /* Disable the switcher */
  • trunk/src/VBox/VMM/PGM.cpp

    r16376 r16408  
    45804580
    45814581
    4582 /**
    4583  * Inform PGM if we want all mappings to be put into the shadow page table. (necessary for e.g. VMX)
    4584  *
    4585  * @returns VBox status code.
    4586  * @param   pVM         VM handle.
    4587  * @param   fEnable     Enable or disable shadow mappings
    4588  */
    4589 VMMR3DECL(int) PGMR3ChangeShwPDMappings(PVM pVM, bool fEnable)
    4590 {
    4591     pVM->pgm.s.fDisableMappings = !fEnable;
    4592 
    4593     uint32_t cb;
    4594     int rc = PGMR3MappingsSize(pVM, &cb);
    4595     AssertRCReturn(rc, rc);
    4596 
    4597     /* Pretend the mappings are now fixed; to force a refresh of the reserved PDEs. */
    4598     rc = PGMR3MappingsFix(pVM, MM_HYPER_AREA_ADDRESS, cb);
    4599     AssertRCReturn(rc, rc);
    4600 
    4601     return VINF_SUCCESS;
    4602 }
    4603 
  • 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)
  • trunk/src/VBox/VMM/VMMAll/PGMAllMap.cpp

    r16376 r16408  
    209209
    210210
    211 
    212 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
    213 
    214211/**
    215212 * Sets all PDEs involved with the mapping in the shadow page table.
     
    416413    return VINF_SUCCESS;
    417414}
    418 #endif /* VBOX_WITH_PGMPOOL_PAGING_ONLY */
  • trunk/src/VBox/VMM/VMMTests.cpp

    r13858 r16408  
    478478
    479479    /* Enable mapping of the hypervisor into the shadow page table. */
    480     PGMR3ChangeShwPDMappings(pVM, true);
     480    uint32_t cb;
     481    rc = PGMR3MappingsSize(pVM, &cb);
     482    AssertRCReturn(rc, rc);
     483
     484    /* Pretend the mappings are now fixed; to force a refresh of the reserved PDEs. */
     485    rc = PGMR3MappingsFix(pVM, MM_HYPER_AREA_ADDRESS, cb);
     486    AssertRCReturn(rc, rc);
    481487
    482488    CPUMQueryHyperCtxPtr(pVM, &pHyperCtx);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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