VirtualBox

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


Ignore:
Timestamp:
Apr 26, 2013 3:22:07 PM (12 years ago)
Author:
vboxsync
Message:

VMM/HM: Simplified real/protected mode transition tracking logic.

File:
1 edited

Legend:

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

    r45774 r45781  
    19101910    }
    19111911
    1912     for (VMCPUID i = 0; i < pVM->cCpus; i++)
    1913     {
    1914         PVMCPU pVCpu = &pVM->aCpus[i];
    1915 
    1916         /* Current guest paging mode. */
    1917         pVCpu->hm.s.vmx.enmLastSeenGuestMode = PGMMODE_REAL;
    1918     }
    1919 
    19201912    return VINF_SUCCESS;
    19211913}
     
    33953387        {
    33963388            Assert(pVM->hm.s.vmx.pRealModeTSS);
    3397             PGMMODE enmGuestMode = PGMGetGuestMode(pVCpu);
    3398             if (pVCpu->hm.s.vmx.enmLastSeenGuestMode != enmGuestMode)
     3389            if (   pVCpu->hm.s.vmx.fWasInRealMode
     3390                && PGMGetGuestMode(pVCpu) >= PGMMODE_PROTECTED)
    33993391            {
    3400                 AssertCompile(PGMMODE_REAL < PGMMODE_PROTECTED);
    3401                 if (   pVCpu->hm.s.vmx.enmLastSeenGuestMode == PGMMODE_REAL
    3402                     && enmGuestMode >= PGMMODE_PROTECTED)
    3403                 {
    3404                     /* Signal that recompiler must flush its code-cache as the guest -may- rewrite code it will later execute
    3405                        in real-mode (e.g. OpenBSD 4.0) */
    3406                     REMFlushTBs(pVM);
    3407                     Log(("Load: Switch to protected mode detected!\n"));
    3408                 }
    3409                 pVCpu->hm.s.vmx.enmLastSeenGuestMode = enmGuestMode;
     3392                /* Signal that recompiler must flush its code-cache as the guest -may- rewrite code it will later execute
     3393                   in real-mode (e.g. OpenBSD 4.0) */
     3394                REMFlushTBs(pVM);
     3395                Log(("Load: Switch to protected mode detected!\n"));
     3396                pVCpu->hm.s.vmx.fWasInRealMode = false;
    34103397            }
    34113398        }
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