VirtualBox

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


Ignore:
Timestamp:
May 2, 2013 10:58:28 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
85488
Message:

VMM/HMVMXR0: More checks on strict builds.

File:
1 edited

Legend:

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

    r45884 r45885  
    31443144/**
    31453145 * Strict function to validate segment registers.
     3146 *
     3147 * @remarks Requires CR0.
    31463148 */
    31473149static void hmR0VmxValidateSegmentRegs(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
     
    31843186        }
    31853187        Assert(pCtx->ss.Attr.n.u2Dpl == (pCtx->ss.Sel & X86_SEL_RPL));
    3186         /* CR0 might not be up-to-date here always, hence disabled. */
    3187 #if 0
     3188        Assert(!(pVCpu->hm.s.fContextUseFlags & HM_CHANGED_GUEST_CR0));
    31883189        if (!pCtx->cr0 & X86_CR0_PE)
    31893190            Assert(!pCtx->ss.Attr.n.u2Dpl);
    3190 #endif
    31913191        /* DS, ES, FS, GS - only check for usable selectors, see hmR0VmxWriteSegmentReg(). */
    31923192        if (pCtx->ds.Attr.u && pCtx->ds.Attr.u != HMVMX_SEL_UNUSABLE)
     
    33713371 *                      before using them.
    33723372 *
     3373 * @remarks Requires CR0 (strict builds validation).
    33733374 * @remarks No-long-jump zone!!!
    33743375 */
     
    63946395    }
    63956396
    6396     /** @todo if the order of loading is important, inform it via comments here */
     6397    /*
     6398     * Load the guest-state into the VMCS.
     6399     * Any ordering dependency among the sub-functions below must be explicitly stated using comments.
     6400     * Ideally, assert that the cross-dependent bits are up to date at the point of using it.
     6401     */
    63976402    int rc = hmR0VmxLoadGuestEntryCtls(pVCpu, pMixedCtx);
    63986403    AssertLogRelMsgRCReturn(rc, ("hmR0VmxLoadGuestEntryCtls! rc=%Rrc (pVM=%p pVCpu=%p)\n", rc, pVM, pVCpu), rc);
     
    64076412    AssertLogRelMsgRCReturn(rc, ("hmR0VmxLoadGuestControlRegs: rc=%Rrc (pVM=%p pVCpu=%p)\n", rc, pVM, pVCpu), rc);
    64086413
     6414    /* Must be done after CR0 is loaded (strict builds require CR0 for segment register validation checks). */
    64096415    rc = hmR0VmxLoadGuestSegmentRegs(pVCpu, pMixedCtx);
    64106416    AssertLogRelMsgRCReturn(rc, ("hmR0VmxLoadGuestSegmentRegs: rc=%Rrc (pVM=%p pVCpu=%p)\n", rc, pVM, pVCpu), rc);
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