Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 62b86c0

Browse files
committed
VMM/HM: bugref:9918 Fix propagating HMR0 initialization error to ring-3, prevents ambiguous VERR_NOT_SUPPORTED guru when VT-x/AMD-V is exclusively grabbed by another hypervisor.
svn:sync-xref-src-repo-rev: r170335
1 parent 745e134 commit 62b86c0

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

‎src/VBox/VMM/VMMR3/HM.cpp‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: HM.cpp 110684 2025-08-11 17:18:47Z klaus.espenlaub@oracle.com $ */
1+
/* $Id: HM.cpp 110815 2025-08-26 08:47:24Z ramshankar.venkataraman@oracle.com $ */
22
/** @file
33
* HM - Intel/AMD VM Hardware Support Manager.
44
*/
@@ -552,9 +552,13 @@ VMMR3_INT_DECL(int) HMR3Init(PVM pVM)
552552

553553
/*
554554
* Check if VT-x or AMD-v support according to the users wishes.
555+
*
556+
* NOTE! SUPR3QueryVTCaps won't catch VERR_VMX_IN_VMX_ROOT_MODE or VERR_SVM_IN_USE
557+
* errors because it is intended to merely query capability and not usability. We
558+
* go ahead assuming VT-x/AMD-V is usable which might not be the case. This will
559+
* eventually be resolved in hmR3InitFinalizeR0 when checking for "ForR3.rcInit"
560+
* which stored any usability shortcomings from ring-0 (see HMR0).
555561
*/
556-
/** @todo SUPR3QueryVTCaps won't catch VERR_VMX_IN_VMX_ROOT_MODE or
557-
* VERR_SVM_IN_USE. */
558562
if (pVM->fHMEnabled)
559563
{
560564
uint32_t fCaps;
@@ -1174,14 +1178,15 @@ static int hmR3InitFinalizeR0(PVM pVM)
11741178
pVM->hm.s.ForR3.rcInit = VINF_SUCCESS;
11751179
}
11761180

1181+
if (pVM->hm.s.vmx.fSupported)
1182+
LogRel(("HM: Host MSR_IA32_FEATURE_CONTROL = %#RX64\n", pVM->hm.s.ForR3.vmx.u64HostFeatCtrl));
1183+
11771184
/*
11781185
* Report ring-0 init errors.
11791186
*/
1180-
if ( !pVM->hm.s.vmx.fSupported
1181-
&& !pVM->hm.s.svm.fSupported)
1187+
if (RT_FAILURE(pVM->hm.s.ForR3.rcInit))
11821188
{
1183-
LogRel(("HM: Failed to initialize VT-x / AMD-V: %Rrc\n", pVM->hm.s.ForR3.rcInit));
1184-
LogRel(("HM: VMX MSR_IA32_FEATURE_CONTROL=%RX64\n", pVM->hm.s.ForR3.vmx.u64HostFeatCtrl));
1189+
LogRel(("HM: Failed to initialize %s: %Rrc\n", pVM->hm.s.vmx.fSupported ? "VT-x" : "AMD-V", pVM->hm.s.ForR3.rcInit));
11851190
switch (pVM->hm.s.ForR3.rcInit)
11861191
{
11871192
case VERR_VMX_IN_VMX_ROOT_MODE:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /