VirtualBox

Changeset 11756 in vbox


Ignore:
Timestamp:
Aug 28, 2008 12:28:57 PM (16 years ago)
Author:
vboxsync
Message:

Use the wbinvd intercept if it's present in the secondary control.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/hwacc_vmx.h

    r10831 r11756  
    235235/** 43 TPR below threshold. Guest software executed MOV to CR8. */
    236236#define VMX_EXIT_TPR                43
     237/** 54 WBINVD. Guest software attempted to execute WBINVD. */
     238#define VMX_EXIT_WBINVD             54
    237239
    238240/** @} */
  • trunk/src/VBox/VMM/HWACCMInternal.h

    r11696 r11756  
    255255        /** Current VMX_VMCS_CTRL_PROC_EXEC_CONTROLS. */
    256256        uint64_t                    proc_ctls;
     257
     258        /** Current VMX_VMCS_CTRL_PROC_EXEC_CONTROLS2. */
     259        uint64_t                    proc_ctls2;
    257260
    258261        /** Current CR0 mask. */
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r11706 r11756  
    320320#endif
    321321
     322    /* We will use the secondary control if it's present. */
     323    val |= VMX_VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL;
     324
    322325    /* Mask away the bits that the CPU doesn't support */
    323326    /** @todo make sure they don't conflict with the above requirements. */
     
    327330    rc = VMXWriteVMCS(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS, val);
    328331    AssertRC(rc);
     332
     333    if (pVM->hwaccm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL)
     334    {
     335        /* VMX_VMCS_CTRL_PROC_EXEC_CONTROLS2
     336         * Set required bits to one and zero according to the MSR capabilities.
     337         */
     338        val  = pVM->hwaccm.s.vmx.msr.vmx_proc_ctls2.n.disallowed0;
     339        val |= VMX_VMCS_CTRL_PROC_EXEC2_WBINVD_EXIT;
     340
     341        /* Mask away the bits that the CPU doesn't support */
     342        /** @todo make sure they don't conflict with the above requirements. */
     343        val &= pVM->hwaccm.s.vmx.msr.vmx_proc_ctls2.n.allowed1;
     344        pVM->hwaccm.s.vmx.proc_ctls2 = val;
     345
     346        rc = VMXWriteVMCS(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS2, val);
     347        AssertRC(rc);
     348    }
    329349
    330350    /* VMX_VMCS_CTRL_CR3_TARGET_COUNT
     
    17521772        goto ResumeExecution;   /* we check for pending guest interrupts there */
    17531773
    1754     case VMX_EXIT_INVD:                 /* 13 Guest software attempted to execute INVD. */
     1774    case VMX_EXIT_WBINVD:               /* 54 Guest software attempted to execute WBINVD. (conditional) */
     1775    case VMX_EXIT_INVD:                 /* 13 Guest software attempted to execute INVD. (unconditional) */
    17551776        STAM_COUNTER_INC(&pVM->hwaccm.s.StatExitInvd);
    17561777        /* Skip instruction and continue directly. */
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