Changeset 42622 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Aug 6, 2012 1:43:53 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r42407 r42622 2262 2262 2263 2263 /* First sync back EIP, ESP, and EFLAGS. */ 2264 rc = VMXReadCachedVMCS(VMX_VMCS64_GUEST_RIP, 2264 rc = VMXReadCachedVMCS(VMX_VMCS64_GUEST_RIP, &val); 2265 2265 AssertRC(rc); 2266 2266 pCtx->rip = val; 2267 rc = VMXReadCachedVMCS(VMX_VMCS64_GUEST_RSP, 2267 rc = VMXReadCachedVMCS(VMX_VMCS64_GUEST_RSP, &val); 2268 2268 AssertRC(rc); 2269 2269 pCtx->rsp = val; … … 2331 2331 2332 2332 /* System MSRs */ 2333 VMXReadCachedVMCS(VMX_VMCS32_GUEST_SYSENTER_CS, &val);2333 VMXReadCachedVMCS(VMX_VMCS32_GUEST_SYSENTER_CS, &val); 2334 2334 pCtx->SysEnter.cs = val; 2335 2335 VMXReadCachedVMCS(VMX_VMCS64_GUEST_SYSENTER_EIP, &val); … … 2341 2341 VMX_READ_SELREG(LDTR, ldtr); 2342 2342 2343 VMXReadCachedVMCS(VMX_VMCS32_GUEST_GDTR_LIMIT, &val);2343 VMXReadCachedVMCS(VMX_VMCS32_GUEST_GDTR_LIMIT, &val); 2344 2344 pCtx->gdtr.cbGdt = val; 2345 2345 VMXReadCachedVMCS(VMX_VMCS64_GUEST_GDTR_BASE, &val); 2346 2346 pCtx->gdtr.pGdt = val; 2347 2347 2348 VMXReadCachedVMCS(VMX_VMCS32_GUEST_IDTR_LIMIT, &val);2348 VMXReadCachedVMCS(VMX_VMCS32_GUEST_IDTR_LIMIT, &val); 2349 2349 pCtx->idtr.cbIdt = val; 2350 2350 VMXReadCachedVMCS(VMX_VMCS64_GUEST_IDTR_BASE, &val); … … 2390 2390 pCtx->msrSFMASK = pMsr->u64Value; 2391 2391 break; 2392 2393 2392 /* The KERNEL_GS_BASE MSR doesn't work reliably with auto load/store. See @bugref{6208} */ 2394 2393 #if 0 … … 2400 2399 CPUMSetGuestMsr(pVCpu, MSR_K8_TSC_AUX, pMsr->u64Value); 2401 2400 break; 2402 2403 2401 case MSR_K6_EFER: 2404 2402 /* EFER can't be changed without causing a VM-exit. */ … … 4990 4988 static void hmR0VmxFlushVPID(PVM pVM, PVMCPU pVCpu, VMX_FLUSH_VPID enmFlush, RTGCPTR GCPtr) 4991 4989 { 4992 #if HC_ARCH_BITS == 32 4993 /* 4994 * If we get a flush in 64-bit guest mode, then force a full TLB flush. invvpid probably takes only 32-bit addresses. 4995 */ 4996 if ( CPUMIsGuestInLongMode(pVCpu) 4997 && !VMX_IS_64BIT_HOST_MODE()) 4998 { 4999 VMCPU_FF_SET(pVCpu, VMCPU_FF_TLB_FLUSH); 4990 uint64_t descriptor[2]; 4991 4992 Assert(pVM->hwaccm.s.vmx.fVPID); 4993 if (enmFlush == VMX_FLUSH_VPID_ALL_CONTEXTS) 4994 { 4995 descriptor[0] = 0; 4996 descriptor[1] = 0; 5000 4997 } 5001 4998 else 5002 #endif 5003 { 5004 uint64_t descriptor[2]; 5005 5006 Assert(pVM->hwaccm.s.vmx.fVPID); 5007 if (enmFlush == VMX_FLUSH_VPID_ALL_CONTEXTS) 5008 { 5009 descriptor[0] = 0; 5010 descriptor[1] = 0; 5011 } 5012 else 5013 { 5014 AssertPtr(pVCpu); 5015 Assert(pVCpu->hwaccm.s.uCurrentASID != 0); 5016 descriptor[0] = pVCpu->hwaccm.s.uCurrentASID; 5017 descriptor[1] = GCPtr; 5018 } 5019 int rc = VMXR0InvVPID(enmFlush, &descriptor[0]); NOREF(rc); 5020 AssertMsg(rc == VINF_SUCCESS, 5021 ("VMXR0InvVPID %x %x %RGv failed with %d\n", enmFlush, pVCpu ? pVCpu->hwaccm.s.uCurrentASID : 0, GCPtr, rc)); 5022 } 4999 { 5000 AssertPtr(pVCpu); 5001 Assert(pVCpu->hwaccm.s.uCurrentASID != 0); 5002 descriptor[0] = pVCpu->hwaccm.s.uCurrentASID; 5003 descriptor[1] = GCPtr; 5004 } 5005 int rc = VMXR0InvVPID(enmFlush, &descriptor[0]); NOREF(rc); 5006 AssertMsg(rc == VINF_SUCCESS, 5007 ("VMXR0InvVPID %x %x %RGv failed with %d\n", enmFlush, pVCpu ? pVCpu->hwaccm.s.uCurrentASID : 0, GCPtr, rc)); 5023 5008 } 5024 5009
Note:
See TracChangeset
for help on using the changeset viewer.