VirtualBox

Changeset 79765 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 14, 2019 3:53:31 PM (5 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Nested VMX: bugref:9180 Skip reading fields we've already read (and asserted) in hmR0VmxCheckExitDueToEventDeliveryNested. Removed code not relevant for now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r79764 r79765  
    83418341                    VMXLOCAL_BREAK_RC(rc);
    83428342                }
    8343 
    8344 # if 0
    8345                 /** @todo NSTVMX: We handle most of these fields individually by passing it to IEM
    8346                  *        VM-exit handlers as parameters. We would handle it differently when using
    8347                  *        the fast path. */
    8348                 /*
    8349                  * The hardware virtualization state currently consists of VMCS fields that may be
    8350                  * modified by execution of the nested-guest (that are not part of the general
    8351                  * guest state) and is visible to guest software. Hence, it is technically part of
    8352                  * 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 and
    8363                      * MSR loading failures. Other than VM-exit reason and Exit qualification
    8364                      * 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 path
    8373                          * 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 # endif
    84028343            }
    84038344#endif
     
    1367913620     * See Intel spec. 27.1 "Architectural State Before A VM Exit".
    1368013621     */
    13681     int rc = hmR0VmxReadIdtVectoringInfoVmcs(pVmxTransient);
    13682     AssertRCReturn(rc, rc);
    13683 
    1368413622    uint32_t const uIdtVectorInfo = pVmxTransient->uIdtVectoringInfo;
    1368513623    if (VMX_IDT_VECTORING_INFO_IS_VALID(uIdtVectorInfo))
     
    1369213630         */
    1369313631        {
    13694             rc = hmR0VmxReadExitIntInfoVmcs(pVmxTransient);
    13695             AssertRCReturn(rc, rc);
    13696 
    1369713632            uint32_t const uExitIntInfo = pVmxTransient->uExitIntInfo;
    1369813633            if (VMX_EXIT_INT_INFO_IS_VALID(uExitIntInfo))
     
    1371913654         * Things look legit, continue...
    1372013655         */
    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))
    1372713658            u32ErrCode = pVmxTransient->uIdtVectoringErrorCode;
    13728         }
    1372913659        else
    1373013660            u32ErrCode = 0;
     
    1373413664            || uIdtVectorType == VMX_IDT_VECTORING_INFO_TYPE_PRIV_SW_XCPT
    1373513665            || uIdtVectorType == VMX_IDT_VECTORING_INFO_TYPE_SW_XCPT)
    13736         {
    13737             rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    13738             AssertRCReturn(rc, rc);
    1373913666            cbInstr = pVmxTransient->cbInstr;
    13740         }
    1374113667        else
    1374213668            cbInstr = 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