VirtualBox

Changeset 20914 in vbox for trunk


Ignore:
Timestamp:
Jun 25, 2009 8:16:14 AM (16 years ago)
Author:
vboxsync
Message:

Corrected cpuid values for multi-core vcpus.

File:
1 edited

Legend:

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

    r20532 r20914  
    392392    if (pVM->cCPUs > 1)
    393393    {
    394         /* Set the Maximum number of addressable IDs for logical processors in this physical package (bits 16-23) */
    395         pCPUM->aGuestCpuIdStd[1].ebx |= ((pVM->cCPUs - 1) << 16);
     394        /* If CPUID Fn0000_0001_EDX[HTT] = 1 then LogicalProcessorCount is the number of threads per CPU core times the number of CPU cores per processor */
     395        pCPUM->aGuestCpuIdStd[1].ebx |= (pVM->cCPUs << 16);
    396396        pCPUM->aGuestCpuIdStd[1].edx |= X86_CPUID_FEATURE_EDX_HTT;  /* necessary for hyper-threading *or* multi-core CPUs */
    397397    }
     
    430430        AssertReturn(pVM->cCPUs <= 64, VERR_TOO_MANY_CPUS);
    431431        /* One logical processor with possibly multiple cores. */
    432         pCPUM->aGuestCpuIdStd[4].eax |= ((pVM->cCPUs - 1) << 26);   /* 6 bits only -> 64 cores! */
     432        pCPUM->aGuestCpuIdStd[4].eax |= (pVM->cCPUs << 26);   /* 6 bits only -> 64 cores! */
    433433    }
    434434#endif
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