VirtualBox

Changeset 8806 in vbox


Ignore:
Timestamp:
May 14, 2008 9:34:15 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
30807
Message:

Determine which AMD cpus are really affected by erratum 170 (forced TLB flush on each world switch as a workaround)

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

Legend:

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

    r8155 r8806  
    210210        /** Set if we don't have to flush the TLB on VM entry. */
    211211        bool                        fResumeVM;
     212        /** Set if erratum 170 affects the AMD cpu. */
     213        bool                        fForceTLBFlush;
    212214
    213215        /** R0 memory object for the VM control block (VMCB). */
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r8155 r8806  
    142142    /* Set all bits to intercept all MSR accesses. */
    143143    ASMMemFill32(pVM->hwaccm.s.svm.pMSRBitmap, PAGE_SIZE*2, 0xffffffff);
     144
     145    /* Erratum 170 which requires a forced TLB flush for each world switch has been fixed in stepping 1 of the Brisbane core.
     146     * Family = 0x0f
     147     * Model[7:0] = {ExtModel[3:0],BaseModel[3:0]} = 0x68 or 0x6b
     148     * Stepping >= 1
     149     */
     150    uint32_t u32Dummy;
     151    uint32_t u32Version, u32Family, u32Model, u32Stepping, u32ExtModel;
     152    ASMCpuId(1, &u32Version, &u32Dummy, &u32Dummy, &u32Dummy);
     153    u32Family    = (u32Version >> 8) & 0x0f;
     154    u32Model     = (u32Version >> 4) & 0x0f;
     155    u32ExtModel  = (u32Version >> 16) & 0x0f;
     156    u32Stepping  = u32Version & 0xf;
     157    if (    u32Family == 0xf
     158        &&  (u32ExtModel == 0x6)
     159        &&  (u32Model == 0x8 || u32Model == 0xb)
     160        &&  u32Stepping == 0)
     161    {
     162        pVM->hwaccm.s.svm.fForceTLBFlush = true;
     163    }
    144164
    145165    return VINF_SUCCESS;
     
    736756    STAM_PROFILE_ADV_START(&pVM->hwaccm.s.StatInGC, x);
    737757
    738     /** Erratum #170 -> must force a TLB flush */
    739     /** @todo supposed to be fixed in future by AMD */
    740     fForceTLBFlush = true;
    741 
    742758    if (    pVM->hwaccm.s.svm.fResumeVM == false
    743         ||  fForceTLBFlush)
     759        ||  pVM->hwaccm.s.svm.fForceTLBFlush)
    744760    {
    745761        pVMCB->ctrl.TLBCtrl.n.u1TLBFlush = 1;
    746762    }
    747763    else
    748     {
    749764        pVMCB->ctrl.TLBCtrl.n.u1TLBFlush = 0;
    750     }
     765
    751766    /* In case we execute a goto ResumeExecution later on. */
    752767    pVM->hwaccm.s.svm.fResumeVM = true;
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