VirtualBox

Changeset 71108 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Feb 22, 2018 3:38:35 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
120973
Message:

Added speculation control settings to API, refined implementation.

File:
1 edited

Legend:

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

    r70612 r71108  
    24912491        }
    24922492#endif
     2493        /*
     2494         * The IA32_PRED_CMD MSR is write-only and has no state associated with it. We never need to intercept
     2495         * access (writes need to be executed without exiting, reds will #GP-fault anyway).
     2496         */
     2497        if (pVM->cpum.ro.GuestFeatures.fIbpb)
     2498            hmR0VmxSetMsrPermission(pVCpu, MSR_IA32_PRED_CMD,     VMXMSREXIT_PASSTHRU_READ, VMXMSREXIT_PASSTHRU_WRITE);
     2499
    24932500        /* Though MSR_IA32_PERF_GLOBAL_CTRL is saved/restored lazily, we want intercept reads/write to it for now. */
    24942501    }
     
    66306637            case MSR_K8_SF_MASK:        pMixedCtx->msrSFMASK       = pMsr->u64Value;             break;
    66316638            case MSR_K8_KERNEL_GS_BASE: pMixedCtx->msrKERNELGSBASE = pMsr->u64Value;             break;
     6639            case MSR_IA32_SPEC_CTRL:    CPUMR0SetGuestSpecCtrl(pVCpu, pMsr->u64Value);           break;
    66326640            case MSR_K6_EFER: /* Nothing to do here since we intercept writes, see hmR0VmxLoadGuestMsrs(). */
    66336641                break;
     
    91729180            Assert(!pVCpu->hm.s.vmx.cMsrs || pVCpu->hm.s.vmx.fUpdatedHostMsrs);
    91739181        }
     9182    }
     9183
     9184    if (pVM->cpum.ro.GuestFeatures.fIbrs)
     9185    {
     9186        bool fMsrUpdated;
     9187        int rc2 = hmR0VmxSaveGuestAutoLoadStoreMsrs(pVCpu, pMixedCtx);
     9188        AssertRC(rc2);
     9189        Assert(HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_AUTO_LOAD_STORE_MSRS));
     9190
     9191        rc2 = hmR0VmxAddAutoLoadStoreMsr(pVCpu, MSR_IA32_SPEC_CTRL, CPUMR0GetGuestSpecCtrl(pVCpu), true /* fUpdateHostMsr */,
     9192                                         &fMsrUpdated);
     9193        AssertRC(rc2);
     9194        Assert(fMsrUpdated || pVCpu->hm.s.vmx.fUpdatedHostMsrs);
     9195        /* Finally, mark that all host MSR values are updated so we don't redo it without leaving VT-x. See @bugref{6956}. */
     9196        pVCpu->hm.s.vmx.fUpdatedHostMsrs = true;
    91749197    }
    91759198
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