Changeset 79830 in vbox
- Timestamp:
- Jul 17, 2019 8:41:41 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
r79806 r79830 3741 3741 * EDX - SVM Feature identification. 3742 3742 */ 3743 pExtFeatureLeaf = cpumR3CpuIdGetExactLeaf(pCpum, UINT32_C(0x80000001), 0); 3744 if ( pExtFeatureLeaf 3745 && (pExtFeatureLeaf->uEcx & X86_CPUID_AMD_FEATURE_ECX_SVM) 3746 && pCpum->GuestFeatures.enmCpuVendor == CPUMCPUVENDOR_AMD) 3747 { 3748 PCPUMCPUIDLEAF pSvmFeatureLeaf = cpumR3CpuIdGetExactLeaf(pCpum, 0x8000000a, 0); 3749 if (pSvmFeatureLeaf) 3750 { 3751 pSvmFeatureLeaf->uEax = 0x1; 3752 pSvmFeatureLeaf->uEbx = 0x8000; /** @todo figure out virtual NASID. */ 3753 pSvmFeatureLeaf->uEcx = 0; 3754 pSvmFeatureLeaf->uEdx &= ( X86_CPUID_SVM_FEATURE_EDX_NRIP_SAVE /** @todo Support other SVM features */ 3755 | X86_CPUID_SVM_FEATURE_EDX_FLUSH_BY_ASID 3756 | X86_CPUID_SVM_FEATURE_EDX_DECODE_ASSISTS); 3743 if (pCpum->GuestFeatures.enmCpuVendor == CPUMCPUVENDOR_AMD) 3744 { 3745 pExtFeatureLeaf = cpumR3CpuIdGetExactLeaf(pCpum, UINT32_C(0x80000001), 0); 3746 if ( pExtFeatureLeaf 3747 && (pExtFeatureLeaf->uEcx & X86_CPUID_AMD_FEATURE_ECX_SVM)) 3748 { 3749 PCPUMCPUIDLEAF pSvmFeatureLeaf = cpumR3CpuIdGetExactLeaf(pCpum, 0x8000000a, 0); 3750 if (pSvmFeatureLeaf) 3751 { 3752 pSvmFeatureLeaf->uEax = 0x1; 3753 pSvmFeatureLeaf->uEbx = 0x8000; /** @todo figure out virtual NASID. */ 3754 pSvmFeatureLeaf->uEcx = 0; 3755 pSvmFeatureLeaf->uEdx &= ( X86_CPUID_SVM_FEATURE_EDX_NRIP_SAVE /** @todo Support other SVM features */ 3756 | X86_CPUID_SVM_FEATURE_EDX_FLUSH_BY_ASID 3757 | X86_CPUID_SVM_FEATURE_EDX_DECODE_ASSISTS); 3758 } 3759 else 3760 { 3761 /* Should never happen. */ 3762 LogRel(("CPUM: Warning! Expected CPUID leaf 0x8000000a not present! SVM features not exposed to the guest\n")); 3763 cpumR3CpuIdZeroLeaf(pCpum, UINT32_C(0x8000000a)); 3764 } 3757 3765 } 3758 3766 else 3759 3767 { 3760 LogRel(("CPUM: Warning! Expected CPUID leaf 0x8000000a not present! SVM features not exposed to the guest\n"));3768 /* If SVM is not supported, this is reserved, zero out. */ 3761 3769 cpumR3CpuIdZeroLeaf(pCpum, UINT32_C(0x8000000a)); 3762 3770 } 3771 } 3772 else 3773 { 3774 /* Cpuid 0x8000000a: Reserved on Intel. 3775 * We zero this since we don't know what it may have been used for. 3776 */ 3777 cpumR3CpuIdZeroLeaf(pCpum, UINT32_C(0x8000000a)); 3763 3778 } 3764 3779
Note:
See TracChangeset
for help on using the changeset viewer.