VirtualBox

Changeset 22037 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Aug 6, 2009 3:27:25 PM (15 years ago)
Author:
vboxsync
Message:

VMM: correct report cores count, also expose more CPUID leaves by default

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r21252 r22037  
    10651065        pCpuId = &pVM->cpum.s.GuestCpuIdDef;
    10661066
     1067    bool fHasMoreCaches = (*pEcx == 0);
     1068
    10671069    *pEax = pCpuId->eax;
    10681070    *pEbx = pCpuId->ebx;
     
    10761078        Assert(pVCpu->idCpu <= 255);
    10771079        *pEbx |= (pVCpu->idCpu << 24);
     1080   }
     1081
     1082    if ( iLeaf == 4 && fHasMoreCaches &&
     1083         pVM->cpum.s.enmCPUVendor == CPUMCPUVENDOR_INTEL)
     1084    {
     1085        /* Report unified L0 cache, Linux'es num_cpu_cores() requires
     1086         * that to be non-0 to detect core count correctly. */
     1087        *pEax |= (1 << 5) | 3;
    10781088    }
    10791089
     
    20482058    return enmMode;
    20492059}
    2050 
  • trunk/src/VBox/VMM/VMMAll/EMAll.cpp

    r21174 r22037  
    19851985    pRegFrame->rax = 0;
    19861986    pRegFrame->rbx = 0;
    1987     pRegFrame->rcx = 0;
     1987    pRegFrame->rcx &= UINT64_C(0x00000000ffffffff);
    19881988    pRegFrame->rdx = 0;
    19891989
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