VirtualBox

Changeset 10208

Show
Ignore:
Timestamp:
07/04/08 11:17:59 (5 months ago)
Author:
vboxsync
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 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; 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy