VirtualBox

Changeset 94944 in vbox


Ignore:
Timestamp:
May 9, 2022 9:45:33 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151352
Message:

VMM/HM: Use g_CpumHostFeatures instead of the copy in the VM structure. bugref:10093

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/vm.h

    r94882 r94944  
    12481248            uint8_t                 abHidden0[64];
    12491249            /** Host CPU feature information. */
    1250             CPUMFEATURES            HostFeatures;
     1250            CPUMFEATURES            HostFeaturesX;
    12511251            /** Guest CPU feature information. */
    12521252            CPUMFEATURES            GuestFeatures;
  • trunk/src/VBox/VMM/VMMAll/VMXAllTemplate.cpp.h

    r94930 r94944  
    792792     */
    793793    PCVMCC pVM = pVCpu->CTX_SUFF(pVM);
    794     bool const fFsGsBase    = pVM->cpum.ro.GuestFeatures.fFsGsBase;
    795     bool const fXSaveRstor  = pVM->cpum.ro.GuestFeatures.fXSaveRstor;
    796     bool const fFxSaveRstor = pVM->cpum.ro.GuestFeatures.fFxSaveRstor;
     794    bool fFsGsBase    = pVM->cpum.ro.GuestFeatures.fFsGsBase;
     795    bool fXSaveRstor  = pVM->cpum.ro.GuestFeatures.fXSaveRstor;
     796    bool fFxSaveRstor = pVM->cpum.ro.GuestFeatures.fFxSaveRstor;
    797797
    798798    /*
     
    800800     * Ensure features exposed to the guest are present on the host.
    801801     */
    802     Assert(!fFsGsBase    || pVM->cpum.ro.HostFeatures.fFsGsBase);
    803     Assert(!fXSaveRstor  || pVM->cpum.ro.HostFeatures.fXSaveRstor);
    804     Assert(!fFxSaveRstor || pVM->cpum.ro.HostFeatures.fFxSaveRstor);
     802    AssertStmt(!fFsGsBase    || g_CpumHostFeatures.s.fFsGsBase,    fFsGsBase = 0);
     803    AssertStmt(!fXSaveRstor  || g_CpumHostFeatures.s.fXSaveRstor,  fXSaveRstor = 0);
     804    AssertStmt(!fFxSaveRstor || g_CpumHostFeatures.s.fFxSaveRstor, fFxSaveRstor = 0);
    805805
    806806    uint64_t const fGstMask = (  X86_CR4_PVI
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r94882 r94944  
    42904290     * This should be done -after- any RDTSCPs for obtaining the host timestamp (TM, STAM etc).
    42914291     */
    4292     if (   pVM->cpum.ro.HostFeatures.fRdTscP
     4292    if (   g_CpumHostFeatures.s.fRdTscP
    42934293        && !(pVmcb->ctrl.u64InterceptCtrl & SVM_CTRL_INTERCEPT_RDTSCP))
    42944294    {
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r94882 r94944  
    21522152     * See Intel "Model-Specific Registers" spec.
    21532153     */
    2154     uint32_t const uFamilyModel = (pVM->cpum.ro.HostFeatures.uFamily << 8)
    2155                                 | pVM->cpum.ro.HostFeatures.uModel;
     2154    uint32_t const uFamilyModel = (g_CpumHostFeatures.s.uFamily << 8)
     2155                                | g_CpumHostFeatures.s.uModel;
    21562156    switch (uFamilyModel)
    21572157    {
     
    36483648        {
    36493649            /* Verify that the host is NX capable. */
    3650             Assert(pVCpu->CTX_SUFF(pVM)->cpum.ro.HostFeatures.fNoExecute);
     3650            Assert(g_CpumHostFeatures.s.fNoExecute);
    36513651            return true;
    36523652        }
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r94882 r94944  
    730730     * Check if L1D flush is needed/possible.
    731731     */
    732     if (   !pVM->cpum.ro.HostFeatures.fFlushCmd
    733         || pVM->cpum.ro.HostFeatures.enmMicroarch <  kCpumMicroarch_Intel_Core7_Nehalem
    734         || pVM->cpum.ro.HostFeatures.enmMicroarch >= kCpumMicroarch_Intel_Core7_End
    735         || pVM->cpum.ro.HostFeatures.fArchVmmNeedNotFlushL1d
    736         || pVM->cpum.ro.HostFeatures.fArchRdclNo)
     732    if (   !g_CpumHostFeatures.s.fFlushCmd
     733        || g_CpumHostFeatures.s.enmMicroarch <  kCpumMicroarch_Intel_Core7_Nehalem
     734        || g_CpumHostFeatures.s.enmMicroarch >= kCpumMicroarch_Intel_Core7_End
     735        || g_CpumHostFeatures.s.fArchVmmNeedNotFlushL1d
     736        || g_CpumHostFeatures.s.fArchRdclNo)
    737737        pVM->hm.s.fL1dFlushOnSched = pVM->hm.s.fL1dFlushOnVmEntry = false;
    738738
     
    741741     * On atoms and knight family CPUs, we will only allow clearing on scheduling.
    742742     */
    743     if (   !pVM->cpum.ro.HostFeatures.fMdsClear
    744         || pVM->cpum.ro.HostFeatures.fArchMdsNo)
     743    if (   !g_CpumHostFeatures.s.fMdsClear
     744        || g_CpumHostFeatures.s.fArchMdsNo)
    745745        pVM->hm.s.fMdsClearOnSched = pVM->hm.s.fMdsClearOnVmEntry = false;
    746     else if (   (   pVM->cpum.ro.HostFeatures.enmMicroarch >=  kCpumMicroarch_Intel_Atom_Airmount
    747                  && pVM->cpum.ro.HostFeatures.enmMicroarch <   kCpumMicroarch_Intel_Atom_End)
    748              || (   pVM->cpum.ro.HostFeatures.enmMicroarch >=  kCpumMicroarch_Intel_Phi_KnightsLanding
    749                  && pVM->cpum.ro.HostFeatures.enmMicroarch <   kCpumMicroarch_Intel_Phi_End))
     746    else if (   (   g_CpumHostFeatures.s.enmMicroarch >=  kCpumMicroarch_Intel_Atom_Airmount
     747                 && g_CpumHostFeatures.s.enmMicroarch <   kCpumMicroarch_Intel_Atom_End)
     748             || (   g_CpumHostFeatures.s.enmMicroarch >=  kCpumMicroarch_Intel_Phi_KnightsLanding
     749                 && g_CpumHostFeatures.s.enmMicroarch <   kCpumMicroarch_Intel_Phi_End))
    750750    {
    751751        if (!pVM->hm.s.fMdsClearOnSched)
     
    753753        pVM->hm.s.fMdsClearOnVmEntry = false;
    754754    }
    755     else if (   pVM->cpum.ro.HostFeatures.enmMicroarch <  kCpumMicroarch_Intel_Core7_Nehalem
    756              || pVM->cpum.ro.HostFeatures.enmMicroarch >= kCpumMicroarch_Intel_Core7_End)
     755    else if (   g_CpumHostFeatures.s.enmMicroarch <  kCpumMicroarch_Intel_Core7_Nehalem
     756             || g_CpumHostFeatures.s.enmMicroarch >= kCpumMicroarch_Intel_Core7_End)
    757757        pVM->hm.s.fMdsClearOnSched = pVM->hm.s.fMdsClearOnVmEntry = false;
    758758
Note: See TracChangeset for help on using the changeset viewer.

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