VirtualBox

Changeset 74566 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Oct 2, 2018 6:01:50 AM (6 years ago)
Author:
vboxsync
Message:

VMM/IEM: Nested VMX: bugref:9180 VM-exit bits; Add INVPCID intercept.

File:
1 edited

Legend:

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

    r74563 r74566  
    59855985    if (!IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fInvpcid)
    59865986        return iemRaiseUndefinedOpcode(pVCpu);
     5987
     5988    /* When in VMX non-root mode and INVPCID is not enabled, it results in #UD. */
     5989    if (    IEM_VMX_IS_NON_ROOT_MODE(pVCpu)
     5990        && !IEM_VMX_IS_PROCCTLS2_SET(pVCpu, VMX_PROC_CTLS2_INVPCID))
     5991    {
     5992        Log(("invpcid: Not enabled for nested-guest execution -> #UD\n"));
     5993        return iemRaiseUndefinedOpcode(pVCpu);
     5994    }
     5995
    59875996    if (pVCpu->iem.s.uCpl != 0)
    59885997    {
     
    59905999        return iemRaiseGeneralProtectionFault0(pVCpu);
    59916000    }
     6001
    59926002    if (IEM_IS_V86_MODE(pVCpu))
    59936003    {
     
    59956005        return iemRaiseGeneralProtectionFault0(pVCpu);
    59966006    }
     6007
     6008    /*
     6009     * Check nested-guest intercept.
     6010     *
     6011     * INVPCID causes a VM-exit if "enable INVPCID" and "INVLPG exiting" are
     6012     * both set. We have already checked the former earlier in this function.
     6013     *
     6014     * CPL checks take priority over VM-exit.
     6015     * See Intel spec. "25.1.1 Relative Priority of Faults and VM Exits".
     6016     */
     6017    /** @todo r=ramshankar: NSTVMX: I'm not entirely certain if V86 mode check has
     6018     *        higher or lower priority than a VM-exit, we assume higher for the time
     6019     *        being. */
     6020    if (IEM_VMX_IS_PROCCTLS_SET(pVCpu, VMX_PROC_CTLS_INVLPG_EXIT))
     6021    {
     6022        Log(("invpcid: Guest intercept -> #VM-exit\n"));
     6023        IEM_VMX_VMEXIT_INSTR_NEEDS_INFO_RET(pVCpu, VMX_EXIT_INVPCID, VMXINSTRID_NONE, cbInstr);
     6024    }
     6025
    59976026    if (uInvpcidType > X86_INVPCID_TYPE_MAX_VALID)
    59986027    {
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