Changeset 25931 in vbox
- Timestamp:
- Jan 20, 2010 2:05:01 PM (15 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/HWACCM.cpp
r25929 r25931 46 46 #include <iprt/asm.h> 47 47 #include <iprt/string.h> 48 #include <iprt/env.h> 48 49 #include <iprt/thread.h> 49 50 … … 653 654 int rc; 654 655 656 /* Hack to allow users to work around broken BIOSes that incorrectly set EFER.SVME, which makes us believe somebody else 657 * is already using AMD-V. 658 */ 659 if ( !pVM->hwaccm.s.vmx.fSupported 660 && !pVM->hwaccm.s.svm.fSupported 661 && pVM->hwaccm.s.lLastError == VERR_SVM_IN_USE /* implies functional AMD-V */ 662 && RTEnvGet("VBOX_HWVIRTEX_IGNORE_SVM_IN_USE")) 663 { 664 LogRel(("HWACCM: VBOX_HWVIRTEX_IGNORE_SVM_IN_USE active!\n")); 665 pVM->hwaccm.s.svm.fSupported = true; 666 pVM->hwaccm.s.svm.fIgnoreInUseError = true; 667 } 668 else 655 669 if ( !pVM->hwaccm.s.vmx.fSupported 656 670 && !pVM->hwaccm.s.svm.fSupported) … … 658 672 LogRel(("HWACCM: No VT-x or AMD-V CPU extension found. Reason %Rrc\n", pVM->hwaccm.s.lLastError)); 659 673 LogRel(("HWACCM: VMX MSR_IA32_FEATURE_CONTROL=%RX64\n", pVM->hwaccm.s.vmx.msr.feature_ctrl)); 674 660 675 if (VMMIsHwVirtExtForced(pVM)) 661 676 { -
trunk/src/VBox/VMM/HWACCMInternal.h
r25387 r25931 173 173 /** Configured for VT-x or AMD-V. */ 174 174 bool fConfigured; 175 176 /** Set if the VBOX_HWVIRTEX_IGNORE_SVM_IN_USE hack is active. */ 177 bool fIgnoreAMDVInUseError; 175 178 176 179 /** In use by our code. (for power suspend) */ … … 413 416 /** Set if erratum 170 affects the AMD cpu. */ 414 417 bool fAlwaysFlushTLB; 415 bool u8Alignment; 418 /** Set when the hack to ignore VERR_SVM_IN_USE is active. */ 419 bool fIgnoreInUseError; 416 420 417 421 /** R0 memory object for the IO bitmap (12kb). */ -
trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
r25226 r25931 149 149 VMMR0DECL(int) HWACCMR0Init(void) 150 150 { 151 int rc; 151 int rc; 152 bool fAMDVPresent = false; 152 153 153 154 memset(&HWACCMR0Globals, 0, sizeof(HWACCMR0Globals)); … … 354 355 RTCPUID idCpu = 0; 355 356 357 fAMDVPresent = true; 358 359 /* Query AMD features. */ 360 ASMCpuId(0x8000000A, &HWACCMR0Globals.svm.u32Rev, &HWACCMR0Globals.uMaxASID, &u32Dummy, &HWACCMR0Globals.svm.u32Features); 361 356 362 /* We need to check if AMD-V has been properly initialized on all CPUs. Some BIOSes might do a poor job. */ 357 363 memset(aRc, 0, sizeof(aRc)); … … 368 374 if (RT_SUCCESS(rc)) 369 375 { 370 /* Query AMD features. */371 ASMCpuId(0x8000000A, &HWACCMR0Globals.svm.u32Rev, &HWACCMR0Globals.uMaxASID, &u32Dummy, &HWACCMR0Globals.svm.u32Features);372 376 /* Read the HWCR msr for diagnostics. */ 373 377 HWACCMR0Globals.svm.msrHWCR = ASMRdMsr(MSR_K8_HWCR); … … 400 404 } 401 405 else 402 if ( HWACCMR0Globals.svm.fSupported)406 if (fAMDVPresent) 403 407 { 404 408 HWACCMR0Globals.pfnEnterSession = SVMR0Enter; -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r25914 r25931 78 78 uint64_t val = ASMRdMsr(MSR_K6_EFER); 79 79 if (val & MSR_K6_EFER_SVME) 80 return VERR_SVM_IN_USE; 80 { 81 /* If the VBOX_HWVIRTEX_IGNORE_SVM_IN_USE hack is active, then we blindly use AMD-V. */ 82 if ( pVM 83 && pVM->hwaccm.s.svm.fIgnoreInUseError) 84 { 85 pCpu->fIgnoreAMDVInUseError = true; 86 } 87 88 if (!pCpu->fIgnoreAMDVInUseError) 89 return VERR_SVM_IN_USE; 90 } 81 91 82 92 /* Turn on AMD-V in the EFER MSR. */
Note:
See TracChangeset
for help on using the changeset viewer.