VirtualBox

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


Ignore:
Timestamp:
Dec 8, 2017 10:04:49 AM (7 years ago)
Author:
vboxsync
Message:

VMM/HMSVMR0: Intercept SMIs for nested-guests and don't intercept them for guests.

File:
1 edited

Legend:

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

    r70005 r70006  
    133133
    134134/**
    135  *  Mandatory/unconditional guest control intercepts.
     135 * Mandatory/unconditional guest control intercepts.
    136136 */
    137137#define HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS           (  SVM_CTRL_INTERCEPT_INTR        \
     
    159159                                                         | SVM_CTRL_INTERCEPT_MWAIT       \
    160160                                                         | 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)
    161170
    162171/** @name VMCB Clean Bits.
     
    18761885        pVmcbNstGst->ctrl.u32InterceptXcpt  |= pVmcb->ctrl.u32InterceptXcpt;
    18771886        pVmcbNstGst->ctrl.u64InterceptCtrl  |= pVmcb->ctrl.u64InterceptCtrl
    1878                                             |  HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS;
     1887                                            |  HMSVM_MANDATORY_NESTED_GUEST_CTRL_INTERCEPTS;
    18791888
    18801889        /*
     
    18861895         * need to be intercepted (they are included in HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS).
    18871896         */
    1888         Assert(   (pVmcbNstGst->ctrl.u64InterceptCtrl & HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS)
    1889                == HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS);
     1897        Assert(   (pVmcbNstGst->ctrl.u64InterceptCtrl & HMSVM_MANDATORY_NESTED_GUEST_CTRL_INTERCEPTS)
     1898               == HMSVM_MANDATORY_NESTED_GUEST_CTRL_INTERCEPTS);
    18901899        pVmcbNstGst->ctrl.u64InterceptCtrl  &= ~SVM_CTRL_INTERCEPT_VMMCALL;
    18911900
     
    48934902        case SVM_EXIT_INTR:
    48944903        case SVM_EXIT_NMI:
    4895         {
    4896             /* We shouldn't direct physical interrupts, NMIs to the nested-guest. */
     4904        case SVM_EXIT_SMI:
     4905        {
     4906            /* We shouldn't direct physical interrupts, NMIs, SMIs to the nested-guest. */
    48974907            return hmR0SvmExitIntr(pVCpu, pCtx, pSvmTransient);
    48984908        }
     
    50715081                }
    50725082
    5073                 case SVM_EXIT_SMI:
    50745083                case SVM_EXIT_INIT:
    50755084                case SVM_EXIT_NPF: /* We don't yet support nested-paging for nested-guests, so this should never happen. */
     
    52315240                {
    52325241                    /*
    5233                      * INIT signals, SMI shouldn't ever happen here.
     5242                     * We don't intercept SMIs. As for INIT signals, it really shouldn't ever happen here.
    52345243                     * If it ever does, we want to know about it so log the exit code and bail.
    52355244                     */
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