VirtualBox

Changeset 54815 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Mar 17, 2015 4:25:55 PM (10 years ago)
Author:
vboxsync
Message:

CPUMR3CpuId.cpp: Fixed problem collecting CPUID sub-leaves for leaf 0xb, checking the wrong register (edx instead of ecx).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp

    r54813 r54815  
    949949            && (auCur[2] == 0 || auCur[2] == uSubLeaf)
    950950            && (auCur[3] == 0 || uLeaf == 0xb /* edx is fixed */) )
     951        {
     952            cRepeats = 0;
    951953            break;
     954        }
    952955
    953956        /* 2. Look for more than 4 repeating value sets. */
     
    968971        /* 3. Leaf 0xb level type 0 check. */
    969972        if (   uLeaf == 0xb
    970             && (auCur[3]  & 0xff00) == 0
    971             && (auPrev[3] & 0xff00) == 0)
     973            && (auCur[2]  & 0xff00) == 0
     974            && (auPrev[2] & 0xff00) == 0)
     975        {
     976            cRepeats = 0;
    972977            break;
     978        }
    973979
    974980        /* 99. Give up. */
     
    10041010    *pfFinalEcxUnchanged = auCur[2] == uSubLeaf && uLeaf == 0xb;
    10051011    *pcSubLeaves = uSubLeaf + 1 - cRepeats;
     1012    if (*pcSubLeaves == 0)
     1013        *pcSubLeaves = 1;
    10061014    return true;
    10071015}
     
    19251933            uint32_t i = 0;
    19261934            if (   pCpum->GuestInfo.cCpuIdLeaves > 0
    1927                 && pCpum->GuestInfo.paCpuIdLeavesR3[0].uEax <= UINT32_C(0xff))
     1935                && pCpum->GuestInfo.paCpuIdLeavesR3[0].uLeaf <= UINT32_C(0xff))
    19281936            {
    19291937                while (   i + 1 < pCpum->GuestInfo.cCpuIdLeaves
    1930                        && pCpum->GuestInfo.paCpuIdLeavesR3[i + 1].uEax <= UINT32_C(0xff))
     1938                       && pCpum->GuestInfo.paCpuIdLeavesR3[i + 1].uLeaf <= UINT32_C(0xff))
    19311939                    i++;
    19321940                pCpum->GuestInfo.DefCpuId.uEax = pCpum->GuestInfo.paCpuIdLeavesR3[i].uEax;
     
    43684376        {
    43694377            CPUMCPUID Host;
    4370             ASMCpuIdExSlow(pCurLeaf->uLeaf, pCurLeaf->uSubLeaf, 0, 0, &Host.uEax, &Host.uEbx, &Host.uEcx, &Host.uEdx);
     4378            ASMCpuIdExSlow(pCurLeaf->uLeaf, 0, pCurLeaf->uSubLeaf, 0, &Host.uEax, &Host.uEbx, &Host.uEcx, &Host.uEdx);
    43714379            pHlp->pfnPrintf(pHlp,
    43724380                            "Gst: %08x/%04x  %08x %08x %08x %08x\n"
     
    44304438        for (uint32_t uSubLeaf = 0; uSubLeaf < cMaxSubLeaves; uSubLeaf++)
    44314439        {
    4432             ASMCpuIdExSlow(uLeaf, uSubLeaf, 0, 0, &Host.uEax, &Host.uEbx, &Host.uEcx, &Host.uEdx);
     4440            ASMCpuIdExSlow(uLeaf, 0, uSubLeaf, 0, &Host.uEax, &Host.uEbx, &Host.uEcx, &Host.uEdx);
    44334441            if (   pCurLeaf - paLeaves < cLeaves
    44344442                && pCurLeaf->uLeaf    == uLeaf
     
    44374445                pHlp->pfnPrintf(pHlp,
    44384446                                "Gst: %08x/%04x  %08x %08x %08x %08x\n"
    4439                                 "Hst:               %08x %08x %08x %08x\n",
     4447                                "Hst:                %08x %08x %08x %08x\n",
    44404448                                uLeaf, uSubLeaf, pCurLeaf->uEax, pCurLeaf->uEbx, pCurLeaf->uEcx, pCurLeaf->uEdx,
    44414449                                Host.uEax, Host.uEbx, Host.uEcx, Host.uEdx);
     
    47184726            for (uint32_t uSubLeaf = 0; uSubLeaf < cMaxSubLeaves; uSubLeaf++)
    47194727            {
    4720                 ASMCpuIdExSlow(uLeaf, uSubLeaf, 0, 0, &Host.uEax, &Host.uEbx, &Host.uEcx, &Host.uEdx);
     4728                ASMCpuIdExSlow(uLeaf, 0, uSubLeaf, 0, &Host.uEax, &Host.uEbx, &Host.uEcx, &Host.uEdx);
    47214729                if (   pCurLeaf - paLeaves < cLeaves
    47224730                    && pCurLeaf->uLeaf    == uLeaf
     
    47254733                    pHlp->pfnPrintf(pHlp,
    47264734                                    "Gst: %08x/%04x  %08x %08x %08x %08x\n"
    4727                                     "Hst:                 %08x %08x %08x %08x\n",
     4735                                    "Hst:                %08x %08x %08x %08x\n",
    47284736                                    uLeaf, uSubLeaf, pCurLeaf->uEax, pCurLeaf->uEbx, pCurLeaf->uEcx, pCurLeaf->uEdx,
    47294737                                    Host.uEax, Host.uEbx, Host.uEcx, Host.uEdx);
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