VirtualBox

Changeset 22070 in vbox


Ignore:
Timestamp:
Aug 7, 2009 1:34:10 PM (15 years ago)
Author:
vboxsync
Message:

VMM,ConsoleImpl2: Moved NT4LeafLimit down into /CPUM and documented it. Cleanup.

Location:
trunk/src/VBox
Files:
3 edited

Legend:

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

    r22048 r22070  
    244244    {
    245245        /*
    246          * We must limit CPUID count for Windows NT 4,
    247          * as otherwise it stops with 0x3e error
    248          * (MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED).
     246         * We must limit CPUID count for Windows NT 4, as otherwise it stops
     247         * with error 0x3e (MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED).
    249248         */
    250249        LogRel(("Limiting CPUID leaf count for NT4 guests\n"));
    251         rc = CFGMR3InsertInteger(pRoot, "NT4LeafLimit", true);                          RC_CHECK();
     250        PCFGMNODE pCPUM;
     251        rc = CFGMR3InsertNode(pRoot, "CPUM", &pCPUM);                               RC_CHECK();
     252        rc = CFGMR3InsertInteger(pCPUM, "NT4LeafLimit", true);                      RC_CHECK();
    252253    }
    253254
  • trunk/src/VBox/VMM/CPUM.cpp

    r22042 r22070  
    527527    }
    528528
     529    /** @cfgm{/CPUM/NT4LeafLimit, boolean, false}
     530     * Limit the number of standard CPUID leafs to 0..2 to prevent NT4 from
     531     * bugchecking with MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED (0x3e).
     532     * This option corrsponds somewhat to IA32_MISC_ENABLES.BOOT_NT4[bit 22].
     533     * @todo r=bird: The intel docs states that leafs 3 is included, why don't we?
     534     */
     535    bool fNt4LeafLimit;
     536    CFGMR3QueryBoolDef(CFGMR3GetChild(CFGMR3GetRoot(pVM), "CPUM"), "NT4LeafLimit", &fNt4LeafLimit, false);
     537    if (fNt4LeafLimit)
     538        pCPUM->aGuestCpuIdStd[0].eax = 2;
     539
    529540    /*
    530541     * Limit it the number of entries and fill the remaining with the defaults.
     
    534545     * info too in these leaves (like words about having a constant TSC).
    535546     */
    536     {
    537         bool fNt4LeafLimit;
    538         PCFGMNODE pNode = CFGMR3GetRoot(pVM);
    539         int rc = CFGMR3QueryBoolDef(pNode, "NT4LeafLimit", &fNt4LeafLimit, false);
    540         if (RT_SUCCESS(rc) && fNt4LeafLimit)
    541             pCPUM->aGuestCpuIdStd[0].eax = 2;
    542     }
    543547    if (pCPUM->aGuestCpuIdStd[0].eax > 5)
    544548        pCPUM->aGuestCpuIdStd[0].eax = 5;
     
    556560
    557561    /*
    558      * Workaround for missing cpuid(0) patches: If we miss to patch a cpuid(0).eax then
    559      * Linux tries to determine the number of processors from (cpuid(4).eax >> 26) + 1.
    560      * We currently don't support more than 1 processor.
     562     * Workaround for missing cpuid(0) patches when leaf 4 returns GuestCpuIdDef:
     563     * If we miss to patch a cpuid(0).eax then Linux tries to determine the number
     564     * of processors from (cpuid(4).eax >> 26) + 1.
    561565     */
    562566    if (pVM->cCPUs == 1)
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r22037 r22070  
    10801080   }
    10811081
    1082     if ( iLeaf == 4 && fHasMoreCaches &&
    1083          pVM->cpum.s.enmCPUVendor == CPUMCPUVENDOR_INTEL)
     1082    if (    iLeaf == 4
     1083        &&  fHasMoreCaches
     1084        &&  pVM->cpum.s.enmCPUVendor == CPUMCPUVENDOR_INTEL)
    10841085    {
    10851086        /* Report unified L0 cache, Linux'es num_cpu_cores() requires
     
    20582059    return enmMode;
    20592060}
     2061
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