VirtualBox

Changeset 101017 in vbox for trunk


Ignore:
Timestamp:
Sep 5, 2023 9:11:24 AM (13 months ago)
Author:
vboxsync
Message:

CPUID: Corrected AMD L2/L3 cache info dumping from CPUID Fn8000_0006.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp

    r100992 r101017  
    47644764
    47654765/**
    4766  * Get L2 cache associativity.
     4766 * Get L2/L3 cache associativity.
    47674767 */
    4768 static const char *getL2CacheAss(unsigned u)
     4768static const char *getL23CacheAss(unsigned u)
    47694769{
    47704770    switch (u)
     
    47734773        case 1:  return "direct";
    47744774        case 2:  return "2 way ";
    4775         case 3:  return "res3 ";
     4775        case 3:  return "3 way ";
    47764776        case 4:  return "4 way ";
    4777         case 5:  return "res5 ";
     4777        case 5:  return "6 way ";
    47784778        case 6:  return "8 way ";
    47794779        case 7:  return "res7  ";
    47804780        case 8:  return "16 way";
    4781         case 9:  return "res9  ";
    4782         case 10: return "res10 ";
    4783         case 11: return "res11 ";
    4784         case 12: return "res12 ";
    4785         case 13: return "res13 ";
    4786         case 14: return "res14 ";
     4781        case 9:  return "tpoext";   /* Overridden by Fn8000_001D */
     4782        case 10: return "32 way";
     4783        case 11: return "48 way";
     4784        case 12: return "64 way";
     4785        case 13: return "96 way";
     4786        case 14: return "128way";
    47874787        case 15: return "fully ";
    47884788        default: return "????";
     
    57415741            uint32_t uEAX = pCurLeaf->uEax;
    57425742            uint32_t uEBX = pCurLeaf->uEbx;
     5743            uint32_t uECX = pCurLeaf->uEcx;
    57435744            uint32_t uEDX = pCurLeaf->uEdx;
    57445745
     
    57465747                            "L2 TLB 2/4M Instr/Uni:           %s %4d entries\n"
    57475748                            "L2 TLB 2/4M Data:                %s %4d entries\n",
    5748                             getL2CacheAss((uEAX >> 12) & 0xf), (uEAX >>  0) & 0xfff,
    5749                             getL2CacheAss((uEAX >> 28) & 0xf), (uEAX >> 16) & 0xfff);
     5749                            getL23CacheAss((uEAX >> 12) & 0xf), (uEAX >>  0) & 0xfff,
     5750                            getL23CacheAss((uEAX >> 28) & 0xf), (uEAX >> 16) & 0xfff);
    57505751            pHlp->pfnPrintf(pHlp,
    57515752                            "L2 TLB 4K Instr/Uni:             %s %4d entries\n"
    57525753                            "L2 TLB 4K Data:                  %s %4d entries\n",
    5753                             getL2CacheAss((uEBX >> 12) & 0xf), (uEBX >>  0) & 0xfff,
    5754                             getL2CacheAss((uEBX >> 28) & 0xf), (uEBX >> 16) & 0xfff);
     5754                            getL23CacheAss((uEBX >> 12) & 0xf), (uEBX >>  0) & 0xfff,
     5755                            getL23CacheAss((uEBX >> 28) & 0xf), (uEBX >> 16) & 0xfff);
    57555756            pHlp->pfnPrintf(pHlp,
    57565757                            "L2 Cache Line Size:              %d bytes\n"
     
    57585759                            "L2 Cache Associativity:          %s\n"
    57595760                            "L2 Cache Size:                   %d KB\n",
     5761                            (uECX >> 0) & 0xff,
     5762                            (uECX >> 8) & 0xf,
     5763                            getL23CacheAss((uECX >> 12) & 0xf),
     5764                            (uECX >> 16) & 0xffff);
     5765            pHlp->pfnPrintf(pHlp,
     5766                            "L3 Cache Line Size:              %d bytes\n"
     5767                            "L3 Cache Lines Per Tag:          %d\n"
     5768                            "L3 Cache Associativity:          %s\n"
     5769                            "L3 Cache Size:                   %d KB\n",
    57605770                            (uEDX >> 0) & 0xff,
    57615771                            (uEDX >> 8) & 0xf,
    5762                             getL2CacheAss((uEDX >> 12) & 0xf),
    5763                             (uEDX >> 16) & 0xffff);
     5772                            getL23CacheAss((uEDX >> 12) & 0xf),
     5773                            ((uEDX >> 18) & 0x3fff) * 512);
    57645774        }
    57655775
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