Changeset 49182 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Oct 18, 2013 2:14:27 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 90059
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r49019 r49182 550 550 static void cpumR3CheckLeakyFpu(PVM pVM) 551 551 { 552 uint32_t u32CpuVersion; 553 uint32_t u32Dummy; 554 ASMCpuId(1, &u32CpuVersion, &u32Dummy, &u32Dummy, &u32Dummy); 552 uint32_t u32CpuVersion = ASMCpuId_EAX(1); 555 553 uint32_t const u32Family = u32CpuVersion >> 8; 556 554 if ( u32Family >= 6 /* K7 and higher */ 557 555 && ASMIsAmdCpu()) 558 556 { 559 uint32_t cExt = 0; 560 ASMCpuId(0x80000000, &cExt, &u32Dummy, &u32Dummy, &u32Dummy); 557 uint32_t cExt = ASMCpuId_EAX(0x80000000); 561 558 if (ASMIsValidExtRange(cExt)) 562 559 { … … 810 807 /* Using the ECX variant for all of them can't hurt... */ 811 808 for (uint32_t i = 0; i < cLeaves; i++) 812 ASMCpuId _Idx_ECX(uStart + i, 0, &paLeaves[i].eax, &paLeaves[i].ebx, &paLeaves[i].ecx, &paLeaves[i].edx);809 ASMCpuIdExSlow(uStart + i, 0, 0, 0, &paLeaves[i].eax, &paLeaves[i].ebx, &paLeaves[i].ecx, &paLeaves[i].edx); 813 810 814 811 /* Load CPUID leaf override; we currently don't care if the user … … 891 888 * perhaps some random garbage, we don't try to duplicate this behavior. 892 889 */ 893 ASMCpuId (pCPUM->aGuestCpuIdStd[0].eax + 10, /** @todo r=bird: Use the host value here in case of overrides and more than 10 leaves being stripped already. */894 &pCPUM->GuestCpuIdDef.eax, &pCPUM->GuestCpuIdDef.ebx,895 &pCPUM->GuestCpuIdDef.ecx, &pCPUM->GuestCpuIdDef.edx);890 ASMCpuIdExSlow(pCPUM->aGuestCpuIdStd[0].eax + 10, 0, 0, 0, /** @todo r=bird: Use the host value here in case of overrides and more than 10 leaves being stripped already. */ 891 &pCPUM->GuestCpuIdDef.eax, &pCPUM->GuestCpuIdDef.ebx, 892 &pCPUM->GuestCpuIdDef.ecx, &pCPUM->GuestCpuIdDef.edx); 896 893 897 894 /** @cfgm{/CPUM/CMPXCHG16B, boolean, false} … … 1719 1716 CPUMCPUID aRawStd[16]; 1720 1717 for (unsigned i = 0; i < RT_ELEMENTS(aRawStd); i++) 1721 ASMCpuId (i, &aRawStd[i].eax, &aRawStd[i].ebx, &aRawStd[i].ecx, &aRawStd[i].edx);1718 ASMCpuIdExSlow(i, 0, 0, 0, &aRawStd[i].eax, &aRawStd[i].ebx, &aRawStd[i].ecx, &aRawStd[i].edx); 1722 1719 SSMR3PutU32(pSSM, RT_ELEMENTS(aRawStd)); 1723 1720 SSMR3PutMem(pSSM, &aRawStd[0], sizeof(aRawStd)); … … 1725 1722 CPUMCPUID aRawExt[32]; 1726 1723 for (unsigned i = 0; i < RT_ELEMENTS(aRawExt); i++) 1727 ASMCpuId (i | UINT32_C(0x80000000), &aRawExt[i].eax, &aRawExt[i].ebx, &aRawExt[i].ecx, &aRawExt[i].edx);1724 ASMCpuIdExSlow(i | UINT32_C(0x80000000), 0, 0, 0, &aRawExt[i].eax, &aRawExt[i].ebx, &aRawExt[i].ecx, &aRawExt[i].edx); 1728 1725 SSMR3PutU32(pSSM, RT_ELEMENTS(aRawExt)); 1729 1726 SSMR3PutMem(pSSM, &aRawExt[0], sizeof(aRawExt)); … … 1980 1977 1981 1978 for (uint32_t i = cRawStd; i < RT_ELEMENTS(aRawStd); i++) 1982 ASMCpuId (i, &aRawStd[i].eax, &aRawStd[i].ebx, &aRawStd[i].ecx, &aRawStd[i].edx);1979 ASMCpuIdExSlow(i, 0, 0, 0, &aRawStd[i].eax, &aRawStd[i].ebx, &aRawStd[i].ecx, &aRawStd[i].edx); 1983 1980 1984 1981 for (uint32_t i = cRawExt; i < RT_ELEMENTS(aRawExt); i++) 1985 ASMCpuId (i | UINT32_C(0x80000000), &aRawExt[i].eax, &aRawExt[i].ebx, &aRawExt[i].ecx, &aRawExt[i].edx);1982 ASMCpuIdExSlow(i | UINT32_C(0x80000000), 0, 0, 0, &aRawExt[i].eax, &aRawExt[i].ebx, &aRawExt[i].ecx, &aRawExt[i].edx); 1986 1983 1987 1984 /* … … 1990 1987 CPUMCPUID aHostRawStd[16]; 1991 1988 for (unsigned i = 0; i < RT_ELEMENTS(aHostRawStd); i++) 1992 ASMCpuId (i, &aHostRawStd[i].eax, &aHostRawStd[i].ebx, &aHostRawStd[i].ecx, &aHostRawStd[i].edx);1989 ASMCpuIdExSlow(i, 0, 0, 0, &aHostRawStd[i].eax, &aHostRawStd[i].ebx, &aHostRawStd[i].ecx, &aHostRawStd[i].edx); 1993 1990 1994 1991 CPUMCPUID aHostRawExt[32]; 1995 1992 for (unsigned i = 0; i < RT_ELEMENTS(aHostRawExt); i++) 1996 ASMCpuId(i | UINT32_C(0x80000000), &aHostRawExt[i].eax, &aHostRawExt[i].ebx, &aHostRawExt[i].ecx, &aHostRawExt[i].edx); 1993 ASMCpuIdExSlow(i | UINT32_C(0x80000000), 0, 0, 0, 1994 &aHostRawExt[i].eax, &aHostRawExt[i].ebx, &aHostRawExt[i].ecx, &aHostRawExt[i].edx); 1997 1995 1998 1996 /* … … 2700 2698 /** @todo we should check the 64 bits capabilities too! */ 2701 2699 uint32_t au32CpuId[8] = {0,0,0,0, 0,0,0,0}; 2702 ASMCpuId (0, &au32CpuId[0], &au32CpuId[1], &au32CpuId[2], &au32CpuId[3]);2703 ASMCpuId (1, &au32CpuId[4], &au32CpuId[5], &au32CpuId[6], &au32CpuId[7]);2700 ASMCpuIdExSlow(0, 0, 0, 0, &au32CpuId[0], &au32CpuId[1], &au32CpuId[2], &au32CpuId[3]); 2701 ASMCpuIdExSlow(1, 0, 0, 0, &au32CpuId[4], &au32CpuId[5], &au32CpuId[6], &au32CpuId[7]); 2704 2702 uint32_t au32CpuIdSaved[8]; 2705 2703 rc = SSMR3GetMem(pSSM, &au32CpuIdSaved[0], sizeof(au32CpuIdSaved)); … … 3385 3383 uint32_t cStdHstMax; 3386 3384 uint32_t dummy; 3387 ASMCpuId _Idx_ECX(0, 0, &cStdHstMax, &dummy, &dummy, &dummy);3385 ASMCpuIdExSlow(0, 0, 0, 0, &cStdHstMax, &dummy, &dummy, &dummy); 3388 3386 3389 3387 unsigned cStdLstMax = RT_MAX(RT_ELEMENTS(pVM->cpum.s.aGuestCpuIdStd), cStdHstMax); … … 3397 3395 { 3398 3396 Guest = pVM->cpum.s.aGuestCpuIdStd[i]; 3399 ASMCpuId _Idx_ECX(i, 0, &Host.eax, &Host.ebx, &Host.ecx, &Host.edx);3397 ASMCpuIdExSlow(i, 0, 0, 0, &Host.eax, &Host.ebx, &Host.ecx, &Host.edx); 3400 3398 3401 3399 pHlp->pfnPrintf(pHlp, … … 3408 3406 else 3409 3407 { 3410 ASMCpuId _Idx_ECX(i, 0, &Host.eax, &Host.ebx, &Host.ecx, &Host.edx);3408 ASMCpuIdExSlow(i, 0, 0, 0, &Host.eax, &Host.ebx, &Host.ecx, &Host.edx); 3411 3409 3412 3410 pHlp->pfnPrintf(pHlp, … … 3534 3532 else 3535 3533 { 3536 ASMCpuId (1, &Host.eax, &Host.ebx, &Host.ecx, &Host.edx);3534 ASMCpuIdExSlow(1, 0, 0, 0, &Host.eax, &Host.ebx, &Host.ecx, &Host.edx); 3537 3535 3538 3536 X86CPUIDFEATEDX EdxHost = *(PX86CPUIDFEATEDX)&Host.edx; … … 3626 3624 { 3627 3625 Guest = pVM->cpum.s.aGuestCpuIdExt[i]; 3628 ASMCpuId (0x80000000 | i, &Host.eax, &Host.ebx, &Host.ecx, &Host.edx);3626 ASMCpuIdExSlow(0x80000000 | i, 0, 0, 0, &Host.eax, &Host.ebx, &Host.ecx, &Host.edx); 3629 3627 3630 3628 pHlp->pfnPrintf(pHlp, … … 3723 3721 else 3724 3722 { 3725 ASMCpuId (0x80000001, &Host.eax, &Host.ebx, &Host.ecx, &Host.edx);3723 ASMCpuIdExSlow(0x80000001, 0, 0, 0, &Host.eax, &Host.ebx, &Host.ecx, &Host.edx); 3726 3724 3727 3725 uint32_t uEdxGst = Guest.edx; … … 3918 3916 { 3919 3917 Guest = pVM->cpum.s.aGuestCpuIdCentaur[i]; 3920 ASMCpuId (0xc0000000 | i, &Host.eax, &Host.ebx, &Host.ecx, &Host.edx);3918 ASMCpuIdExSlow(0xc0000000 | i, 0, 0, 0, &Host.eax, &Host.ebx, &Host.ecx, &Host.edx); 3921 3919 3922 3920 pHlp->pfnPrintf(pHlp, … … 3941 3939 if (iVerbosity && cCentaurMax >= 1) 3942 3940 { 3943 ASMCpuId (0xc0000001, &Host.eax, &Host.ebx, &Host.ecx, &Host.edx);3941 ASMCpuIdExSlow(0xc0000001, 0, 0, 0, &Host.eax, &Host.ebx, &Host.ecx, &Host.edx); 3944 3942 uint32_t uEdxGst = pVM->cpum.s.aGuestCpuIdExt[1].edx; 3945 3943 uint32_t uEdxHst = Host.edx;
Note:
See TracChangeset
for help on using the changeset viewer.