VirtualBox

Changeset 76639 in vbox for trunk


Ignore:
Timestamp:
Jan 4, 2019 6:47:28 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
127943
Message:

VMM/IEM: Nested VMX: bugref:9180 vmptrld fixes.

File:
1 edited

Legend:

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

    r76632 r76639  
    78987898     */
    78997899    uint8_t const fVmcsStateClear = VMX_V_VMCS_STATE_CLEAR;
    7900     if (IEM_VMX_GET_CURRENT_VMCS(pVCpu) == GCPhysVmcs)
     7900    if (   IEM_VMX_HAS_CURRENT_VMCS(pVCpu)
     7901        && IEM_VMX_GET_CURRENT_VMCS(pVCpu) == GCPhysVmcs)
    79017902    {
    79027903        Assert(GCPhysVmcs != NIL_RTGCPHYS);                     /* Paranoia. */
     
    80588059    }
    80598060
    8060     /* Read the VMCS revision ID from the VMCS. */
     8061    /* Read just the VMCS revision from the VMCS. */
    80618062    VMXVMCSREVID VmcsRevId;
    80628063    int rc = PGMPhysSimpleReadGCPhys(pVCpu->CTX_SUFF(pVM), &VmcsRevId, GCPhysVmcs, sizeof(VmcsRevId));
    80638064    if (RT_FAILURE(rc))
    80648065    {
    8065         Log(("vmptrld: Failed to read VMCS at %#RGp, rc=%Rrc\n", GCPhysVmcs, rc));
    8066         pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Vmptrld_PtrReadPhys;
     8066        Log(("vmptrld: Failed to read revision identifier from VMCS at %#RGp, rc=%Rrc\n", GCPhysVmcs, rc));
     8067        pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Vmptrld_RevPtrReadPhys;
    80678068        return rc;
    80688069    }
    80698070
    8070     /* Verify the VMCS revision specified by the guest matches what we reported to the guest,
    8071        also check VMCS shadowing feature. */
     8071    /*
     8072     * Verify the VMCS revision specified by the guest matches what we reported to the guest.
     8073     * Verify the VMCS is not a shadow VMCS, if the VMCS shadowing feature is supported.
     8074     */
    80728075    if (   VmcsRevId.n.u31RevisionId != VMX_V_VMCS_REVISION_ID
    80738076        || (   VmcsRevId.n.fIsShadowVmcs
     
    80768079        if (VmcsRevId.n.u31RevisionId != VMX_V_VMCS_REVISION_ID)
    80778080        {
    8078             Log(("vmptrld: VMCS revision mismatch, expected %#RX32 got %#RX32. GCPhysVmcs=%#RX64 -> VMFail()\n",
    8079                  VMX_V_VMCS_REVISION_ID, VmcsRevId.n.u31RevisionId, GCPhysVmcs));
     8081            Log(("vmptrld: VMCS revision mismatch, expected %#RX32 got %#RX32, GCPtrVmcs=%#RGv GCPhysVmcs=%#RGp -> VMFail()\n",
     8082                 VMX_V_VMCS_REVISION_ID, VmcsRevId.n.u31RevisionId, GCPtrVmcs, GCPhysVmcs));
    80808083            pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Vmptrld_VmcsRevId;
    80818084            iemVmxVmFail(pVCpu, VMXINSTRERR_VMPTRLD_INCORRECT_VMCS_REV);
     
    80988101    if (   IEM_VMX_HAS_CURRENT_VMCS(pVCpu)
    80998102        && IEM_VMX_GET_CURRENT_VMCS(pVCpu) != GCPhysVmcs)
     8103    {
    81008104        iemVmxCommitCurrentVmcsToMemory(pVCpu);
     8105        Assert(!IEM_VMX_HAS_CURRENT_VMCS(pVCpu));
     8106    }
     8107
     8108    /* Finally, cache the new VMCS from guest memory and mark it as the current VMCS. */
     8109    rc = PGMPhysSimpleReadGCPhys(pVCpu->CTX_SUFF(pVM), (void *)pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs), GCPhysVmcs,
     8110                                     sizeof(VMXVVMCS));
     8111    if (RT_FAILURE(rc))
     8112    {
     8113        Log(("vmptrld: Failed to read VMCS at %#RGp, rc=%Rrc\n", GCPhysVmcs, rc));
     8114        pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Vmptrld_PtrReadPhys;
     8115        return rc;
     8116    }
    81018117
    81028118    IEM_VMX_SET_CURRENT_VMCS(pVCpu, GCPhysVmcs);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette