VirtualBox

Changeset 48215 in vbox for trunk/src


Ignore:
Timestamp:
Aug 31, 2013 6:38:37 PM (11 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Cleanup.

File:
1 edited

Legend:

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

    r48212 r48215  
    24762476    int rc = VINF_SUCCESS;
    24772477#ifdef VBOX_WITH_AUTO_MSR_LOAD_RESTORE
    2478     PVMXMSR  pHostMsr           = (PVMXMSR)pVCpu->hm.s.vmx.pvHostMsr;
    2479     uint32_t cHostMsrs          = 0;
    2480     uint32_t u32HostExtFeatures = pVM->hm.s.cpuid.u32AMDFeatureEDX;
     2478    PVMXAUTOMSR  pHostMsr       = (PVMXAUTOMSR)pVCpu->hm.s.vmx.pvHostMsr;
     2479    uint32_t     cHostMsrs      = 0;
     2480    uint32_t     u32HostExtFeatures = pVM->hm.s.cpuid.u32AMDFeatureEDX;
    24812481
    24822482    if (u32HostExtFeatures & (X86_CPUID_EXT_FEATURE_EDX_NX | X86_CPUID_EXT_FEATURE_EDX_LONG_MODE))
     
    25062506            if ((u64HostEfer & MSR_K6_EFER_SCE) != (u64GuestEfer & MSR_K6_EFER_SCE))
    25072507            {
    2508                 pHostMsr->u32IndexMSR = MSR_K6_EFER;
     2508                pHostMsr->u32Msr      = MSR_K6_EFER;
    25092509                pHostMsr->u32Reserved = 0;
    25102510                pHostMsr->u64Value    = u64HostEfer;
     
    25142514#  endif
    25152515# else  /* HC_ARCH_BITS != 64 */
    2516         pHostMsr->u32IndexMSR = MSR_K6_EFER;
     2516        pHostMsr->u32Msr      = MSR_K6_EFER;
    25172517        pHostMsr->u32Reserved = 0;
    25182518# if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
     
    25322532    if (HMVMX_IS_64BIT_HOST_MODE())
    25332533    {
    2534         pHostMsr->u32IndexMSR  = MSR_K6_STAR;
     2534        pHostMsr->u32Msr       = MSR_K6_STAR;
    25352535        pHostMsr->u32Reserved  = 0;
    25362536        pHostMsr->u64Value     = ASMRdMsr(MSR_K6_STAR);              /* legacy syscall eip, cs & ss */
    25372537        pHostMsr++; cHostMsrs++;
    2538         pHostMsr->u32IndexMSR  = MSR_K8_LSTAR;
     2538        pHostMsr->u32Msr       = MSR_K8_LSTAR;
    25392539        pHostMsr->u32Reserved  = 0;
    25402540        pHostMsr->u64Value     = ASMRdMsr(MSR_K8_LSTAR);             /* 64-bit mode syscall rip */
    25412541        pHostMsr++; cHostMsrs++;
    2542         pHostMsr->u32IndexMSR  = MSR_K8_SF_MASK;
     2542        pHostMsr->u32Msr       = MSR_K8_SF_MASK;
    25432543        pHostMsr->u32Reserved  = 0;
    25442544        pHostMsr->u64Value     = ASMRdMsr(MSR_K8_SF_MASK);           /* syscall flag mask */
    25452545        pHostMsr++; cHostMsrs++;
    2546         pHostMsr->u32IndexMSR = MSR_K8_KERNEL_GS_BASE;
     2546        pHostMsr->u32Msr      = MSR_K8_KERNEL_GS_BASE;
    25472547        pHostMsr->u32Reserved = 0;
    25482548        pHostMsr->u64Value    = ASMRdMsr(MSR_K8_KERNEL_GS_BASE);     /* swapgs exchange value */
     
    39353935    {
    39363936#ifdef VBOX_WITH_AUTO_MSR_LOAD_RESTORE
    3937         PVM pVM             = pVCpu->CTX_SUFF(pVM);
    3938         PVMXMSR  pGuestMsr  = (PVMXMSR)pVCpu->hm.s.vmx.pvGuestMsr;
    3939         uint32_t cGuestMsrs = 0;
     3937        PVM         pVM        = pVCpu->CTX_SUFF(pVM);
     3938        PVMXAUTOMSR pGuestMsr  = (PVMXAUTOMSR)pVCpu->hm.s.vmx.pvGuestMsr;
     3939        uint32_t    cGuestMsrs = 0;
    39403940
    39413941        /* See Intel spec. 4.1.4 "Enumeration of Paging Features by CPUID". */
     
    39453945        if (fSupportsLongMode)
    39463946        {
    3947             pGuestMsr->u32IndexMSR = MSR_K8_LSTAR;
     3947            pGuestMsr->u32Msr      = MSR_K8_LSTAR;
    39483948            pGuestMsr->u32Reserved = 0;
    39493949            pGuestMsr->u64Value    = pMixedCtx->msrLSTAR;           /* 64 bits mode syscall rip */
    39503950            pGuestMsr++; cGuestMsrs++;
    3951             pGuestMsr->u32IndexMSR = MSR_K6_STAR;
     3951            pGuestMsr->u32Msr      = MSR_K6_STAR;
    39523952            pGuestMsr->u32Reserved = 0;
    39533953            pGuestMsr->u64Value    = pMixedCtx->msrSTAR;            /* legacy syscall eip, cs & ss */
    39543954            pGuestMsr++; cGuestMsrs++;
    3955             pGuestMsr->u32IndexMSR = MSR_K8_SF_MASK;
     3955            pGuestMsr->u32Msr      = MSR_K8_SF_MASK;
    39563956            pGuestMsr->u32Reserved = 0;
    39573957            pGuestMsr->u64Value    = pMixedCtx->msrSFMASK;          /* syscall flag mask */
    39583958            pGuestMsr++; cGuestMsrs++;
    3959             pGuestMsr->u32IndexMSR = MSR_K8_KERNEL_GS_BASE;
     3959            pGuestMsr->u32Msr      = MSR_K8_KERNEL_GS_BASE;
    39603960            pGuestMsr->u32Reserved = 0;
    39613961            pGuestMsr->u64Value    = pMixedCtx->msrKERNELGSBASE;    /* swapgs exchange value */
     
    39703970            && (pVCpu->hm.s.vmx.u32ProcCtls2 & VMX_VMCS_CTRL_PROC_EXEC2_RDTSCP))
    39713971        {
    3972             pGuestMsr->u32IndexMSR = MSR_K8_TSC_AUX;
     3972            pGuestMsr->u32Msr      = MSR_K8_TSC_AUX;
    39733973            pGuestMsr->u32Reserved = 0;
    39743974            rc = CPUMQueryGuestMsr(pVCpu, MSR_K8_TSC_AUX, &pGuestMsr->u64Value);
     
    54025402    for (uint32_t i = 0; i < pVCpu->hm.s.vmx.cGuestMsrs; i++)
    54035403    {
    5404         PVMXMSR pMsr = (PVMXMSR)pVCpu->hm.s.vmx.pvGuestMsr;
     5404        PVMXAUTOMSR pMsr = (PVMXAUTOMSR)pVCpu->hm.s.vmx.pvGuestMsr;
    54055405        pMsr += i;
    5406         switch (pMsr->u32IndexMSR)
     5406        switch (pMsr->u32Msr)
    54075407        {
    54085408            case MSR_K8_LSTAR:          pMixedCtx->msrLSTAR  = pMsr->u64Value;                   break;
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