Changeset 10832 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jul 23, 2008 2:18:23 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r10828 r10832 280 280 /** @note VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_MWAIT_EXIT might cause a vmlaunch failure with an invalid control fields error. (combined with some other exit reasons) */ 281 281 282 #if HC_ARCH_BITS == 64283 if (pVM->hwaccm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_USE_TPR_SHADOW)284 {285 /* CR8 reads from the APIC shadow page; writes cause an exit is they lower the TPR below the threshold */286 val |= VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_USE_TPR_SHADOW;287 Assert(pVM->hwaccm.s.vmx.pAPIC);288 }289 else290 /* Exit on CR8 reads & writes in case the TPR shadow feature isn't present. */291 val |= VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR8_STORE_EXIT | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR8_LOAD_EXIT;292 #endif293 282 /* Mask away the bits that the CPU doesn't support */ 294 283 /** @todo make sure they don't conflict with the above requirements. */ … … 1002 991 rc = VMXWriteVMCS(VMX_VMCS_GUEST_GS_BASE, pCtx->gsHid.u64Base); 1003 992 AssertRC(rc); 993 994 #if HC_ARCH_BITS == 64 995 if (!(pVM->hwaccm.s.vmx.proc_ctls & (VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_USE_TPR_SHADOW | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR8_STORE_EXIT | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR8_LOAD_EXIT))) 996 { 997 if (pVM->hwaccm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_USE_TPR_SHADOW) 998 { 999 /* CR8 reads from the APIC shadow page; writes cause an exit is they lower the TPR below the threshold */ 1000 pVM->hwaccm.s.vmx.proc_ctls |= VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_USE_TPR_SHADOW; 1001 Assert(pVM->hwaccm.s.vmx.pAPIC); 1002 } 1003 else 1004 /* Exit on CR8 reads & writes in case the TPR shadow feature isn't present. */ 1005 pVM->hwaccm.s.vmx.proc_ctls |= VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR8_STORE_EXIT | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR8_LOAD_EXIT; 1006 1007 rc = VMXWriteVMCS(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS, pVM->hwaccm.s.vmx.proc_ctls); 1008 AssertRC(rc); 1009 } 1010 #endif 1011 1004 1012 } 1005 1013 else 1006 1014 { 1015 #if HC_ARCH_BITS == 64 1016 if (pVM->hwaccm.s.vmx.proc_ctls & (VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_USE_TPR_SHADOW | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR8_STORE_EXIT | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR8_LOAD_EXIT)) 1017 { 1018 pVM->hwaccm.s.vmx.proc_ctls &= ~(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_USE_TPR_SHADOW | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR8_STORE_EXIT | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR8_LOAD_EXIT); 1019 1020 rc = VMXWriteVMCS(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS, pVM->hwaccm.s.vmx.proc_ctls); 1021 AssertRC(rc); 1022 } 1023 #endif 1007 1024 pVM->hwaccm.s.vmx.pfnStartVM = VMXR0StartVM32; 1008 1025 }
Note:
See TracChangeset
for help on using the changeset viewer.