VirtualBox

Changeset 22060 in vbox


Ignore:
Timestamp:
Aug 7, 2009 11:55:09 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50801
Message:

More cleanup

File:
1 edited

Legend:

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

    r22059 r22060  
    522522            vmxR0SetMSRPermission(pVCpu, MSR_IA32_SYSENTER_ESP, true, true);
    523523            vmxR0SetMSRPermission(pVCpu, MSR_IA32_SYSENTER_EIP, true, true);
     524
     525            /* Long mode supported? */
     526            if (CPUMGetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_LONG_MODE))
     527            {
     528                /* Allow the guest to directly modify these MSRs; they are restored and saved automatically. */
     529                vmxR0SetMSRPermission(pVCpu, MSR_K8_LSTAR, true, true);
     530                vmxR0SetMSRPermission(pVCpu, MSR_K6_STAR, true, true);
     531                vmxR0SetMSRPermission(pVCpu, MSR_K8_SF_MASK, true, true);
     532                vmxR0SetMSRPermission(pVCpu, MSR_K8_KERNEL_GS_BASE, true, true);
     533                vmxR0SetMSRPermission(pVCpu, MSR_K8_GS_BASE, true, true);
     534                vmxR0SetMSRPermission(pVCpu, MSR_K8_FS_BASE, true, true);
     535            }
    524536        }
    525537
     
    532544
    533545        Assert(pVCpu->hwaccm.s.vmx.pHostMSRPhys);
    534         rc = VMXWriteVMCS64(VMX_VMCS_CTRL_VMEXIT_MSR_LOAD_FULL, pVCpu->hwaccm.s.vmx.pHostMSRPhys);
     546        rc = VMXWriteVMCS64(VMX_VMCS_CTRL_VMEXIT_MSR_LOAD_FULL,  pVCpu->hwaccm.s.vmx.pHostMSRPhys);
    535547        AssertRC(rc);
    536548       
     
    18681880            pMsr->u64Value    = pCtx->msrKERNELGSBASE;    /* swapgs exchange value */
    18691881            pMsr++; idxMsr++;
    1870 
    1871             if (pVM->hwaccm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_USE_MSR_BITMAPS)
    1872             {
    1873                 /* Allow the guest to directly modify these MSRs; they are restored and saved automatically. */
    1874                 vmxR0SetMSRPermission(pVCpu, MSR_K8_LSTAR, true, true);
    1875                 vmxR0SetMSRPermission(pVCpu, MSR_K6_STAR, true, true);
    1876                 vmxR0SetMSRPermission(pVCpu, MSR_K8_SF_MASK, true, true);
    1877                 vmxR0SetMSRPermission(pVCpu, MSR_K8_KERNEL_GS_BASE, true, true);
    1878                 vmxR0SetMSRPermission(pVCpu, MSR_K8_GS_BASE, true, true);
    1879                 vmxR0SetMSRPermission(pVCpu, MSR_K8_FS_BASE, true, true);
    1880             }
    18811882        }
    18821883    }
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