VirtualBox

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


Ignore:
Timestamp:
Jul 9, 2012 6:45:52 AM (12 years ago)
Author:
vboxsync
Message:

VMM/HWVMXR0: Back out r78951, better fix for acquiring/toggling new ASIDs on host Cpu resume.

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

Legend:

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

    r42044 r42045  
    866866    pCpu->idCpu         = idCpu;
    867867    pCpu->uCurrentASID  = 0;    /* we'll aways increment this the first time (host uses ASID 0) */
    868     pCpu->cTLBFlushes   = 0;
    869     pCpu->fASIDState    = true;
     868    /* Do NOT reset cTLBFlushes here, see @bugref{6255}. */
    870869
    871870    /* Should never happen */
     
    940939            {
    941940                g_HvmR0.aCpuInfo[iCpu].fConfigured = true;
     941                g_HvmR0.aCpuInfo[iCpu].cTLBFlushes = 0;
    942942                Assert(g_HvmR0.aCpuInfo[iCpu].hMemObj == NIL_RTR0MEMOBJ);
    943943            }
     
    947947        }
    948948        else
    949             AssertMsgFailed(("HWACCMR0EnableAllCpus/SUPR0EnableVTx: rc=%Rrc\n", rc));
     949            AssertMsgFailed(("hmR0EnableAllCpuOnce/SUPR0EnableVTx: rc=%Rrc\n", rc));
    950950    }
    951951    else
     
    968968            }
    969969            g_HvmR0.aCpuInfo[i].fConfigured = false;
     970            g_HvmR0.aCpuInfo[i].cTLBFlushes = 0;
    970971        }
    971972
     
    978979            if (RT_SUCCESS(rc))
    979980                rc = hmR0FirstRcGetStatus(&FirstRc);
    980             AssertMsgRC(rc, ("HWACCMR0EnableAllCpus failed for cpu %d with rc=%d\n", hmR0FirstRcGetCpuId(&FirstRc), rc));
     981            AssertMsgRC(rc, ("hmR0EnableAllCpuOnce failed for cpu %d with rc=%d\n", hmR0FirstRcGetCpuId(&FirstRc), rc));
    981982        }
    982983        else
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r42044 r42045  
    166166     * Ensure each VCPU scheduled on this CPU gets a new VPID on resume. See @bugref{6255}.
    167167     */
    168     pCpu->fASIDState = !pCpu->fASIDState;
     168    ++pCpu->cTLBFlushes;
    169169
    170170    return VINF_SUCCESS;
     
    24002400    bool fNewASID = false;
    24012401    if (   pVCpu->hwaccm.s.idLastCpu != pCpu->idCpu
    2402         || pVCpu->hwaccm.s.cTLBFlushes != pCpu->cTLBFlushes
    2403         || pVCpu->hwaccm.s.fASIDState != pCpu->fASIDState)
     2402        || pVCpu->hwaccm.s.cTLBFlushes != pCpu->cTLBFlushes)
    24042403    {
    24052404        pVCpu->hwaccm.s.fForceTLBFlush = true;
     
    24522451        }
    24532452
    2454         pVCpu->hwaccm.s.fASIDState     = pCpu->fASIDState;
    24552453        pVCpu->hwaccm.s.cTLBFlushes    = pCpu->cTLBFlushes;
    24562454        pVCpu->hwaccm.s.fForceTLBFlush = false;
     
    24592457    {
    24602458        AssertMsg(pVCpu->hwaccm.s.uCurrentASID && pCpu->uCurrentASID,
    2461                   ("hwaccm->uCurrentASID=%lu hwaccm->cTLBFlushes=%lu cpu->uCurrentASID=%lu cpu->cTLBFlushes=%lu"
    2462                    "hwaccm->fASIDState=%d cpu->fASIDState=%d\n",
     2459                  ("hwaccm->uCurrentASID=%lu hwaccm->cTLBFlushes=%lu cpu->uCurrentASID=%lu cpu->cTLBFlushes=%lu\n",
    24632460                   pVCpu->hwaccm.s.uCurrentASID, pVCpu->hwaccm.s.cTLBFlushes,
    2464                    pCpu->uCurrentASID, pCpu->cTLBFlushes, pVCpu->hwaccm.s.fASIDState, pCpu->fASIDState));
     2461                   pCpu->uCurrentASID, pCpu->cTLBFlushes));
    24652462
    24662463        /** @todo We never set VMCPU_FF_TLB_SHOOTDOWN anywhere so this path should
     
    25282525     */
    25292526    if (   pVCpu->hwaccm.s.idLastCpu != pCpu->idCpu
    2530         || pVCpu->hwaccm.s.cTLBFlushes != pCpu->cTLBFlushes
    2531         || pVCpu->hwaccm.s.fASIDState != pCpu->fASIDState)
     2527        || pVCpu->hwaccm.s.cTLBFlushes != pCpu->cTLBFlushes)
    25322528    {
    25332529        pVCpu->hwaccm.s.fForceTLBFlush = true;
     
    25422538    pVCpu->hwaccm.s.idLastCpu   = pCpu->idCpu;
    25432539    pVCpu->hwaccm.s.cTLBFlushes = pCpu->cTLBFlushes;
    2544     pVCpu->hwaccm.s.fASIDState  = pCpu->fASIDState;
    25452540
    25462541    if (pVCpu->hwaccm.s.fForceTLBFlush)
     
    25952590     */
    25962591    if (   pVCpu->hwaccm.s.idLastCpu != pCpu->idCpu
    2597         || pVCpu->hwaccm.s.cTLBFlushes != pCpu->cTLBFlushes
    2598         || pVCpu->hwaccm.s.fASIDState != pCpu->fASIDState)
     2592        || pVCpu->hwaccm.s.cTLBFlushes != pCpu->cTLBFlushes)
    25992593    {
    26002594        /* Force a TLB flush on VM entry. */
     
    26252619        pVCpu->hwaccm.s.cTLBFlushes    = pCpu->cTLBFlushes;
    26262620        pVCpu->hwaccm.s.uCurrentASID   = pCpu->uCurrentASID;
    2627         pVCpu->hwaccm.s.fASIDState     = pCpu->fASIDState;
    26282621        if (pCpu->fFlushASIDBeforeUse)
    26292622            hmR0VmxFlushVPID(pVM, pVCpu, pVM->hwaccm.s.vmx.enmFlushVPID, 0 /* GCPtr */);
     
    26322625    {
    26332626        AssertMsg(pVCpu->hwaccm.s.uCurrentASID && pCpu->uCurrentASID,
    2634                   ("hwaccm->uCurrentASID=%lu hwaccm->cTLBFlushes=%lu cpu->uCurrentASID=%lu cpu->cTLBFlushes=%lu"
    2635                    "hwaccm->fASIDState=%d cpu->fASIDState=%d\n",
     2627                  ("hwaccm->uCurrentASID=%lu hwaccm->cTLBFlushes=%lu cpu->uCurrentASID=%lu cpu->cTLBFlushes=%lu\n",
    26362628                   pVCpu->hwaccm.s.uCurrentASID, pVCpu->hwaccm.s.cTLBFlushes,
    2637                    pCpu->uCurrentASID, pCpu->cTLBFlushes, pVCpu->hwaccm.s.fASIDState, pCpu->fASIDState));
     2629                   pCpu->uCurrentASID, pCpu->cTLBFlushes));
    26382630
    26392631        /** @todo We never set VMCPU_FF_TLB_SHOOTDOWN anywhere so this path should
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