VirtualBox

Changeset 11474 in vbox


Ignore:
Timestamp:
Aug 19, 2008 8:11:20 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
34951
Message:

AMD-V: Corrected current asid handling. (multiple VMs could end up using each other's ASID)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/HWACCMInternal.h

    r10817 r11474  
    274274        /* TLB flush count */
    275275        uint32_t                    cTLBFlushes;
     276
     277        /* Current ASID in use by the VM */
     278        uint32_t                    uCurrentASID;
    276279
    277280        /** R0 memory object for the VM control block (VMCB). */
  • trunk/src/VBox/VMM/VMMInternal.h

    r9387 r11474  
    8888    uint32_t                    u32Alignment;
    8989#endif
    90     /** The ring-0 logger instance. This extends beyon the size.*/
     90    /** The ring-0 logger instance. This extends beyond the size.*/
    9191    RTLOGGER                    Logger;
    9292} VMMR0LOGGER, *PVMMR0LOGGER;
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r10886 r11474  
    196196
    197197    /* Invalidate the last cpu we were running on. */
    198     pVM->hwaccm.s.svm.idLastCpu = NIL_RTCPUID;
     198    pVM->hwaccm.s.svm.idLastCpu    = NIL_RTCPUID;
     199
     200    /* we'll aways increment this the first time (host uses ASID 0) */
     201    pVM->hwaccm.s.svm.uCurrentASID = 0;
    199202    return VINF_SUCCESS;
    200203}
     
    951954            STAM_COUNTER_INC(&pVM->hwaccm.s.StatFlushASID);
    952955
    953         pVM->hwaccm.s.svm.cTLBFlushes = pCpu->cTLBFlushes;
     956        pVM->hwaccm.s.svm.cTLBFlushes  = pCpu->cTLBFlushes;
     957        pVM->hwaccm.s.svm.uCurrentASID = pCpu->uCurrentASID;
    954958    }
    955959    else
     
    959963        /* We never increase uCurrentASID in the fAlwaysFlushTLB (erratum 170) case. */
    960964        if (!pCpu->uCurrentASID)
    961             pCpu->uCurrentASID = 1;
     965            pVM->hwaccm.s.svm.uCurrentASID = pCpu->uCurrentASID = 1;
    962966
    963967        pVMCB->ctrl.TLBCtrl.n.u1TLBFlush = pVM->hwaccm.s.svm.fForceTLBFlush;
     
    965969    AssertMsg(pVM->hwaccm.s.svm.cTLBFlushes == pCpu->cTLBFlushes, ("Flush count mismatch for cpu %d (%x vs %x)\n", pCpu->idCpu, pVM->hwaccm.s.svm.cTLBFlushes, pCpu->cTLBFlushes));
    966970    AssertMsg(pCpu->uCurrentASID >= 1 && pCpu->uCurrentASID < pVM->hwaccm.s.svm.u32MaxASID, ("cpu%d uCurrentASID = %x\n", pCpu->idCpu, pCpu->uCurrentASID));
    967     pVMCB->ctrl.TLBCtrl.n.u32ASID = pCpu->uCurrentASID;
     971    AssertMsg(pVM->hwaccm.s.svm.uCurrentASID >= 1 && pVM->hwaccm.s.svm.uCurrentASID < pVM->hwaccm.s.svm.u32MaxASID, ("cpu%d VM uCurrentASID = %x\n", pCpu->idCpu, pVM->hwaccm.s.svm.uCurrentASID));
     972    pVMCB->ctrl.TLBCtrl.n.u32ASID = pVM->hwaccm.s.svm.uCurrentASID;
    968973
    969974#ifdef VBOX_WITH_STATISTICS
     
    19201925    Assert(pVM->hwaccm.s.svm.fSupported);
    19211926
    1922     LogFlow(("SVMR0Enter cpu%d last=%d asid=%d\n", pCpu->idCpu, pVM->hwaccm.s.svm.idLastCpu, pCpu->uCurrentASID));
     1927    LogFlow(("SVMR0Enter cpu%d last=%d asid=%d\n", pCpu->idCpu, pVM->hwaccm.s.svm.idLastCpu, pVM->hwaccm.s.svm.uCurrentASID));
    19231928    pVM->hwaccm.s.svm.fResumeVM = false;
    19241929
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