- Timestamp:
- Jan 4, 2019 6:47:28 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 127943
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r76632 r76639 7898 7898 */ 7899 7899 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) 7901 7902 { 7902 7903 Assert(GCPhysVmcs != NIL_RTGCPHYS); /* Paranoia. */ … … 8058 8059 } 8059 8060 8060 /* Read the VMCS revision IDfrom the VMCS. */8061 /* Read just the VMCS revision from the VMCS. */ 8061 8062 VMXVMCSREVID VmcsRevId; 8062 8063 int rc = PGMPhysSimpleReadGCPhys(pVCpu->CTX_SUFF(pVM), &VmcsRevId, GCPhysVmcs, sizeof(VmcsRevId)); 8063 8064 if (RT_FAILURE(rc)) 8064 8065 { 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; 8067 8068 return rc; 8068 8069 } 8069 8070 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 */ 8072 8075 if ( VmcsRevId.n.u31RevisionId != VMX_V_VMCS_REVISION_ID 8073 8076 || ( VmcsRevId.n.fIsShadowVmcs … … 8076 8079 if (VmcsRevId.n.u31RevisionId != VMX_V_VMCS_REVISION_ID) 8077 8080 { 8078 Log(("vmptrld: VMCS revision mismatch, expected %#RX32 got %#RX32 . GCPhysVmcs=%#RX64-> VMFail()\n",8079 VMX_V_VMCS_REVISION_ID, VmcsRevId.n.u31RevisionId, GCP hysVmcs));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)); 8080 8083 pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Vmptrld_VmcsRevId; 8081 8084 iemVmxVmFail(pVCpu, VMXINSTRERR_VMPTRLD_INCORRECT_VMCS_REV); … … 8098 8101 if ( IEM_VMX_HAS_CURRENT_VMCS(pVCpu) 8099 8102 && IEM_VMX_GET_CURRENT_VMCS(pVCpu) != GCPhysVmcs) 8103 { 8100 8104 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 } 8101 8117 8102 8118 IEM_VMX_SET_CURRENT_VMCS(pVCpu, GCPhysVmcs);
Note:
See TracChangeset
for help on using the changeset viewer.