VirtualBox

Changeset 90593 in vbox


Ignore:
Timestamp:
Aug 10, 2021 10:37:27 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146204
Message:

VMM/HMVMXR0: Fix guru meditation while reading debug registers by the nested-guest.

File:
1 edited

Legend:

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

    r90379 r90593  
    60806080        AssertRC(rc);
    60816081
    6082         /* Always intercept Mov DRx accesses for the nested-guest for now. */
    6083         pVmcsInfo->u32ProcCtls |= VMX_PROC_CTLS_MOV_DR_EXIT;
    6084         rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVmcsInfo->u32ProcCtls);
    6085         AssertRC(rc);
     6082        /*
     6083         * We don't want to always intercept MOV DRx for nested-guests as it causes
     6084         * problems when the nested hypervisor isn't intercepting them, see @bugref{10080}.
     6085         * Instead, they are strictly only requested when the nested hypervisor intercepts
     6086         * them -- handled while merging VMCS controls.
     6087         *
     6088         * If neither the outer nor the nested-hypervisor is intercepting MOV DRx,
     6089         * then the guest debug state should be actively loaded on the host so that
     6090         * nested-guest reads its own debug registers without causing VM-exits.
     6091         */
     6092        if (   !(pVmcsInfo->u32ProcCtls & VMX_PROC_CTLS_MOV_DR_EXIT)
     6093            && !CPUMIsGuestDebugStateActive(pVCpu))
     6094            CPUMR0LoadGuestDebugState(pVCpu, true /* include DR6 */);
    60866095        return VINF_SUCCESS;
    60876096    }
     
    1045210461                               | (pVmcsInfoGst->u32ProcCtls & ~(  VMX_PROC_CTLS_INT_WINDOW_EXIT
    1045310462                                                                | VMX_PROC_CTLS_NMI_WINDOW_EXIT
     10463                                                                | VMX_PROC_CTLS_MOV_DR_EXIT
    1045410464                                                                | VMX_PROC_CTLS_USE_TPR_SHADOW
    1045510465                                                                | VMX_PROC_CTLS_MONITOR_TRAP_FLAG));
     
    1082010830     * guest to cause a VM-exit the next time they are ready to receive the event.
    1082110831     *
    10822      * With nested-guests, evaluating pending events may cause VM-exits. Also, verify
    10823      * that the event in TRPM that we will inject using hardware-assisted VMX is -not-
    10824      * subject to interecption. Otherwise, we should have checked and injected them
    10825      * manually elsewhere (IEM).
     10832     * For nested-guests, verify that the TRPM event that we're about to inject using
     10833     * hardware-assisted VMX is -not- subject to nested-hypervisor interception.
     10834     * Otherwise, we should have checked and injected them manually elsewhere (IEM).
    1082610835     */
    1082710836    if (TRPMHasTrap(pVCpu))
     
    1130311312
    1130411313            Assert(VMMRZCallRing3IsEnabled(pVCpu));
     11314            Assert(   pVmxTransient->fWasGuestDebugStateActive == false
     11315                   || pVmxTransient->fWasHyperDebugStateActive == false);
    1130511316            return;
    1130611317        }
     
    1613516146    PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo;
    1613616147
    16137     /* We might get this VM-exit if the nested-guest is not intercepting MOV DRx accesses. */
     16148    /*
     16149     * We might also get this VM-exit if the nested-guest isn't intercepting MOV DRx accesses.
     16150     * In such a case, rather than disabling MOV DRx intercepts and resuming execution, we
     16151     * must emulate the MOV DRx access.
     16152     */
    1613816153    if (!pVmxTransient->fIsNestedGuest)
    1613916154    {
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