VirtualBox

Changeset 78526 in vbox


Ignore:
Timestamp:
May 15, 2019 4:58:06 AM (6 years ago)
Author:
vboxsync
Message:

VMM/CPUM: Nested VMX: bugref:9180 invvpid support (disabled, not yet enabled exposing to guest).

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp

    r76993 r78526  
    14281428{
    14291429    RT_NOREF_PV(pVCpu); RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange);
    1430     *puValue = 0;
     1430    *puValue = pVCpu->cpum.s.Guest.hwvirt.vmx.Msrs.u64EptVpidCaps;
    14311431    return VINF_SUCCESS;
    14321432}
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r78220 r78526  
    15251525     *   - True VM-entry VM-execution controls.
    15261526     *   - True VM-exit VM-execution controls.
    1527      *   - EPT/VPID capabilities.
    15281527     */
    15291528
     
    16901689    /* VMCS Enumeration. */
    16911690    pGuestVmxMsrs->u64VmcsEnum = VMX_V_VMCS_MAX_INDEX << VMX_BF_VMCS_ENUM_HIGHEST_IDX_SHIFT;
     1691
     1692    /* VPID and EPT Capabilities. */
     1693    {
     1694        /*
     1695         * INVVPID instruction always causes a VM-exit unconditionally, so we are free to fake
     1696         * and emulate any INVVPID flush type. However, it only makes sense to expose the types
     1697         * when INVVPID instruction is supported just to be more compatible with guest
     1698         * hypervisors that may make assumptions by only looking at this MSR even though they
     1699         * are technically supposed to refer to bit 37 of MSR_IA32_VMX_PROC_CTLS2 first.
     1700         *
     1701         * See Intel spec. 25.1.2 "Instructions That Cause VM Exits Unconditionally".
     1702         * See Intel spec. 30.3 "VMX Instructions".
     1703         */
     1704        uint8_t const fVpid = pGuestFeatures->fVmxVpid;
     1705        pGuestVmxMsrs->u64EptVpidCaps = RT_BF_MAKE(VMX_BF_EPT_VPID_CAP_INVVPID,                           fVpid)
     1706                                      | RT_BF_MAKE(VMX_BF_EPT_VPID_CAP_INVVPID_SINGLE_CTX,                fVpid & 1)
     1707                                      | RT_BF_MAKE(VMX_BF_EPT_VPID_CAP_INVVPID_ALL_CTX,                   fVpid & 1)
     1708                                      | RT_BF_MAKE(VMX_BF_EPT_VPID_CAP_INVVPID_SINGLE_CTX_RETAIN_GLOBALS, fVpid & 1);
     1709    }
    16921710
    16931711    /* VM Functions. */
     
    18451863    EmuFeat.fVmxRdtscp                = 1;
    18461864    EmuFeat.fVmxVirtX2ApicMode        = 0;
    1847     EmuFeat.fVmxVpid                  = 0;
     1865    EmuFeat.fVmxVpid                  = 0;  /** @todo NSTVMX: enable this. */
    18481866    EmuFeat.fVmxWbinvdExit            = 1;
    18491867    EmuFeat.fVmxUnrestrictedGuest     = 0;
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