VirtualBox

Changeset 70116 in vbox


Ignore:
Timestamp:
Dec 13, 2017 4:34:06 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
119665
Message:

VMM/HMSVMR0: Don't intercept SMIs while executing a guest and for nested-guest if an intercept occurs as a result of
the nested-guest intercepting them, just ignore instead of causing a nested-guest SMI #VMEXIT.

Also fix up typo while checking FERR_FREEZE intercept and removed a couple of stray debug log statements.

File:
1 edited

Legend:

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

    r70056 r70116  
    134134/**
    135135 * Mandatory/unconditional guest control intercepts.
     136 *
     137 * SMIs can and do happen in normal operation. We need not intercept them
     138 * while executing the guest or nested-guest.
    136139 */
    137140#define HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS           (  SVM_CTRL_INTERCEPT_INTR        \
    138141                                                         | SVM_CTRL_INTERCEPT_NMI         \
    139                                                          | SVM_CTRL_INTERCEPT_SMI         \
    140142                                                         | SVM_CTRL_INTERCEPT_INIT        \
    141143                                                         | SVM_CTRL_INTERCEPT_RDPMC       \
     
    159161                                                         | SVM_CTRL_INTERCEPT_MWAIT       \
    160162                                                         | SVM_CTRL_INTERCEPT_XSETBV)
    161 
    162 /**
    163  * Mandatory/unconditional nested-guest control intercepts.
    164  *
    165  * SMIs can and do happen in normal operation. We need to intercept them while
    166  * executing the nested-guest and make sure the host handles them.
    167  */
    168 #define HMSVM_MANDATORY_NESTED_GUEST_CTRL_INTERCEPTS    (  HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS \
    169                                                          | SVM_CTRL_INTERCEPT_SMI)
    170163
    171164/** @name VMCB Clean Bits.
     
    18851878        pVmcbNstGst->ctrl.u32InterceptXcpt  |= pVmcb->ctrl.u32InterceptXcpt;
    18861879        pVmcbNstGst->ctrl.u64InterceptCtrl  |= pVmcb->ctrl.u64InterceptCtrl
    1887                                             |  HMSVM_MANDATORY_NESTED_GUEST_CTRL_INTERCEPTS;
     1880                                            |  HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS;
    18881881
    18891882        /*
     
    18951888         * need to be intercepted (they are included in HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS).
    18961889         */
    1897         Assert(   (pVmcbNstGst->ctrl.u64InterceptCtrl & HMSVM_MANDATORY_NESTED_GUEST_CTRL_INTERCEPTS)
    1898                == HMSVM_MANDATORY_NESTED_GUEST_CTRL_INTERCEPTS);
     1890        Assert(   (pVmcbNstGst->ctrl.u64InterceptCtrl & HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS)
     1891               == HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS);
    18991892        pVmcbNstGst->ctrl.u64InterceptCtrl  &= ~SVM_CTRL_INTERCEPT_VMMCALL;
    19001893
     
    49734966        case SVM_EXIT_SMI:
    49744967        {
    4975             /* We shouldn't direct physical interrupts, NMIs, SMIs to the nested-guest. */
     4968            /*
     4969             * We shouldn't direct physical interrupts, NMIs, SMIs to the nested-guest.
     4970             *
     4971             * Although we don't intercept SMIs, the nested-guest might. Therefore, we
     4972             * might get an SMI #VMEXIT here so simply ignore rather than causing a
     4973             * corresponding nested-guest #VMEXIT.
     4974             */
    49764975            return hmR0SvmExitIntr(pVCpu, pCtx, pSvmTransient);
    49774976        }
     
    49794978        case SVM_EXIT_FERR_FREEZE:
    49804979        {
    4981             if (HMIsGuestSvmCtrlInterceptSet(pVCpu, pCtx, SVM_CTRL_INTERCEPT_VINTR))
     4980            if (HMIsGuestSvmCtrlInterceptSet(pVCpu, pCtx, SVM_CTRL_INTERCEPT_FERR_FREEZE))
    49824981                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    49834982            return hmR0SvmExitIntr(pVCpu, pCtx, pSvmTransient);
     
    51505149                }
    51515150
    5152                 case SVM_EXIT_INIT:
    5153                 case SVM_EXIT_NPF: /* We don't yet support nested-paging for nested-guests, so this should never happen. */
     5151                case SVM_EXIT_INIT:  /* We shouldn't get INIT signals while executing a nested-guest. */
     5152                case SVM_EXIT_NPF:   /* We don't yet support nested-paging for nested-guests, so this should never happen. */
    51545153                {
    51555154                    return hmR0SvmExitUnexpected(pVCpu, pCtx, pSvmTransient);
     
    59955994     * AMD Phenom 9850 Quad-Core on Windows 64-bit host).
    59965995     */
    5997     Log4(("hmR0SvmExitIntr: CS:RIP=%04x:%RX64 EFL=%#x CR0=%#RX32 CR3=%#RX32 CR4=%#RX32\n", pCtx->cs.Sel, pCtx->rip,
    5998           pCtx->eflags.u, pCtx->cr0, pCtx->cr3, pCtx->cr4));
    5999     Log4(("eax=%08x ebx=%08x ecx=%08x edx=%08x esi=%08x edi=%08x\n"
    6000           "eip=%08x esp=%08x ebp=%08x\n"
    6001           "cs=%04x ss=%04x ds=%04x es=%04x fs=%04x gs=%04x efl=%08x\n",
    6002           pCtx->eax, pCtx->ebx, pCtx->ecx, pCtx->edx, pCtx->esi, pCtx->edi,
    6003           pCtx->eip, pCtx->esp, pCtx->ebp,
    6004           pCtx->cs.Sel, pCtx->ss.Sel, pCtx->ds.Sel, pCtx->es.Sel, pCtx->fs.Sel, pCtx->gs.Sel, pCtx->eflags.u32));
    60055996    return VINF_EM_RAW_INTERRUPT;
    60065997}
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