Changeset 12213 in vbox for trunk/src/VBox/Frontends/VirtualBox4
- Timestamp:
- Sep 8, 2008 9:52:30 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 36191
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsGeneral.cpp
r11497 r12213 24 24 #include "VBoxGlobal.h" 25 25 #include "VBoxProblemReporter.h" 26 #include <iprt/asm.h> 27 #include <VBox/x86.h> 26 28 27 29 #include <QDir> … … 203 205 mCbApic->setChecked (biosSettings.GetIOAPICEnabled()); 204 206 207 /* 208 * Check for VT-x and AMD-V capabilities. 209 * This is a best effort check. A full check requires ring-0 access (msrs). 210 */ 211 bool fVTxAMDVSupported = false; 212 bool fPAESupported = false; 213 214 if (ASMHasCpuId()) 215 { 216 uint32_t u32FeaturesECX; 217 uint32_t u32Dummy; 218 uint32_t u32FeaturesEDX; 219 uint32_t u32VendorEBX, u32VendorECX, u32VendorEDX, u32AMDFeatureEDX, u32AMDFeatureECX; 220 221 ASMCpuId(0, &u32Dummy, &u32VendorEBX, &u32VendorECX, &u32VendorEDX); 222 ASMCpuId(1, &u32Dummy, &u32Dummy, &u32FeaturesECX, &u32FeaturesEDX); 223 /* Query AMD features. */ 224 ASMCpuId(0x80000001, &u32Dummy, &u32Dummy, &u32AMDFeatureECX, &u32AMDFeatureEDX); 225 226 fPAESupported = !!(u32FeaturesEDX & X86_CPUID_FEATURE_EDX_PAE); 227 228 if ( u32VendorEBX == X86_CPUID_VENDOR_INTEL_EBX 229 && u32VendorECX == X86_CPUID_VENDOR_INTEL_ECX 230 && u32VendorEDX == X86_CPUID_VENDOR_INTEL_EDX 231 ) 232 { 233 if ( (u32FeaturesECX & X86_CPUID_FEATURE_ECX_VMX) 234 && (u32FeaturesEDX & X86_CPUID_FEATURE_EDX_MSR) 235 && (u32FeaturesEDX & X86_CPUID_FEATURE_EDX_FXSR) 236 ) 237 { 238 fVTxAMDVSupported = true; 239 } 240 } 241 else 242 if ( u32VendorEBX == X86_CPUID_VENDOR_AMD_EBX 243 && u32VendorECX == X86_CPUID_VENDOR_AMD_ECX 244 && u32VendorEDX == X86_CPUID_VENDOR_AMD_EDX 245 ) 246 { 247 if ( (u32AMDFeatureECX & X86_CPUID_AMD_FEATURE_ECX_SVM) 248 && (u32FeaturesEDX & X86_CPUID_FEATURE_EDX_MSR) 249 && (u32FeaturesEDX & X86_CPUID_FEATURE_EDX_FXSR) 250 ) 251 { 252 fVTxAMDVSupported = true; 253 } 254 } 255 } 256 #ifdef Q_WS_MAC 257 /* Not currently available on the Mac. */ 258 fVTxAMDVSupported = false; 259 #endif 260 mCbVirt->setEnabled(fVTxAMDVSupported); 261 205 262 /* VT-x/AMD-V */ 206 263 aMachine.GetHWVirtExEnabled() == KTSBool_True ? … … 209 266 210 267 /* PAE/NX */ 268 mCbPae->setEnabled(fPAESupported); 211 269 mCbPae->setChecked (aMachine.GetPAEEnabled()); 212 270
Note:
See TracChangeset
for help on using the changeset viewer.