Changeset 79765 in vbox for trunk/src/VBox
- Timestamp:
- Jul 14, 2019 3:53:31 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r79764 r79765 8341 8341 VMXLOCAL_BREAK_RC(rc); 8342 8342 } 8343 8344 # if 08345 /** @todo NSTVMX: We handle most of these fields individually by passing it to IEM8346 * VM-exit handlers as parameters. We would handle it differently when using8347 * the fast path. */8348 /*8349 * The hardware virtualization state currently consists of VMCS fields that may be8350 * modified by execution of the nested-guest (that are not part of the general8351 * guest state) and is visible to guest software. Hence, it is technically part of8352 * the guest-CPU state when executing a nested-guest.8353 */8354 if (CPUMIsGuestInVmxNonRootMode(pCtx))8355 {8356 PVMXVVMCS pGstVmcs = pCtx->hwvirt.vmx.CTX_SUFF(pVmcs);8357 rc = VMXReadVmcs32(VMX_VMCS32_RO_EXIT_REASON, &pGstVmcs->u32RoExitReason);8358 rc |= VMXReadVmcsGstN(VMX_VMCS_RO_EXIT_QUALIFICATION, &pGstVmcs->u64RoExitQual.u);8359 VMXLOCAL_BREAK_RC(rc);8360 8361 /*8362 * VM-entry can fail due to invalid-guest state, machine-check events and8363 * MSR loading failures. Other than VM-exit reason and Exit qualification8364 * all other VMCS fields are left unmodified on VM-entry failure.8365 *8366 * See Intel spec. 26.7 "VM-entry Failures During Or After Loading Guest State".8367 */8368 bool const fEntryFailed = VMX_EXIT_REASON_HAS_ENTRY_FAILED(pGstVmcs->u32RoExitReason);8369 if (!fEntryFailed)8370 {8371 /*8372 * Some notes on VMCS fields that may need importing when the fast path8373 * is implemented. Currently we fully emulate VMLAUNCH/VMRESUME in IEM.8374 *8375 * Requires fixing up when using hardware-assisted VMX:8376 * - VM-exit interruption info: Shouldn't reflect host interrupts/NMIs.8377 * - VM-exit interruption error code: Cleared to 0 when not appropriate.8378 * - IDT-vectoring info: Think about this.8379 * - IDT-vectoring error code: Think about this.8380 *8381 * Emulated:8382 * - Guest-interruptiblity state: Derived from FFs and RIP.8383 * - Guest pending debug exceptions: Derived from DR6.8384 * - Guest activity state: Emulated from EM state.8385 * - Guest PDPTEs: Currently all 0s since we don't support nested EPT.8386 * - Entry-interrupt info: Emulated, cleared to 0.8387 */8388 rc |= VMXReadVmcs32(VMX_VMCS32_RO_EXIT_INTERRUPTION_INFO, &pGstVmcs->u32RoExitIntInfo);8389 rc |= VMXReadVmcs32(VMX_VMCS32_RO_EXIT_INTERRUPTION_ERROR_CODE, &pGstVmcs->u32RoExitIntErrCode);8390 rc |= VMXReadVmcs32(VMX_VMCS32_RO_IDT_VECTORING_INFO, &pGstVmcs->u32RoIdtVectoringInfo);8391 rc |= VMXReadVmcs32(VMX_VMCS32_RO_IDT_VECTORING_ERROR_CODE, &pGstVmcs->u32RoIdtVectoringErrCode);8392 rc |= VMXReadVmcs32(VMX_VMCS32_RO_EXIT_INSTR_LENGTH, &pGstVmcs->u32RoExitInstrLen);8393 rc |= VMXReadVmcs32(VMX_VMCS32_RO_EXIT_INSTR_INFO, &pGstVmcs->u32RoExitIntInfo);8394 rc |= VMXReadVmcs64(VMX_VMCS64_RO_GUEST_PHYS_ADDR_FULL, &pGstVmcs->u64RoGuestPhysAddr.u);8395 rc |= VMXReadVmcsGstN(VMX_VMCS_RO_GUEST_LINEAR_ADDR, &pGstVmcs->u64RoGuestLinearAddr.u);8396 /** @todo NSTVMX: Save and adjust preemption timer value. */8397 }8398 8399 VMXLOCAL_BREAK_RC(rc);8400 }8401 # endif8402 8343 } 8403 8344 #endif … … 13679 13620 * See Intel spec. 27.1 "Architectural State Before A VM Exit". 13680 13621 */ 13681 int rc = hmR0VmxReadIdtVectoringInfoVmcs(pVmxTransient);13682 AssertRCReturn(rc, rc);13683 13684 13622 uint32_t const uIdtVectorInfo = pVmxTransient->uIdtVectoringInfo; 13685 13623 if (VMX_IDT_VECTORING_INFO_IS_VALID(uIdtVectorInfo)) … … 13692 13630 */ 13693 13631 { 13694 rc = hmR0VmxReadExitIntInfoVmcs(pVmxTransient);13695 AssertRCReturn(rc, rc);13696 13697 13632 uint32_t const uExitIntInfo = pVmxTransient->uExitIntInfo; 13698 13633 if (VMX_EXIT_INT_INFO_IS_VALID(uExitIntInfo)) … … 13719 13654 * Things look legit, continue... 13720 13655 */ 13721 uint32_t u32ErrCode; 13722 bool const fErrCodeValid = VMX_IDT_VECTORING_INFO_IS_ERROR_CODE_VALID(uIdtVectorInfo); 13723 if (fErrCodeValid) 13724 { 13725 rc = hmR0VmxReadIdtVectoringErrorCodeVmcs(pVmxTransient); 13726 AssertRCReturn(rc, rc); 13656 uint32_t u32ErrCode; 13657 if (VMX_IDT_VECTORING_INFO_IS_ERROR_CODE_VALID(uIdtVectorInfo)) 13727 13658 u32ErrCode = pVmxTransient->uIdtVectoringErrorCode; 13728 }13729 13659 else 13730 13660 u32ErrCode = 0; … … 13734 13664 || uIdtVectorType == VMX_IDT_VECTORING_INFO_TYPE_PRIV_SW_XCPT 13735 13665 || uIdtVectorType == VMX_IDT_VECTORING_INFO_TYPE_SW_XCPT) 13736 {13737 rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);13738 AssertRCReturn(rc, rc);13739 13666 cbInstr = pVmxTransient->cbInstr; 13740 }13741 13667 else 13742 13668 cbInstr = 0;
Note:
See TracChangeset
for help on using the changeset viewer.