Changeset 55862 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- May 14, 2015 6:14:39 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
r55740 r55862 3094 3094 pCurLeaf->uEax &= RT_LO_U32(fGuestXcr0Mask); 3095 3095 pCurLeaf->uEdx &= RT_HI_U32(fGuestXcr0Mask); 3096 AssertLogRelMsgReturn((pCurLeaf->uEax & (XSAVE_C_X87 | XSAVE_C_SSE)) == (XSAVE_C_X87 | XSAVE_C_SSE), 3097 ("CPUID(0xd/0).EAX missing mandatory X87 or SSE bits: %#RX32", pCurLeaf->uEax), 3098 VERR_CPUM_IPE_1); 3096 3099 cbXSaveMax = pCurLeaf->uEcx; 3097 3100 AssertLogRelMsgReturn(cbXSaveMax <= CPUM_MAX_XSAVE_AREA_SIZE && cbXSaveMax >= CPUM_MIN_XSAVE_AREA_SIZE, … … 4852 4855 * EDX - Reserved, but is set to zero if invalid sub-leaf index. 4853 4856 */ 4857 uint64_t fGuestXcr0Mask = 0; 4854 4858 PCPUMCPUIDLEAF pCurLeaf = cpumR3CpuIdGetLeaf(paLeaves, cLeaves, UINT32_C(0x0000000d), 0); 4855 4859 if ( pCurLeaf … … 4860 4864 || pCurLeaf->uEdx) ) 4861 4865 { 4862 uint64_tfGuestXcr0Mask = RT_MAKE_U64(pCurLeaf->uEax, pCurLeaf->uEdx);4866 fGuestXcr0Mask = RT_MAKE_U64(pCurLeaf->uEax, pCurLeaf->uEdx); 4863 4867 if (fGuestXcr0Mask & ~pVM->cpum.s.fXStateHostMask) 4864 4868 return SSMR3SetLoadError(pSSM, VERR_SSM_LOAD_CPUID_MISMATCH, RT_SRC_POS, 4865 4869 N_("CPUID(0xd/0).EDX:EAX mismatch: %#llx saved, %#llx supported by the current host (XCR0 bits)"), 4866 4870 fGuestXcr0Mask, pVM->cpum.s.fXStateHostMask); 4871 if ((fGuestXcr0Mask & (XSAVE_C_X87 | XSAVE_C_SSE)) != (XSAVE_C_X87 | XSAVE_C_SSE)) 4872 return SSMR3SetLoadError(pSSM, VERR_SSM_LOAD_CPUID_MISMATCH, RT_SRC_POS, 4873 N_("CPUID(0xd/0).EDX:EAX missing mandatory X87 or SSE bits: %#RX64"), fGuestXcr0Mask); 4867 4874 4868 4875 /* We don't support any additional features yet. */ … … 4876 4883 RT_MAKE_U64(pCurLeaf->uEdx, pCurLeaf->uEcx)); 4877 4884 4878 4879 if (pVM->cpum.s.fXStateGuestMask != fGuestXcr0Mask)4880 {4881 LogRel(("CPUM: fXStateGuestMask=%#lx -> %#llx\n", pVM->cpum.s.fXStateGuestMask, fGuestXcr0Mask));4882 pVM->cpum.s.fXStateGuestMask = fGuestXcr0Mask;4883 }4884 4885 4885 4886 for (uint32_t uSubLeaf = 2; uSubLeaf < 64; uSubLeaf++) … … 4902 4903 } 4903 4904 } 4905 } 4906 /* Clear leaf 0xd just in case we're loading an old state... */ 4907 else if (pCurLeaf) 4908 { 4909 AssertLogRel(uVersion <= CPUM_SAVED_STATE_VERSION_PUT_STRUCT); 4910 for (uint32_t uSubLeaf = 0; uSubLeaf < 64; uSubLeaf++) 4911 { 4912 pCurLeaf = cpumR3CpuIdGetLeaf(paLeaves, cLeaves, UINT32_C(0x0000000d), uSubLeaf); 4913 if (pCurLeaf) 4914 pCurLeaf->uEax = pCurLeaf->uEbx = pCurLeaf->uEcx = pCurLeaf->uEdx = 0; 4915 } 4916 } 4917 4918 /* Update the fXStateGuestMask value for the VM. */ 4919 if (pVM->cpum.s.fXStateGuestMask != fGuestXcr0Mask) 4920 { 4921 LogRel(("CPUM: fXStateGuestMask=%#llx -> %#llx\n", pVM->cpum.s.fXStateGuestMask, fGuestXcr0Mask)); 4922 pVM->cpum.s.fXStateGuestMask = fGuestXcr0Mask; 4923 if (!fGuestXcr0Mask && (aGuestCpuIdStd[1].uEcx & X86_CPUID_FEATURE_ECX_XSAVE)) 4924 return SSMR3SetLoadError(pSSM, VERR_SSM_LOAD_CPUID_MISMATCH, RT_SRC_POS, 4925 N_("Internal Processing Error: XSAVE feature bit enabled, but leaf 0xd is empty.")); 4904 4926 } 4905 4927
Note:
See TracChangeset
for help on using the changeset viewer.