VirtualBox

Changeset 24327 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 4, 2009 1:19:32 PM (15 years ago)
Author:
vboxsync
Message:

Load CPUID leaf override; we currently don't care if the caller specifies features the host CPU doesn't support.

File:
1 edited

Legend:

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

    r23801 r24327  
    292292     */
    293293    for (i = 0; i < RT_ELEMENTS(pVM->cpum.s.aGuestCpuIdStd); i++)
     294    {
    294295        ASMCpuId_Idx_ECX(i, 0,
    295296                         &pCPUM->aGuestCpuIdStd[i].eax, &pCPUM->aGuestCpuIdStd[i].ebx,
    296297                         &pCPUM->aGuestCpuIdStd[i].ecx, &pCPUM->aGuestCpuIdStd[i].edx);
     298
     299        /* Load standard CPUID leaf override; we currently don't care if the caller specifies features the host CPU doesn't support. */
     300        PCFGMNODE pLeaf = CFGMR3GetChildF(CFGMR3GetRoot(pVM), "CPUM/CPUID/%x", i);
     301        if (pLeaf)
     302        {
     303            CFGMR3QueryU32(pLeaf, "eax", &pCPUM->aGuestCpuIdStd[i].eax);
     304            CFGMR3QueryU32(pLeaf, "ebx", &pCPUM->aGuestCpuIdStd[i].ebx);
     305            CFGMR3QueryU32(pLeaf, "ecx", &pCPUM->aGuestCpuIdStd[i].ecx);
     306            CFGMR3QueryU32(pLeaf, "edx", &pCPUM->aGuestCpuIdStd[i].edx);
     307        }
     308    }
    297309    for (i = 0; i < RT_ELEMENTS(pCPUM->aGuestCpuIdExt); i++)
     310    {
    298311        ASMCpuId(0x80000000 + i,
    299312                 &pCPUM->aGuestCpuIdExt[i].eax, &pCPUM->aGuestCpuIdExt[i].ebx,
    300313                 &pCPUM->aGuestCpuIdExt[i].ecx, &pCPUM->aGuestCpuIdExt[i].edx);
     314
     315        /* Load extended CPUID leaf override; we currently don't care if the caller specifies features the host CPU doesn't support. */
     316        PCFGMNODE pLeaf = CFGMR3GetChildF(CFGMR3GetRoot(pVM), "CPUM/CPUID/%x", i);
     317        if (pLeaf)
     318        {
     319            CFGMR3QueryU32(pLeaf, "eax", &pCPUM->aGuestCpuIdExt[i].eax);
     320            CFGMR3QueryU32(pLeaf, "ebx", &pCPUM->aGuestCpuIdExt[i].ebx);
     321            CFGMR3QueryU32(pLeaf, "ecx", &pCPUM->aGuestCpuIdExt[i].ecx);
     322            CFGMR3QueryU32(pLeaf, "edx", &pCPUM->aGuestCpuIdExt[i].edx);
     323        }
     324    }
    301325    for (i = 0; i < RT_ELEMENTS(pCPUM->aGuestCpuIdCentaur); i++)
     326    {
    302327        ASMCpuId(0xc0000000 + i,
    303328                 &pCPUM->aGuestCpuIdCentaur[i].eax, &pCPUM->aGuestCpuIdCentaur[i].ebx,
    304329                 &pCPUM->aGuestCpuIdCentaur[i].ecx, &pCPUM->aGuestCpuIdCentaur[i].edx);
     330
     331        /* Load Centaur CPUID leaf override; we currently don't care if the caller specifies features the host CPU doesn't support. */
     332        PCFGMNODE pLeaf = CFGMR3GetChildF(CFGMR3GetRoot(pVM), "CPUM/CPUID/%x", i);
     333        if (pLeaf)
     334        {
     335            CFGMR3QueryU32(pLeaf, "eax", &pCPUM->aGuestCpuIdCentaur[i].eax);
     336            CFGMR3QueryU32(pLeaf, "ebx", &pCPUM->aGuestCpuIdCentaur[i].ebx);
     337            CFGMR3QueryU32(pLeaf, "ecx", &pCPUM->aGuestCpuIdCentaur[i].ecx);
     338            CFGMR3QueryU32(pLeaf, "edx", &pCPUM->aGuestCpuIdCentaur[i].edx);
     339        }
     340    }
    305341
    306342    /*
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