VirtualBox

Changeset 79601 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jul 8, 2019 4:21:12 PM (6 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Nested VMX: bugref:9180 Move clearing of fInterceptEvents to after we have committed to executing the nested-guest. Added HMVMX_LOG_EXIT since removing auto-load/store MSR on VM-exit happens to log stuff prior to the previous place where we logged VM-exit.

File:
1 edited

Legend:

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

    r79578 r79601  
    153153                                                              ("fExtrn=%#RX64 fExtrnMbz=%#RX64\n", \
    154154                                                              (a_pVCpu)->cpum.GstCtx.fExtrn, (a_fExtrnMbz)))
     155
     156/** Log the VM-exit reason with an easily visible marker to identify it in a
     157 *  potential sea of logging data. */
     158#define HMVMX_LOG_EXIT(a_pVCpu, a_uExitReason) \
     159    do { \
     160        Log4(("VM-exit: vcpu[%RU32] reason=%#x -v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v\n", \
     161             (a_pVCpu)->idCpu, (a_uExitReason))); \
     162    } while (0) \
    155163
    156164
     
    53905398
    53915399        ASMAtomicUoAndU64(&pVCpu->hm.s.fCtxChanged, ~HM_CHANGED_GUEST_RFLAGS);
    5392         Log4Func(("EFlags=%#RX32\n", fEFlags.u32));
     5400        Log4Func(("eflags=%#RX32\n", fEFlags.u32));
    53935401    }
    53945402    return VINF_SUCCESS;
     
    94179425                pVCpu->hm.s.Event.fPending = false;
    94189426
     9427                /*
     9428                 * If we eventually support nested-guest execution without unrestricted guest execution,
     9429                 * we should clear fInterceptEvents here.
     9430                 */
     9431                Assert(!pVmxTransient->fIsNestedGuest);
     9432
    94199433                /* If we're stepping and we've changed cs:rip above, bail out of the VMX R0 execution loop. */
    94209434                if (fStepping)
     
    96389652        rcStrict = hmR0VmxInjectEventVmcs(pVCpu, pVmxTransient, &pVCpu->hm.s.Event, fStepping, &fIntrState);
    96399653        AssertRCReturn(VBOXSTRICTRC_VAL(rcStrict), rcStrict);
    9640 
    9641         /*
    9642          * If we are executing a nested-guest make sure that we should intercept subsequent
    9643          * events. The one we are injecting might be part of VM-entry.
    9644          */
    9645         if (pVmxTransient->fIsNestedGuest)
    9646             pVCpu->cpum.GstCtx.hwvirt.vmx.fInterceptEvents = true;
    96479654
    96489655        if (uIntType == VMX_ENTRY_INT_INFO_TYPE_EXT_INT)
     
    1125311260            pVCpu->hm.s.Event.fPending = false;
    1125411261
     11262#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
     11263            /*
     11264             * If we are executing a nested-guest make sure that we should intercept subsequent
     11265             * events. The one we are injecting might be part of VM-entry.
     11266             */
     11267            if (pVmxTransient->fIsNestedGuest)
     11268                pVCpu->cpum.GstCtx.hwvirt.vmx.fInterceptEvents = true;
     11269#endif
     11270
    1125511271            /*
    1125611272             * We've injected any pending events. This is really the point of no return (to ring-3).
     
    1150811524    pVmxTransient->uExitReason    = VMX_EXIT_REASON_BASIC(uExitReason);
    1150911525    pVmxTransient->fVMEntryFailed = VMX_EXIT_REASON_HAS_ENTRY_FAILED(uExitReason);
     11526
     11527    /*
     11528     * Log the VM-exit before logging anything else as otherwise it might be a
     11529     * tad confusing what happens before and after the world-switch.
     11530     */
     11531    HMVMX_LOG_EXIT(pVCpu, uExitReason);
    1151011532
    1151111533    /*
     
    1352313545        HMVMX_ASSERT_PREEMPT_SAFE(a_pVCpu); \
    1352413546        HMVMX_ASSERT_PREEMPT_CPUID_VAR(); \
    13525         Log4Func(("vcpu[%RU32] -v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v-v\n", (a_pVCpu)->idCpu)); \
     13547        Log4Func(("vcpu[%RU32]\n", (a_pVCpu)->idCpu)); \
    1352613548        HMVMX_ASSERT_PREEMPT_SAFE(a_pVCpu); \
    1352713549        if (VMMR0IsLogFlushDisabled((a_pVCpu))) \
     
    1633816360    if (RT_LIKELY(rcStrict1 == VINF_SUCCESS))
    1633916361    {
    16340         /* If event delivery causes an EPT misconfig (MMIO), go back to instruction emulation as otherwise
    16341            injecting the original pending event would most likely cause the same EPT misconfig VM-exit. */
     16362        /*
     16363         * If event delivery causes an EPT misconfig (MMIO), go back to instruction emulation. Otherwise,
     16364         * injecting the original event would most likely cause the same EPT misconfig VM-exit again.
     16365         */
    1634216366        if (RT_UNLIKELY(pVCpu->hm.s.Event.fPending))
    1634316367        {
     
    1721017234                || iCrReg == 8)
    1721117235            {
    17212                 static const uint32_t s_aCrXReadIntercepts[] = { 0, 0, 0, VMX_PROC_CTLS_CR3_STORE_EXIT, 0,
    17213                                                                  0, 0, 0, VMX_PROC_CTLS_CR8_STORE_EXIT };
    17214                 uint32_t const uIntercept = s_aCrXReadIntercepts[iCrReg];
     17236                static const uint32_t s_auCrXReadIntercepts[] = { 0, 0, 0, VMX_PROC_CTLS_CR3_STORE_EXIT, 0,
     17237                                                                  0, 0, 0, VMX_PROC_CTLS_CR8_STORE_EXIT };
     17238                uint32_t const uIntercept = s_auCrXReadIntercepts[iCrReg];
    1721517239                if (CPUMIsGuestVmxProcCtlsSet(pVCpu, &pVCpu->cpum.GstCtx, uIntercept))
    1721617240                {
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