VirtualBox

Changeset 12756 in vbox


Ignore:
Timestamp:
Sep 26, 2008 8:25:57 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
37082
Message:

Attempt to correct hidden selector attributes when switching from real to protected mode. (VT-x weirdness again)

Location:
trunk/src/VBox/VMM/VMMR0
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.h

    r12702 r12756  
    109109 * Runs guest code in an AMD-V VM.
    110110 *
    111  * @note NEVER EVER turn on interrupts here. Due to our illegal entry into the
    112  *       kernel, it might mess things up. (XP kernel traps have been frequently
    113  *       observed.) [obsolete?]
    114  *
    115111 * @returns VBox status code.
    116112 * @param   pVM         The VM to operate on.
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r12751 r12756  
    188188    }
    189189
     190    /* Current guest paging mode. */
     191    pVM->hwaccm.s.vmx.enmCurrGuestMode = PGMMODE_REAL;
     192
    190193#ifdef LOG_ENABLED
    191194    SUPR0Printf("VMXR0InitVM %x VMCS=%x (%x)\n", pVM, pVM->hwaccm.s.vmx.pVMCS, (uint32_t)pVM->hwaccm.s.vmx.pVMCSPhys);
     
    733736    if (pVM->hwaccm.s.fContextUseFlags & HWACCM_CHANGED_GUEST_SEGMENT_REGS)
    734737    {
     738        PGMMODE enmGuestMode = PGMGetGuestMode(pVM);
     739        if (pVM->hwaccm.s.vmx.enmCurrGuestMode != enmGuestMode)
     740        {
     741            if (    pVM->hwaccm.s.vmx.enmCurrGuestMode == PGMMODE_REAL
     742                &&  enmGuestMode == PGMMODE_PROTECTED)
     743            {
     744                pCtx->csHid.Attr.n.u2Dpl = 0;
     745                pCtx->dsHid.Attr.n.u2Dpl = 0;
     746                pCtx->esHid.Attr.n.u2Dpl = 0;
     747                pCtx->fsHid.Attr.n.u2Dpl = 0;
     748                pCtx->gsHid.Attr.n.u2Dpl = 0;
     749                pCtx->ssHid.Attr.n.u2Dpl = 0;
     750            }
     751            pVM->hwaccm.s.vmx.enmCurrGuestMode = enmGuestMode;
     752        }
     753
    735754        /* VT-x will fail with a guest invalid state otherwise... */
    736755        if (   CPUMIsGuestInRealModeEx(pCtx)
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.h

    r12730 r12756  
    127127/**
    128128 * Runs guest code in a VT-x VM.
    129  *
    130  * @note NEVER EVER turn on interrupts here. Due to our illegal entry into the
    131  *       kernel, it might mess things up. (XP kernel traps have been frequently
    132  *       observed) [obsolete?]
    133129 *
    134130 * @returns VBox status code.
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