VirtualBox

Changeset 45739 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Apr 25, 2013 7:44:05 PM (12 years ago)
Author:
vboxsync
Message:

VMM: First part of HMIsEnabled() and PGMMap*.

Location:
trunk/src/VBox/VMM/VMMR3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r45728 r45739  
    837837static void hmR3DisableRawMode(PVM pVM)
    838838{
    839     /* Disable mapping of the hypervisor into the shadow page table. */
    840     PGMR3MappingsDisable(pVM);
    841 
    842839    /* Reinit the paging mode to force the new shadow mode. */
    843840    for (VMCPUID i = 0; i < pVM->cCpus; i++)
  • trunk/src/VBox/VMM/VMMR3/PGM.cpp

    r45701 r45739  
    12261226     * Init the structure.
    12271227     */
    1228 #ifdef PGM_WITHOUT_MAPPINGS
    1229     pVM->pgm.s.fMappingsDisabled = true;
    1230 #endif
    12311228    pVM->pgm.s.offVM       = RT_OFFSETOF(VM, pgm.s);
    12321229    pVM->pgm.s.offVCpuPGM  = RT_OFFSETOF(VMCPU, pgm.s);
  • trunk/src/VBox/VMM/VMMR3/PGMMap.cpp

    r44528 r45739  
    514514VMMR3DECL(int) PGMR3MappingsFix(PVM pVM, RTGCPTR GCPtrBase, uint32_t cb)
    515515{
    516     Log(("PGMR3MappingsFix: GCPtrBase=%RGv cb=%#x (fMappingsFixed=%RTbool fMappingsDisabled=%RTbool)\n",
    517          GCPtrBase, cb, pVM->pgm.s.fMappingsFixed, pVM->pgm.s.fMappingsDisabled));
     516    Log(("PGMR3MappingsFix: GCPtrBase=%RGv cb=%#x (fMappingsFixed=%RTbool MappingEnabled=%RTbool)\n",
     517         GCPtrBase, cb, pVM->pgm.s.fMappingsFixed, pgmMapAreMappingsEnabled(pVM)));
    518518
    519519#ifndef PGM_WITHOUT_MAPPINGS
     
    684684
    685685
    686 
    687 /**
    688  * Interface for disabling the guest mappings when switching to HM mode
    689  * during VM creation and VM reset.
    690  *
    691  * (This doesn't touch the intermediate table!)
    692  *
    693  * @returns VBox status code.
    694  * @param   pVM         Pointer to the VM.
    695  */
    696 VMMR3DECL(int) PGMR3MappingsDisable(PVM pVM)
    697 {
    698     AssertReturn(!pVM->pgm.s.fMappingsFixed,            VERR_PGM_MAPPINGS_FIXED);
    699     AssertReturn(!pVM->pgm.s.fMappingsFixedRestored,    VERR_PGM_MAPPINGS_FIXED);
    700     if (pVM->pgm.s.fMappingsDisabled)
    701         return VINF_SUCCESS;
    702 
    703 #ifdef VBOX_WITH_RAW_MODE
    704     /*
    705      * Deactivate (only applies to Virtual CPU #0).
    706      */
    707     if (pVM->aCpus[0].pgm.s.pShwPageCR3R3)
    708     {
    709         pgmLock(pVM);                           /* to avoid assertions */
    710         int rc = pgmMapDeactivateCR3(pVM, pVM->aCpus[0].pgm.s.pShwPageCR3R3);
    711         pgmUnlock(pVM);
    712         AssertRCReturn(rc, rc);
    713     }
    714 #endif /* VBOX_WITH_RAW_MODE */
    715 
    716     /*
    717      * Mark the mappings as disabled and trigger a CR3 re-sync.
    718      */
    719     pVM->pgm.s.fMappingsDisabled = true;
    720     for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
    721     {
    722         pVM->aCpus[idCpu].pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3;
    723         VMCPU_FF_SET(&pVM->aCpus[idCpu], VMCPU_FF_PGM_SYNC_CR3);
    724     }
    725     return VINF_SUCCESS;
    726 }
    727 
    728 
    729686/**
    730687 * Unfixes the mappings.
     
    739696VMMR3DECL(int) PGMR3MappingsUnfix(PVM pVM)
    740697{
    741     Log(("PGMR3MappingsUnfix: fMappingsFixed=%RTbool fMappingsDisabled=%RTbool\n", pVM->pgm.s.fMappingsFixed, pVM->pgm.s.fMappingsDisabled));
     698    Log(("PGMR3MappingsUnfix: fMappingsFixed=%RTbool MappingsEnabled=%RTbool\n", pVM->pgm.s.fMappingsFixed, pgmMapAreMappingsEnabled(pVM)));
    742699    if (   pgmMapAreMappingsEnabled(pVM)
    743700        && (    pVM->pgm.s.fMappingsFixed
     
    10571014        Pde.u = PGM_PDFLAGS_MAPPING | X86_PDE_P | X86_PDE_A | X86_PDE_RW | X86_PDE_US | (uint32_t)pMap->aPTs[i].HCPhysPT;
    10581015        pPGM->pInterPD->a[iNewPDE]        = Pde;
     1016
    10591017        /*
    10601018         * PAE.
     
    14581416{
    14591417    NOREF(pszArgs);
    1460     if (pVM->pgm.s.fMappingsDisabled)
     1418    if (!pgmMapAreMappingsEnabled(pVM))
    14611419        pHlp->pfnPrintf(pHlp, "\nThe mappings are DISABLED.\n");
    14621420    else if (pVM->pgm.s.fMappingsFixed)
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