VirtualBox

Changeset 32512 in vbox


Ignore:
Timestamp:
Sep 15, 2010 11:44:46 AM (14 years ago)
Author:
vboxsync
Message:

Enabled minimal guest state loading (VT-x; again). Watch for regressions.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/HWACCMInternal.h

    r32506 r32512  
    8282#define HWACCM_CHANGED_GUEST_LDTR               RT_BIT(6)
    8383#define HWACCM_CHANGED_GUEST_TR                 RT_BIT(7)
    84 #define HWACCM_CHANGED_GUEST_SYSENTER_MSR       RT_BIT(8)
     84#define HWACCM_CHANGED_GUEST_MSR                RT_BIT(8)
    8585#define HWACCM_CHANGED_GUEST_SEGMENT_REGS       RT_BIT(9)
    8686#define HWACCM_CHANGED_GUEST_DEBUG              RT_BIT(10)
     
    9595                                            |   HWACCM_CHANGED_GUEST_LDTR         \
    9696                                            |   HWACCM_CHANGED_GUEST_TR           \
    97                                             |   HWACCM_CHANGED_GUEST_SYSENTER_MSR \
     97                                            |   HWACCM_CHANGED_GUEST_MSR          \
    9898                                            |   HWACCM_CHANGED_GUEST_FPU          \
    9999                                            |   HWACCM_CHANGED_GUEST_DEBUG        \
     
    108108                                            |   HWACCM_CHANGED_GUEST_LDTR         \
    109109                                            |   HWACCM_CHANGED_GUEST_TR           \
    110                                             |   HWACCM_CHANGED_GUEST_SYSENTER_MSR \
     110                                            |   HWACCM_CHANGED_GUEST_MSR          \
    111111                                            |   HWACCM_CHANGED_GUEST_DEBUG        \
    112112                                            |   HWACCM_CHANGED_GUEST_FPU)
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r32506 r32512  
    15601560
    15611561    /*
    1562      * Sysenter MSRs (unconditional)
     1562     * Sysenter MSRs
    15631563     */
    1564     rc  = VMXWriteVMCS(VMX_VMCS32_GUEST_SYSENTER_CS,    pCtx->SysEnter.cs);
    1565     rc |= VMXWriteVMCS64(VMX_VMCS64_GUEST_SYSENTER_EIP, pCtx->SysEnter.eip);
    1566     rc |= VMXWriteVMCS64(VMX_VMCS64_GUEST_SYSENTER_ESP, pCtx->SysEnter.esp);
    1567     AssertRC(rc);
     1564    if (pVCpu->hwaccm.s.fContextUseFlags & HWACCM_CHANGED_GUEST_MSR)
     1565    {
     1566        rc  = VMXWriteVMCS(VMX_VMCS32_GUEST_SYSENTER_CS,    pCtx->SysEnter.cs);
     1567        rc |= VMXWriteVMCS64(VMX_VMCS64_GUEST_SYSENTER_EIP, pCtx->SysEnter.eip);
     1568        rc |= VMXWriteVMCS64(VMX_VMCS64_GUEST_SYSENTER_ESP, pCtx->SysEnter.esp);
     1569        AssertRC(rc);
     1570    }
    15681571
    15691572    /* Control registers */
     
    18301833        pVCpu->hwaccm.s.vmx.pfnStartVM  = VMXR0StartVM64;
    18311834#endif
    1832         /* Unconditionally update these as wrmsr might have changed them. */
    1833         rc = VMXWriteVMCS64(VMX_VMCS64_GUEST_FS_BASE, pCtx->fsHid.u64Base);
    1834         AssertRC(rc);
    1835         rc = VMXWriteVMCS64(VMX_VMCS64_GUEST_GS_BASE, pCtx->gsHid.u64Base);
    1836         AssertRC(rc);
     1835        if (pVCpu->hwaccm.s.fContextUseFlags & HWACCM_CHANGED_GUEST_MSR)
     1836        {
     1837            /* Update these as wrmsr might have changed them. */
     1838            rc = VMXWriteVMCS64(VMX_VMCS64_GUEST_FS_BASE, pCtx->fsHid.u64Base);
     1839            AssertRC(rc);
     1840            rc = VMXWriteVMCS64(VMX_VMCS64_GUEST_GS_BASE, pCtx->gsHid.u64Base);
     1841            AssertRC(rc);
     1842        }
    18371843    }
    18381844    else
     
    26142620
    26152621    /* Load the guest state */
    2616 #if 0
    26172622    if (!pVCpu->hwaccm.s.fContextUseFlags)
    26182623    {
     
    26212626    }
    26222627    else
    2623 #endif
    26242628    {
    26252629        rc = VMXR0LoadGuestState(pVM, pVCpu, pCtx);
     
    36123616            goto ResumeExecution;
    36133617        }
     3618        pVCpu->hwaccm.s.fContextUseFlags |= HWACCM_CHANGED_GUEST_MSR;
    36143619        /* no break */
    36153620    case VMX_EXIT_RDMSR:                /* 31 RDMSR. Guest software attempted to execute RDMSR. */
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