VirtualBox

Changeset 87557 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Feb 3, 2021 11:07:24 AM (4 years ago)
Author:
vboxsync
Message:

VMM/HMVMX: Moved fUseVmcsShadowing from HM::vmxUse to HMR0PERVM::vmx. bugref:9217

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

Legend:

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

    r87556 r87557  
    11871187
    11881188        /* Use VMCS shadowing if supported. */
    1189         Assert(!pVM->hm.s.vmx.fUseVmcsShadowing);
    1190         if (   pVM->cpum.ro.GuestFeatures.fVmx
    1191             && (g_HmMsrs.u.vmx.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_VMCS_SHADOWING))
    1192             pVM->hm.s.vmx.fUseVmcsShadowing = true;
     1189        pVM->hmr0.s.vmx.fUseVmcsShadowing = pVM->cpum.ro.GuestFeatures.fVmx
     1190                                         && (g_HmMsrs.u.vmx.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_VMCS_SHADOWING);
     1191        pVM->hm.s.vmx.fUseVmcsShadowingForRing3 = pVM->hmr0.s.vmx.fUseVmcsShadowing;
    11931192
    11941193        /* Use the VMCS controls for swapping the EFER MSR if supported. */
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r87556 r87557  
    19161916
    19171917    bool const fMsrBitmaps = RT_BOOL(g_HmMsrs.u.vmx.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_MSR_BITMAPS);
    1918     bool const fShadowVmcs = !fIsNstGstVmcs ? pVM->hm.s.vmx.fUseVmcsShadowing : pVM->cpum.ro.GuestFeatures.fVmxVmcsShadowing;
     1918    bool const fShadowVmcs = !fIsNstGstVmcs ? pVM->hmr0.s.vmx.fUseVmcsShadowing : pVM->cpum.ro.GuestFeatures.fVmxVmcsShadowing;
    19191919    Assert(!pVM->cpum.ro.GuestFeatures.fVmxVmcsShadowing);  /* VMCS shadowing is not yet exposed to the guest. */
    19201920    VMXPAGEALLOCINFO aAllocInfo[] =
     
    19781978    hmR0VmxPagesFree(&pVM->hmr0.s.vmx.hMemObj);
    19791979#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
    1980     if (pVM->hm.s.vmx.fUseVmcsShadowing)
     1980    if (pVM->hmr0.s.vmx.fUseVmcsShadowing)
    19811981    {
    19821982        RTMemFree(pVM->hmr0.s.vmx.paShadowVmcsFields);
     
    20282028     */
    20292029    bool const fVirtApicAccess   = RT_BOOL(g_HmMsrs.u.vmx.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_VIRT_APIC_ACCESS);
    2030     bool const fUseVmcsShadowing = pVM->hm.s.vmx.fUseVmcsShadowing;
     2030    bool const fUseVmcsShadowing = pVM->hmr0.s.vmx.fUseVmcsShadowing;
    20312031    VMXPAGEALLOCINFO aAllocInfo[] =
    20322032    {
     
    40504050{
    40514051#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
    4052     if (pVCpu->CTX_SUFF(pVM)->hm.s.vmx.fUseVmcsShadowing)
     4052    if (pVCpu->CTX_SUFF(pVM)->hmr0.s.vmx.fUseVmcsShadowing)
    40534053    {
    40544054        hmR0VmxSetupVmcsVmreadBitmapAddr(pVCpu);
     
    45614561#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
    45624562    /* Setup the shadow VMCS fields array and VMREAD/VMWRITE bitmaps. */
    4563     if (pVM->hm.s.vmx.fUseVmcsShadowing)
     4563    if (pVM->hmr0.s.vmx.fUseVmcsShadowing)
    45644564    {
    45654565        rc = hmR0VmxSetupShadowVmcsFieldsArrays(pVM);
     
    55895589         * VMCS shadowing.
    55905590         */
    5591         if (pVCpu->CTX_SUFF(pVM)->hm.s.vmx.fUseVmcsShadowing)
     5591        if (pVCpu->CTX_SUFF(pVM)->hmr0.s.vmx.fUseVmcsShadowing)
    55925592        {
    55935593            /*
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r87556 r87557  
    17401740        LogRel(("HM: Enabled posted-interrupt processing support\n"));
    17411741
    1742     if (pVM->hm.s.vmx.fUseVmcsShadowing)
     1742    if (pVM->hm.s.vmx.fUseVmcsShadowingForRing3)
    17431743    {
    17441744        bool const fFullVmcsShadow = RT_BOOL(pVM->hm.s.vmx.MsrsForRing3.u64Misc & VMX_MISC_VMWRITE_ALL);
  • trunk/src/VBox/VMM/include/HMInternal.h

    r87556 r87557  
    520520        bool                        fSupportsVmcsEferForRing3;
    521521        /** Whether to use VMCS shadowing. */
    522         bool                        fUseVmcsShadowing;
     522        bool                        fUseVmcsShadowingForRing3;
    523523        /** Set if Last Branch Record (LBR) is enabled. */
    524524        bool                        fLbr;
     
    647647        /** Set if the preemption timer is in use. */
    648648        bool                        fUsePreemptTimer;
    649         bool                        afAlignment1[2];
     649        /** Whether to use VMCS shadowing. */
     650        bool                        fUseVmcsShadowing;
     651        bool                        afAlignment1[1];
    650652        /** Set if VPID is supported (copy in HM::vmx::fVpidForRing3). */
    651653        bool                        fVpid;
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