- Timestamp:
- Aug 31, 2013 6:38:37 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r48212 r48215 2476 2476 int rc = VINF_SUCCESS; 2477 2477 #ifdef VBOX_WITH_AUTO_MSR_LOAD_RESTORE 2478 PVMX MSR 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; 2481 2481 2482 2482 if (u32HostExtFeatures & (X86_CPUID_EXT_FEATURE_EDX_NX | X86_CPUID_EXT_FEATURE_EDX_LONG_MODE)) … … 2506 2506 if ((u64HostEfer & MSR_K6_EFER_SCE) != (u64GuestEfer & MSR_K6_EFER_SCE)) 2507 2507 { 2508 pHostMsr->u32 IndexMSR= MSR_K6_EFER;2508 pHostMsr->u32Msr = MSR_K6_EFER; 2509 2509 pHostMsr->u32Reserved = 0; 2510 2510 pHostMsr->u64Value = u64HostEfer; … … 2514 2514 # endif 2515 2515 # else /* HC_ARCH_BITS != 64 */ 2516 pHostMsr->u32 IndexMSR= MSR_K6_EFER;2516 pHostMsr->u32Msr = MSR_K6_EFER; 2517 2517 pHostMsr->u32Reserved = 0; 2518 2518 # if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL) … … 2532 2532 if (HMVMX_IS_64BIT_HOST_MODE()) 2533 2533 { 2534 pHostMsr->u32 IndexMSR= MSR_K6_STAR;2534 pHostMsr->u32Msr = MSR_K6_STAR; 2535 2535 pHostMsr->u32Reserved = 0; 2536 2536 pHostMsr->u64Value = ASMRdMsr(MSR_K6_STAR); /* legacy syscall eip, cs & ss */ 2537 2537 pHostMsr++; cHostMsrs++; 2538 pHostMsr->u32 IndexMSR= MSR_K8_LSTAR;2538 pHostMsr->u32Msr = MSR_K8_LSTAR; 2539 2539 pHostMsr->u32Reserved = 0; 2540 2540 pHostMsr->u64Value = ASMRdMsr(MSR_K8_LSTAR); /* 64-bit mode syscall rip */ 2541 2541 pHostMsr++; cHostMsrs++; 2542 pHostMsr->u32 IndexMSR= MSR_K8_SF_MASK;2542 pHostMsr->u32Msr = MSR_K8_SF_MASK; 2543 2543 pHostMsr->u32Reserved = 0; 2544 2544 pHostMsr->u64Value = ASMRdMsr(MSR_K8_SF_MASK); /* syscall flag mask */ 2545 2545 pHostMsr++; cHostMsrs++; 2546 pHostMsr->u32 IndexMSR= MSR_K8_KERNEL_GS_BASE;2546 pHostMsr->u32Msr = MSR_K8_KERNEL_GS_BASE; 2547 2547 pHostMsr->u32Reserved = 0; 2548 2548 pHostMsr->u64Value = ASMRdMsr(MSR_K8_KERNEL_GS_BASE); /* swapgs exchange value */ … … 3935 3935 { 3936 3936 #ifdef VBOX_WITH_AUTO_MSR_LOAD_RESTORE 3937 PVM pVM= pVCpu->CTX_SUFF(pVM);3938 PVMX MSR 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; 3940 3940 3941 3941 /* See Intel spec. 4.1.4 "Enumeration of Paging Features by CPUID". */ … … 3945 3945 if (fSupportsLongMode) 3946 3946 { 3947 pGuestMsr->u32 IndexMSR= MSR_K8_LSTAR;3947 pGuestMsr->u32Msr = MSR_K8_LSTAR; 3948 3948 pGuestMsr->u32Reserved = 0; 3949 3949 pGuestMsr->u64Value = pMixedCtx->msrLSTAR; /* 64 bits mode syscall rip */ 3950 3950 pGuestMsr++; cGuestMsrs++; 3951 pGuestMsr->u32 IndexMSR= MSR_K6_STAR;3951 pGuestMsr->u32Msr = MSR_K6_STAR; 3952 3952 pGuestMsr->u32Reserved = 0; 3953 3953 pGuestMsr->u64Value = pMixedCtx->msrSTAR; /* legacy syscall eip, cs & ss */ 3954 3954 pGuestMsr++; cGuestMsrs++; 3955 pGuestMsr->u32 IndexMSR= MSR_K8_SF_MASK;3955 pGuestMsr->u32Msr = MSR_K8_SF_MASK; 3956 3956 pGuestMsr->u32Reserved = 0; 3957 3957 pGuestMsr->u64Value = pMixedCtx->msrSFMASK; /* syscall flag mask */ 3958 3958 pGuestMsr++; cGuestMsrs++; 3959 pGuestMsr->u32 IndexMSR= MSR_K8_KERNEL_GS_BASE;3959 pGuestMsr->u32Msr = MSR_K8_KERNEL_GS_BASE; 3960 3960 pGuestMsr->u32Reserved = 0; 3961 3961 pGuestMsr->u64Value = pMixedCtx->msrKERNELGSBASE; /* swapgs exchange value */ … … 3970 3970 && (pVCpu->hm.s.vmx.u32ProcCtls2 & VMX_VMCS_CTRL_PROC_EXEC2_RDTSCP)) 3971 3971 { 3972 pGuestMsr->u32 IndexMSR= MSR_K8_TSC_AUX;3972 pGuestMsr->u32Msr = MSR_K8_TSC_AUX; 3973 3973 pGuestMsr->u32Reserved = 0; 3974 3974 rc = CPUMQueryGuestMsr(pVCpu, MSR_K8_TSC_AUX, &pGuestMsr->u64Value); … … 5402 5402 for (uint32_t i = 0; i < pVCpu->hm.s.vmx.cGuestMsrs; i++) 5403 5403 { 5404 PVMX MSR pMsr = (PVMXMSR)pVCpu->hm.s.vmx.pvGuestMsr;5404 PVMXAUTOMSR pMsr = (PVMXAUTOMSR)pVCpu->hm.s.vmx.pvGuestMsr; 5405 5405 pMsr += i; 5406 switch (pMsr->u32 IndexMSR)5406 switch (pMsr->u32Msr) 5407 5407 { 5408 5408 case MSR_K8_LSTAR: pMixedCtx->msrLSTAR = pMsr->u64Value; break;
Note:
See TracChangeset
for help on using the changeset viewer.