Lines Matching defs:uLeaf

521  * @param   uLeaf               The leaf to locate.
524 static PCPUMCPUIDLEAF cpumR3CpuIdGetLeaf(PCPUMCPUIDLEAF paLeaves, uint32_t cLeaves, uint32_t uLeaf, uint32_t uSubLeaf)
529 if ( paLeaves[i].uLeaf == uLeaf
542 * @param uLeaf The leaf to locate.
546 static bool cpumR3CpuIdGetLeafLegacy(PCPUMCPUIDLEAF paLeaves, uint32_t cLeaves, uint32_t uLeaf, uint32_t uSubLeaf,
549 PCPUMCPUIDLEAF pLeaf = cpumR3CpuIdGetLeaf(paLeaves, cLeaves, uLeaf, uSubLeaf);
645 * @param uLeaf The leaf we're adding.
655 uint32_t uLeaf, uint32_t uSubLeaf, uint32_t fSubLeafMask,
663 || pNew[-1].uLeaf < uLeaf
664 || (pNew[-1].uLeaf == uLeaf && pNew[-1].uSubLeaf < uSubLeaf) );
666 pNew->uLeaf = uLeaf;
692 if (paLeaves[i].uLeaf != paLeaves[i - 1].uLeaf)
693 AssertMsg(paLeaves[i].uLeaf > paLeaves[i - 1].uLeaf, ("%#x vs %#x\n", paLeaves[i].uLeaf, paLeaves[i - 1].uLeaf));
697 ("%#x: %#x vs %#x\n", paLeaves[i].uLeaf, paLeaves[i].uSubLeaf, paLeaves[i - 1].uSubLeaf));
699 ("%#x/%#x: %#x vs %#x\n", paLeaves[i].uLeaf, paLeaves[i].uSubLeaf, paLeaves[i].fSubLeafMask, paLeaves[i - 1].fSubLeafMask));
701 ("%#x/%#x: %#x vs %#x\n", paLeaves[i].uLeaf, paLeaves[i].uSubLeaf, paLeaves[i].fFlags, paLeaves[i - 1].fFlags));
753 ("%#x/%#x: %#x", pNewLeaf->uLeaf, pNewLeaf->uSubLeaf, pNewLeaf->fFlags),
756 ("%#x/%#x: %#x", pNewLeaf->uLeaf, pNewLeaf->uSubLeaf, pNewLeaf->fSubLeafMask),
759 ("%#x/%#x: %#x", pNewLeaf->uLeaf, pNewLeaf->uSubLeaf, pNewLeaf->fSubLeafMask),
762 ("%#x/%#x: %#x", pNewLeaf->uLeaf, pNewLeaf->uSubLeaf, pNewLeaf->fSubLeafMask),
771 && paLeaves[cLeaves - 1].uLeaf < pNewLeaf->uLeaf)
777 && paLeaves[cLeaves - 1].uLeaf == pNewLeaf->uLeaf)
783 && paLeaves[i - 1].uLeaf == pNewLeaf->uLeaf)
791 && paLeaves[i].uLeaf < pNewLeaf->uLeaf)
795 && paLeaves[i].uLeaf == pNewLeaf->uLeaf)
805 && paLeaves[i + c].uLeaf == pNewLeaf->uLeaf)
821 && paLeaves[i].uLeaf == pNewLeaf->uLeaf)
828 && paLeaves[i].uLeaf == pNewLeaf->uLeaf
876 && paLeaves[iFirst].uLeaf < uFirst)
884 && paLeaves[iEnd].uLeaf <= uLast)
906 * @param uLeaf The leaf we're reading.
911 static bool cpumR3IsEcxRelevantForCpuIdLeaf(uint32_t uLeaf, uint32_t *pcSubLeaves, bool *pfFinalEcxUnchanged)
917 ASMCpuIdExSlow(uLeaf, 0, 0, 0, &auPrev[0], &auPrev[1], &auPrev[2], &auPrev[3]);
923 ASMCpuIdExSlow(uLeaf, 0, uSubLeaf, 0, &auCur[0], &auCur[1], &auCur[2], &auCur[3]);
941 ASMCpuIdExSlow(uLeaf, 0, uSubLeaf, 0, &auCur[0], &auCur[1], &auCur[2], &auCur[3]);
950 && (auCur[3] == 0 || uLeaf == 0xb /* edx is fixed */) )
972 if ( uLeaf == 0xb
987 if (uLeaf == 0x4)
989 else if (uLeaf == 0x7)
991 else if (uLeaf == 0xf)
995 *pfFinalEcxUnchanged = auCur[2] == uSubLeaf && uLeaf == 0xb;
1010 *pfFinalEcxUnchanged = auCur[2] == uSubLeaf && uLeaf == 0xb;
1024 * @param uLeaf The leaf to locate.
1027 VMMR3DECL(int) CPUMR3CpuIdGetLeaf(PVM pVM, PCPUMCPUIDLEAF pLeaf, uint32_t uLeaf, uint32_t uSubLeaf)
1030 uLeaf, uSubLeaf);
1061 if ( pNewLeaf->uLeaf == UINT32_C(0x00000000) /* Standard */
1062 || pNewLeaf->uLeaf == UINT32_C(0x00000001)
1063 || pNewLeaf->uLeaf == UINT32_C(0x80000000) /* Extended */
1064 || pNewLeaf->uLeaf == UINT32_C(0x80000001)
1065 || pNewLeaf->uLeaf == UINT32_C(0xc0000000) /* Centaur */
1066 || pNewLeaf->uLeaf == UINT32_C(0xc0000001) )
1116 uint32_t uLeaf = s_aCandidates[iOuter].uMsr;
1118 ASMCpuIdExSlow(uLeaf, 0, 0, 0, &uEax, &uEbx, &uEcx, &uEdx);
1123 if ( uEax > uLeaf
1124 && uEax - uLeaf < UINT32_C(0xff)) /* Adjust 0xff limit when exceeded by real HW. */
1127 uint32_t cLeaves = uEax - uLeaf + 1;
1130 ASMCpuIdExSlow(uLeaf, 0, 0, 0, &uEax, &uEbx, &uEcx, &uEdx);
1136 if (uLeaf == 1)
1138 else if (uLeaf == 0xb && uEcx != 0)
1140 else if ( uLeaf == UINT32_C(0x8000001e)
1152 if ( cpumR3IsEcxRelevantForCpuIdLeaf(uLeaf, &cSubLeaves, &fFinalEcxUnchanged)
1153 && cpumR3IsEcxRelevantForCpuIdLeaf(uLeaf, &cSubLeaves, &fFinalEcxUnchanged)
1154 && cpumR3IsEcxRelevantForCpuIdLeaf(uLeaf, &cSubLeaves, &fFinalEcxUnchanged))
1160 LogRel(("CPUM: VERR_CPUM_TOO_MANY_CPUID_SUBLEAVES! uLeaf=%#x cSubLeaves=%#x\n", uLeaf, cSubLeaves));
1165 ASMCpuIdExSlow(uLeaf, 0, uSubLeaf, 0, &auTmp[0], &auTmp[1], &auTmp[2], &auTmp[3]);
1167 uLeaf, uSubLeaf, auTmp[0], auTmp[1], auTmp[2], auTmp[3]));
1172 (*ppaLeaves)[i].uLeaf, (*ppaLeaves)[i].uSubLeaf, (*ppaLeaves)[i].fSubLeafMask,
1183 ASMCpuIdExSlow(uLeaf, 0, uSubLeaf, 0, &uEax, &uEbx, &uEcx, &uEdx);
1185 uLeaf, uSubLeaf, UINT32_MAX, uEax, uEbx, uEcx, uEdx, fFlags);
1193 uLeaf, 0, 0, uEax, uEbx, uEcx, uEdx, fFlags);
1199 uLeaf++;
1209 if (uLeaf == 0x8ffffffe && uEax == UINT32_C(0x00494544))
1211 else if ( uLeaf == 0x8fffffff
1232 uLeaf, 0, 0, uEax, uEbx, uEcx, uEdx, 0);
1371 uint32_t const uLeaf = auChecks[cChecks - 1];
1377 ASMCpuIdExSlow(uLeaf, uValue, uValue, uValue, &auCur[0], &auCur[1], &auCur[2], &auCur[3]);
1378 if ( auCur[0] != uLeaf
1489 static PCCPUMCPUIDLEAF cpumR3CpuIdFindLeaf(PCCPUMCPUIDLEAF paLeaves, uint32_t cLeaves, uint32_t uLeaf)
1495 if (pLeaf->uLeaf == uLeaf)
1503 static PCCPUMCPUIDLEAF cpumR3CpuIdFindLeafEx(PCCPUMCPUIDLEAF paLeaves, uint32_t cLeaves, uint32_t uLeaf, uint32_t uSubLeaf)
1505 PCCPUMCPUIDLEAF pLeaf = cpumR3CpuIdFindLeaf(paLeaves, cLeaves, uLeaf);
1513 && pLeaf->uLeaf == uLeaf)
1529 AssertLogRelReturn(paLeaves[0].uLeaf == 0, VERR_CPUM_IPE_1);
1530 AssertLogRelReturn(paLeaves[1].uLeaf == 1, VERR_CPUM_IPE_1);
1688 * @param uLeaf The leaf to locate.
1691 static PCPUMCPUIDLEAF cpumR3CpuIdGetExactLeaf(PCPUM pCpum, uint32_t uLeaf, uint32_t uSubLeaf)
1693 uint64_t uNeedle = RT_MAKE_U64(uSubLeaf, uLeaf);
1702 uint64_t const uCur = RT_MAKE_U64(paLeaves[i].uSubLeaf, paLeaves[i].uLeaf);
1827 uint32_t uLeaf;
1828 rc = CFGMR3QueryU32(pNode, "Leaf", &uLeaf);
1831 rc = RTStrToUInt32Full(szName, 16, &uLeaf);
1857 PCCPUMCPUIDLEAF pLeaf = cpumR3CpuIdGetExactLeaf(&pVM->cpum.s, uLeaf, uSubLeaf);
1863 Leaf.uLeaf = uLeaf;
2014 && pCpum->GuestInfo.paCpuIdLeavesR3[0].uLeaf <= UINT32_C(0xff))
2017 && pCpum->GuestInfo.paCpuIdLeavesR3[i + 1].uLeaf <= UINT32_C(0xff))
2058 uint32_t uLeaf = aOldRanges[i].uBase + cLeft;
2062 uLeaf--;
2065 PCCPUMCPUIDLEAF pLeaf = cpumR3CpuIdGetExactLeaf(pCpum, uLeaf, 0 /* uSubLeaf */);
2156 NewLeaf.uLeaf = UINT32_C(0x40000000);
2167 NewLeaf.uLeaf = UINT32_C(0x40000001);
2322 * @param uLeaf The leaf to clear.
2324 static void cpumR3CpuIdZeroLeaf(PCPUM pCpum, uint32_t uLeaf)
2328 while ((pCurLeaf = cpumR3CpuIdGetExactLeaf(pCpum, uLeaf, uSubLeaf)) != NULL)
3238 for (uint32_t uLeaf = UINT32_C(0x8000000b); uLeaf <= UINT32_C(0x80000018); uLeaf++)
3239 cpumR3CpuIdZeroLeaf(pCpum, uLeaf);
3998 NewLeaf.uLeaf = uBase + i;
4061 || Leaf.uLeaf >= uPrev)
4064 uPrev = Leaf.uLeaf;
4100 Leaf.uLeaf = 4;
5291 Assert(pCurLeaf); Assert(pCurLeaf->uLeaf == 1);
5343 Assert(pCurLeaf); Assert(pCurLeaf->uLeaf == 7);
5348 ASMCpuIdExSlow(pCurLeaf->uLeaf, 0, pCurLeaf->uSubLeaf, 0, &Host.uEax, &Host.uEbx, &Host.uEcx, &Host.uEdx);
5381 || pCurLeaf->uLeaf != 0x7)
5399 Assert(pCurLeaf); Assert(pCurLeaf->uLeaf == 13);
5473 && pCurLeaf->uLeaf == UINT32_C(0x0000000d))
5476 || pCurLeaf->uLeaf != UINT32_C(0x0000000d))
5487 && pCurLeaf->uLeaf <= uUpToLeaf)
5493 && pCurLeaf->uLeaf <= uUpToLeaf)
5496 ASMCpuIdExSlow(pCurLeaf->uLeaf, 0, pCurLeaf->uSubLeaf, 0, &Host.uEax, &Host.uEbx, &Host.uEcx, &Host.uEdx);
5500 pCurLeaf->uLeaf, pCurLeaf->uSubLeaf, pCurLeaf->uEax, pCurLeaf->uEbx, pCurLeaf->uEcx, pCurLeaf->uEdx,
5532 uint32_t uLeaf;
5546 uint32_t cGstMax = paLeaves[0].uLeaf == 0 ? paLeaves[0].uEax : 0;
5551 for (uLeaf = 0, pCurLeaf = paLeaves; uLeaf <= cMax; uLeaf++)
5554 if (uLeaf == 4 || uLeaf == 7 || uLeaf == 0xb)
5556 else if (uLeaf == 0xd)
5561 ASMCpuIdExSlow(uLeaf, 0, uSubLeaf, 0, &Host.uEax, &Host.uEbx, &Host.uEcx, &Host.uEdx);
5563 && pCurLeaf->uLeaf == uLeaf
5569 uLeaf, uSubLeaf, pCurLeaf->uEax, pCurLeaf->uEbx, pCurLeaf->uEcx, pCurLeaf->uEdx,
5573 else if ( uLeaf != 0xd
5578 uLeaf, uSubLeaf, Host.uEax, Host.uEbx, Host.uEcx, Host.uEdx);
5582 || pCurLeaf->uLeaf != uLeaf)
5583 && ( (uLeaf == 0x4 && ((Host.uEax & 0x000f) == 0 || (Host.uEax & 0x000f) >= 8))
5584 || (uLeaf == 0x7 && Host.uEax == 0)
5585 || (uLeaf == 0xb && ((Host.uEcx & 0xff00) == 0 || (Host.uEcx & 0xff00) >= 8))
5586 || (uLeaf == 0xb && (Host.uEcx & 0xff) != uSubLeaf)
5587 || (uLeaf == 0xd && uSubLeaf >= 128)
5598 if (iVerbosity && paLeaves[0].uLeaf == 0)
5627 cGstMax = (uintptr_t)(pCurLeaf - paLeaves) < cLeaves && pCurLeaf->uLeaf == UINT32_C(0x40000000)
5648 cGstMax = (uintptr_t)(pCurLeaf - paLeaves) < cLeaves && pCurLeaf->uLeaf == UINT32_C(0x80000000)
5658 for (uLeaf = UINT32_C(0x80000000); uLeaf <= cMax; uLeaf++)
5661 if (uLeaf == UINT32_C(0x8000001d))
5666 ASMCpuIdExSlow(uLeaf, 0, uSubLeaf, 0, &Host.uEax, &Host.uEbx, &Host.uEcx, &Host.uEdx);
5668 && pCurLeaf->uLeaf == uLeaf
5674 uLeaf, uSubLeaf, pCurLeaf->uEax, pCurLeaf->uEbx, pCurLeaf->uEcx, pCurLeaf->uEdx,
5678 else if ( uLeaf != 0xd
5683 uLeaf, uSubLeaf, Host.uEax, Host.uEbx, Host.uEcx, Host.uEdx);
5687 || pCurLeaf->uLeaf != uLeaf)
5688 && (uLeaf == UINT32_C(0x8000001d) && ((Host.uEax & 0x000f) == 0 || (Host.uEax & 0x000f) >= 8)) )
5883 cGstMax = (uintptr_t)(pCurLeaf - paLeaves) < cLeaves && pCurLeaf->uLeaf == UINT32_C(0xc0000000)