VirtualBox

Changeset 23794 in vbox for trunk/src/VBox/VMM/CPUM.cpp


Ignore:
Timestamp:
Oct 15, 2009 11:50:03 AM (15 years ago)
Author:
vboxsync
Message:

More synthetic cpu work

File:
1 edited

Legend:

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

    r23787 r23794  
    228228        &&  uECX == X86_CPUID_VENDOR_AMD_ECX
    229229        &&  uEDX == X86_CPUID_VENDOR_AMD_EDX)
    230         pVM->cpum.s.enmCPUVendor = CPUMCPUVENDOR_AMD;
     230    {
     231        pVM->cpum.s.enmGuestCpuVendor = pVM->cpum.s.enmHostCpuVendor = CPUMCPUVENDOR_AMD;
     232    }
    231233    else if (    uEAX >= 1
    232234             &&  uEBX == X86_CPUID_VENDOR_INTEL_EBX
    233235             &&  uECX == X86_CPUID_VENDOR_INTEL_ECX
    234236             &&  uEDX == X86_CPUID_VENDOR_INTEL_EDX)
    235         pVM->cpum.s.enmCPUVendor = CPUMCPUVENDOR_INTEL;
     237    {
     238        pVM->cpum.s.enmGuestCpuVendor = pVM->cpum.s.enmHostCpuVendor = CPUMCPUVENDOR_INTEL;
     239    }
    236240    else /** @todo Via */
    237         pVM->cpum.s.enmCPUVendor = CPUMCPUVENDOR_UNKNOWN;
     241    {
     242        pVM->cpum.s.enmGuestCpuVendor = pVM->cpum.s.enmHostCpuVendor = CPUMCPUVENDOR_UNKNOWN;
     243    }
    238244
    239245    /*
     
    400406    if (pCPUM->fSyntheticCpu)
    401407    {
     408        const char szVendor[13]    = "VirtualBox  ";
     409        const char szProcessor[48] = "VirtualBox SPARCx86 Processor v1000            "; /* includes null terminator */
     410
     411        pCPUM->enmGuestCpuVendor = CPUMCPUVENDOR_SYNTHETIC;
     412
     413        /* Vendor */
     414        pCPUM->aGuestCpuIdStd[0].ebx = pCPUM->aGuestCpuIdExt[0].ebx = ((uint32_t *)szVendor)[0];
     415        pCPUM->aGuestCpuIdStd[0].ecx = pCPUM->aGuestCpuIdExt[0].ecx = ((uint32_t *)szVendor)[2];
     416        pCPUM->aGuestCpuIdStd[0].edx = pCPUM->aGuestCpuIdExt[0].edx = ((uint32_t *)szVendor)[1];
     417
     418        /* Processor Name String Identifier. */
     419        pCPUM->aGuestCpuIdExt[2].eax = ((uint32_t *)szProcessor)[0];
     420        pCPUM->aGuestCpuIdExt[2].ebx = ((uint32_t *)szProcessor)[1];
     421        pCPUM->aGuestCpuIdExt[2].ecx = ((uint32_t *)szProcessor)[2];
     422        pCPUM->aGuestCpuIdExt[2].edx = ((uint32_t *)szProcessor)[3];
     423        pCPUM->aGuestCpuIdExt[3].eax = ((uint32_t *)szProcessor)[4];
     424        pCPUM->aGuestCpuIdExt[3].ebx = ((uint32_t *)szProcessor)[5];
     425        pCPUM->aGuestCpuIdExt[3].ecx = ((uint32_t *)szProcessor)[6];
     426        pCPUM->aGuestCpuIdExt[3].edx = ((uint32_t *)szProcessor)[7];
     427        pCPUM->aGuestCpuIdExt[4].eax = ((uint32_t *)szProcessor)[8];
     428        pCPUM->aGuestCpuIdExt[4].ebx = ((uint32_t *)szProcessor)[9];
     429        pCPUM->aGuestCpuIdExt[4].ecx = ((uint32_t *)szProcessor)[10];
     430        pCPUM->aGuestCpuIdExt[4].edx = ((uint32_t *)szProcessor)[11];
     431
    402432        /* AMD only; shared feature bits are set dynamically. */
    403433        pCPUM->aGuestCpuIdExt[1].edx = 0;
     
    449479#ifdef VBOX_WITH_MULTI_CORE
    450480    if (    pVM->cCpus > 1
    451         &&  pVM->cpum.s.enmCPUVendor == CPUMCPUVENDOR_INTEL)
     481        &&  pVM->cpum.s.enmGuestCpuVendor == CPUMCPUVENDOR_INTEL)
    452482    {
    453483        AssertReturn(pVM->cCpus <= 64, VERR_TOO_MANY_CPUS);
     
    498528    if (pCPUM->aGuestCpuIdExt[0].eax >= UINT32_C(0x80000007))
    499529    {
    500         Assert(pVM->cpum.s.enmCPUVendor != CPUMCPUVENDOR_INVALID);
     530        Assert(pVM->cpum.s.enmGuestCpuVendor != CPUMCPUVENDOR_INVALID);
    501531
    502532        pCPUM->aGuestCpuIdExt[7].eax = pCPUM->aGuestCpuIdExt[7].ebx = pCPUM->aGuestCpuIdExt[7].ecx = 0;
    503533
    504         if (pVM->cpum.s.enmCPUVendor == CPUMCPUVENDOR_AMD)
     534        if (pVM->cpum.s.enmGuestCpuVendor == CPUMCPUVENDOR_AMD)
    505535        {
    506536            /* Only expose the TSC invariant capability bit to the guest. */
     
    543573#ifdef VBOX_WITH_MULTI_CORE
    544574        if (    pVM->cCpus > 1
    545             &&  pVM->cpum.s.enmCPUVendor == CPUMCPUVENDOR_AMD)
     575            &&  pVM->cpum.s.enmGuestCpuVendor == CPUMCPUVENDOR_AMD)
    546576        {
    547577            /* Legacy method to determine the number of cores. */
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