VirtualBox

Changeset 91295 in vbox


Ignore:
Timestamp:
Sep 17, 2021 11:05:41 AM (3 years ago)
Author:
vboxsync
Message:

VMM/CPUM: Some nested SVM init/term cleanups. bugref:10093

File:
1 edited

Legend:

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

    r91292 r91295  
    10111011
    10121012/**
    1013  * Frees memory allocated for the SVM hardware virtualization state.
     1013 * Initialize SVM hardware virtualization state (used to allocate it).
    10141014 *
    10151015 * @param   pVM     The cross context VM structure.
    10161016 */
    1017 static void cpumR3FreeSvmHwVirtState(PVM pVM)
     1017static void cpumR3InitSvmHwVirtState(PVM pVM)
    10181018{
    10191019    Assert(pVM->cpum.s.GuestFeatures.fSvm);
    1020     RT_NOREF(pVM);
    1021 }
    1022 
    1023 
    1024 /**
    1025  * Allocates memory for the SVM hardware virtualization state.
    1026  *
    1027  * @returns VBox status code.
    1028  * @param   pVM     The cross context VM structure.
    1029  */
    1030 static int cpumR3AllocSvmHwVirtState(PVM pVM)
    1031 {
    1032     Assert(pVM->cpum.s.GuestFeatures.fSvm);
    1033 
    1034     int rc = VINF_SUCCESS;
     1020
    10351021    LogRel(("CPUM: Allocating %u pages for the nested-guest SVM MSR and IO permission bitmaps\n",
    10361022            pVM->cCpus * (SVM_MSRPM_PAGES + SVM_IOPM_PAGES)));
     
    10441030        AssertCompile(SVM_IOPM_PAGES  * X86_PAGE_SIZE == sizeof(pVCpu->cpum.s.Guest.hwvirt.svm.abIoBitmap));
    10451031    }
    1046 
    1047     /* On any failure, cleanup. */
    1048     if (RT_FAILURE(rc))
    1049         cpumR3FreeSvmHwVirtState(pVM);
    1050 
    1051     return rc;
    10521032}
    10531033
     
    22672247        rc = cpumR3AllocVmxHwVirtState(pVM);
    22682248    else if (pVM->cpum.s.GuestFeatures.fSvm)
    2269         rc = cpumR3AllocSvmHwVirtState(pVM);
     2249        cpumR3InitSvmHwVirtState(pVM);
    22702250    else
    22712251        Assert(pVM->apCpusR3[0]->cpum.s.Guest.hwvirt.enmHwvirt == CPUMHWVIRT_NONE);
     
    23282308        cpumR3FreeVmxHwVirtState(pVM);
    23292309    }
    2330     else if (pVM->cpum.s.GuestFeatures.fSvm)
    2331         cpumR3FreeSvmHwVirtState(pVM);
    23322310    return VINF_SUCCESS;
    23332311}
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