VirtualBox

Changeset 10208 in vbox for trunk/src


Ignore:
Timestamp:
Jul 4, 2008 9:17:59 AM (16 years ago)
Author:
vboxsync
Message:

Cpuid 0x800000005 & 0x800000006 contain information about L1, L2 & L3 cache and TLB identifiers. Safe to pass on to the guest.

File:
1 edited

Legend:

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

    r10123 r10208  
    343343
    344344    /*
    345      * Determin the default.
     345     * Determine the default.
    346346     *
    347347     * Intel returns values of the highest standard function, while AMD
     
    352352             &pCPUM->GuestCpuIdDef.eax, &pCPUM->GuestCpuIdDef.ebx,
    353353             &pCPUM->GuestCpuIdDef.ecx, &pCPUM->GuestCpuIdDef.edx);
     354
     355    /* Cpuid 0x800000005 & 0x800000006 contain information about L1, L2 & L3 cache and TLB identifiers.
     356     * Safe to pass on to the guest.
     357     *
     358     * Intel: 0x800000005 reserved
     359     *        0x800000006 L2 cache information
     360     * AMD:   0x800000005 L1 cache information
     361     *        0x800000006 L2/L3 cache information
     362     */
    354363
    355364    /*
     
    365374        pCPUM->aGuestCpuIdStd[i] = pCPUM->GuestCpuIdDef;
    366375
    367     if (pCPUM->aGuestCpuIdExt[0].eax > UINT32_C(0x80000004))
    368         pCPUM->aGuestCpuIdExt[0].eax = UINT32_C(0x80000004);
     376    if (pCPUM->aGuestCpuIdExt[0].eax > UINT32_C(0x80000006))
     377        pCPUM->aGuestCpuIdExt[0].eax = UINT32_C(0x80000006);
    369378    for (i = pCPUM->aGuestCpuIdExt[0].eax >= UINT32_C(0x80000000)
    370379           ? pCPUM->aGuestCpuIdExt[0].eax - UINT32_C(0x80000000) + 1
     
    376385     * Workaround for missing cpuid(0) patches: If we miss to patch a cpuid(0).eax then
    377386     * Linux tries to determine the number of processors from (cpuid(4).eax >> 26) + 1.
    378      * We don't support more than 1 processor.
     387     * We currently don't support more than 1 processor.
    379388     */
    380389    pCPUM->aGuestCpuIdStd[4].eax = 0;
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