VirtualBox

Changeset 8815 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
May 14, 2008 2:47:55 PM (17 years ago)
Author:
vboxsync
Message:

Corrected revision checks for erratum 170.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/CPUM.cpp

    r8735 r8815  
    11351135                        "Brand ID:                        %#04x\n",
    11361136                        (uEAX >> 8) & 0xf, (uEAX >> 20) & 0x7f, ((uEAX >> 8) & 0xf) + (((uEAX >> 8) & 0xf) == 0xf ? (uEAX >> 20) & 0x7f : 0),
    1137                         (uEAX >> 4) & 0xf, (uEAX >> 16) & 0x0f, ((uEAX >> 4) & 0xf) | (((uEAX >> 4) & 0xf) == 0xf ? (uEAX >> 16) & 0x0f : 0),
     1137                        (uEAX >> 4) & 0xf, (uEAX >> 16) & 0x0f, ((uEAX >> 4) & 0xf) | ((((uEAX >> 4) & 0xf) == 0xf ? (uEAX >> 16) & 0x0f : 0) << 4),
    11381138                        (uEAX >> 0) & 0xf,
    11391139                        (Guest.ebx >> 24) & 0xff,
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r8809 r8815  
    143143    ASMMemFill32(pVM->hwaccm.s.svm.pMSRBitmap, PAGE_SIZE*2, 0xffffffff);
    144144
    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
     145    /* Erratum 170 which requires a forced TLB flush for each world switch:
     146     * See http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/33610.pdf
     147     *
     148     * All BH-G1/2 and DH-G1/2 models include a fix:
     149     * Athlon X2:   0x6b 1/2
     150     *              0x68 1/2
     151     * Athlon 64:   0x7f 1
     152     *              0x6f 2
     153     * Sempron:     0x7f 1/2
     154     *              0x6f 2
     155     *              0x6c 2
     156     *              0x7c 2
     157     * Turion 64:   0x68 2
     158     *
    149159     */
    150160    uint32_t u32Dummy;
    151     uint32_t u32Version, u32Family, u32Model, u32Stepping, u32ExtModel;
     161    uint32_t u32Version, u32Family, u32Model, u32Stepping;
    152162    ASMCpuId(1, &u32Version, &u32Dummy, &u32Dummy, &u32Dummy);
    153     u32Family    = (u32Version >> 8) & 0x0f;
    154     u32Model     = (u32Version >> 4) & 0x0f;
    155     u32ExtModel  = (u32Version >> 16) & 0x0f;
     163    u32Family    = ((u32Version >> 8) & 0xf) + (((u32Version >> 8) & 0xf) == 0xf ? (u32Version >> 20) & 0x7f : 0);
     164    u32Model     = ((u32Version >> 4) & 0xf);
     165    u32Model     = u32Model | ((u32Model == 0xf ? (u32Version >> 16) & 0x0f : 0) << 4);
    156166    u32Stepping  = u32Version & 0xf;
    157167    if (    u32Family == 0xf
    158         &&  (u32ExtModel == 0x6)
    159         &&  (u32Model == 0x8 || u32Model == 0xb)
    160         &&  u32Stepping == 0)
    161     {
     168        &&  !((u32Model == 0x68 || u32Model == 0x6b || u32Model == 0x7f) &&  u32Stepping >= 1)
     169        &&  !((u32Model == 0x6f || u32Model == 0x6c || u32Model == 0x7c) &&  u32Stepping >= 2))
     170    {
     171        Log(("SVMR0InitVM: AMD cpu with erratum 170 family %x model %x stepping %x\n", u32Family, u32Model, u32Stepping));
    162172        pVM->hwaccm.s.svm.fForceTLBFlush = true;
    163173    }
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