VirtualBox

Changeset 10833

Show
Ignore:
Timestamp:
07/23/08 16:27:42 (3 months ago)
Author:
vboxsync
Message:

Backed out 33617. Doesn't solve anything.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r10832 r10833  
    280280    /** @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) */ 
    281281 
     282#if HC_ARCH_BITS == 64 
     283    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    else 
     290        /* 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#endif 
    282293    /* Mask away the bits that the CPU doesn't support */ 
    283294    /** @todo make sure they don't conflict with the above requirements. */ 
     
    9911002        rc = VMXWriteVMCS(VMX_VMCS_GUEST_GS_BASE, pCtx->gsHid.u64Base); 
    9921003        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  
    10121004    } 
    10131005    else 
    10141006    { 
    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 
    10241007        pVM->hwaccm.s.vmx.pfnStartVM  = VMXR0StartVM32; 
    10251008    } 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy