VirtualBox

Changeset 87539 in vbox


Ignore:
Timestamp:
Feb 2, 2021 3:10:58 PM (4 years ago)
Author:
vboxsync
Message:

VMM/HMSVM: Replaced HMR0PERVM::fHostKernelFeatures with a new global variable g_fHmHostKernelFeatures. bugref:9217

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMR0.cpp

    r87538 r87539  
    102102 * enabled and disabled each time it's used to execute guest code. */
    103103static bool             g_fHmGlobalInit;
    104 
     104/** Host kernel flags that HM might need to know (SUPKERNELFEATURES_XXX). */
     105uint32_t                g_fHmHostKernelFeatures;
    105106/** Maximum allowed ASID/VPID (inclusive).
    106107 * @todo r=bird: This is exclusive for VT-x according to source code comment.
     
    610611    g_fHmSvmSupported  = false;
    611612    g_uHmMaxAsid       = 0;
     613
     614    /*
     615     * Get host kernel features that HM might need to know in order
     616     * to co-operate and function properly with the host OS (e.g. SMAP).
     617     */
     618    g_fHmHostKernelFeatures = SUPR0GetKernelFeatures();
    612619
    613620    /*
     
    12351242        AssertReturn(!pVCpu->hmr0.s.uCurrentAsid, VERR_HM_IPE_3);
    12361243    }
    1237 
    1238     /*
    1239      * Get host kernel features that HM might need to know in order
    1240      * to co-operate and function properly with the host OS (e.g. SMAP).
    1241      *
    1242      * Technically, we could do this as part of the pre-init VM procedure
    1243      * but it shouldn't be done later than this point so we do it here.
    1244      */
    1245     pVM->hmr0.s.fHostKernelFeatures = SUPR0GetKernelFeatures();
    12461244
    12471245    /*
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r87531 r87539  
    48024802
    48034803        /* If the host has made GDT read-only, we would need to temporarily toggle CR0.WP before writing the GDT. */
    4804         PVMCC pVM = pVCpu->CTX_SUFF(pVM);
    4805         if (pVM->hmr0.s.fHostKernelFeatures & SUPKERNELFEATURES_GDT_READ_ONLY)
     4804        if (g_fHmHostKernelFeatures & SUPKERNELFEATURES_GDT_READ_ONLY)
    48064805            fRestoreHostFlags |= VMX_RESTORE_HOST_GDT_READ_ONLY;
    4807         if (pVM->hmr0.s.fHostKernelFeatures & SUPKERNELFEATURES_GDT_NEED_WRITABLE)
     4806        if (g_fHmHostKernelFeatures & SUPKERNELFEATURES_GDT_NEED_WRITABLE)
    48084807        {
    48094808            /* The GDT is read-only but the writable GDT is available. */
  • trunk/src/VBox/VMM/include/HMInternal.h

    r87538 r87539  
    637637    /** Set if we can support 64-bit guests or not. */
    638638    bool                        fAllow64BitGuests;
    639     bool                        afAlignment0[2+4];
     639    bool                        afAlignment0[2];
    640640
    641641    /** The maximum number of resumes loops allowed in ring-0 (safety precaution).
    642642     * This number is set much higher when RTThreadPreemptIsPending is reliable. */
    643643    uint32_t                    cMaxResumeLoops;
    644 
    645     /** Host kernel flags that HM might need to know (SUPKERNELFEATURES_XXX). */
    646     uint32_t                    fHostKernelFeatures;
    647644
    648645    /** VT-x specific data. */
     
    14421439#ifdef IN_RING0
    14431440extern bool             g_fHmVmxSupported;
     1441extern uint32_t         g_fHmHostKernelFeatures;
    14441442extern uint32_t         g_uHmMaxAsid;
    14451443extern bool             g_fHmVmxUsePreemptTimer;
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