VirtualBox

Changeset 24325 in vbox


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

Add cpuid leaf overrides to the CFGM tree

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r24286 r24325  
    241241    rc = CFGMR3InsertInteger(pRoot, "RawR3Enabled",         1);     /* boolean */   RC_CHECK();
    242242    rc = CFGMR3InsertInteger(pRoot, "RawR0Enabled",         1);     /* boolean */   RC_CHECK();
    243     /** @todo Config: RawR0, PATMEnabled and CASMEnabled needs attention later. */
     243    /** @todo Config: RawR0, PATMEnabled and CSAMEnabled needs attention later. */
    244244    rc = CFGMR3InsertInteger(pRoot, "PATMEnabled",          1);     /* boolean */   RC_CHECK();
    245245    rc = CFGMR3InsertInteger(pRoot, "CSAMEnabled",          1);     /* boolean */   RC_CHECK();
     246
     247    /* Standard leaf cpuid overrides. */
     248    for (unsigned leaf = 0; leaf < 0xA; leaf++)
     249    {
     250        ULONG ulEax, ulEbx, ulEcx, ulEdx;
     251        if (pMachine->GetCpuIdLeaf(leaf, &ulEax, &ulEbx, &ulEcx, &ulEdx) == S_OK)
     252        {
     253            PCFGMNODE pLeaf;
     254            rc = CFGMR3InsertNodeF(pRoot, &pLeaf, "CPUM/CPUID/%x", leaf);               RC_CHECK();
     255
     256            rc = CFGMR3InsertInteger(pLeaf, "eax", ulEax);                      RC_CHECK();
     257            rc = CFGMR3InsertInteger(pLeaf, "ebx", ulEax);                      RC_CHECK();
     258            rc = CFGMR3InsertInteger(pLeaf, "ecx", ulEax);                      RC_CHECK();
     259            rc = CFGMR3InsertInteger(pLeaf, "edx", ulEax);                      RC_CHECK();
     260        }
     261    }
     262
     263    /* Extended leaf cpuid overrides. */
     264    for (unsigned leaf = 0x80000000; leaf < 0x8000000A; leaf++)
     265    {
     266        ULONG ulEax, ulEbx, ulEcx, ulEdx;
     267        if (pMachine->GetCpuIdLeaf(leaf, &ulEax, &ulEbx, &ulEcx, &ulEdx) == S_OK)
     268        {
     269            PCFGMNODE pLeaf;
     270            rc = CFGMR3InsertNodeF(pRoot, &pLeaf, "CPUM/CPUID/%x", leaf);               RC_CHECK();
     271
     272            rc = CFGMR3InsertInteger(pLeaf, "eax", ulEax);                      RC_CHECK();
     273            rc = CFGMR3InsertInteger(pLeaf, "ebx", ulEax);                      RC_CHECK();
     274            rc = CFGMR3InsertInteger(pLeaf, "ecx", ulEax);                      RC_CHECK();
     275            rc = CFGMR3InsertInteger(pLeaf, "edx", ulEax);                      RC_CHECK();
     276        }
     277    }
    246278
    247279    if (osTypeId == "WindowsNT4")
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