Index: /trunk/src/VBox/VMM/VMMR0/HMR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HMR0.cpp	(revision 54152)
+++ /trunk/src/VBox/VMM/VMMR0/HMR0.cpp	(revision 54153)
@@ -1235,4 +1235,7 @@
  * @returns VBox status code.
  * @param   pVM         Pointer to the VM.
+ *
+ * @remarks This is called after HMR3Init(), see vmR3CreateU() and
+ *          vmR3InitRing3().
  */
 VMMR0_INT_DECL(int) HMR0InitVM(PVM pVM)
@@ -1254,5 +1257,5 @@
     pVM->hm.s.svm.fSupported            = g_HvmR0.svm.fSupported;
 
-    pVM->hm.s.vmx.fUsePreemptTimer      = g_HvmR0.vmx.fUsePreemptTimer;
+    pVM->hm.s.vmx.fUsePreemptTimer     &= g_HvmR0.vmx.fUsePreemptTimer;     /* Can be overridden by CFGM. See HMR3Init(). */
     pVM->hm.s.vmx.cPreemptTimerShift    = g_HvmR0.vmx.cPreemptTimerShift;
     pVM->hm.s.vmx.u64HostCr4            = g_HvmR0.vmx.u64HostCr4;
Index: /trunk/src/VBox/VMM/VMMR3/HM.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/HM.cpp	(revision 54152)
+++ /trunk/src/VBox/VMM/VMMR3/HM.cpp	(revision 54153)
@@ -349,15 +349,4 @@
 
     /*
-     * Misc initialisation.
-     */
-#if 0
-    pVM->hm.s.vmx.fSupported = false;
-    pVM->hm.s.svm.fSupported = false;
-    pVM->hm.s.vmx.fEnabled   = false;
-    pVM->hm.s.svm.fEnabled   = false;
-    pVM->hm.s.fNestedPaging  = false;
-#endif
-
-    /*
      * Read configuration.
      */
@@ -445,4 +434,10 @@
      * determines the default value. */
     rc = CFGMR3QueryU32Def(pCfgHM, "MaxResumeLoops", &pVM->hm.s.cMaxResumeLoops, 0 /* set by R0 later */);
+    AssertLogRelRCReturn(rc, rc);
+
+    /** @cfgm{/HM/UseVmxPreemptTimer, bool}
+     * Whether to make use of the VMX-preemption timer feature of the CPU if it's
+     * available. */
+    rc = CFGMR3QueryBoolDef(pCfgHM, "UseVmxPreemptTimer", &pVM->hm.s.vmx.fUsePreemptTimer, true);
     AssertLogRelRCReturn(rc, rc);
 
@@ -1337,13 +1332,4 @@
         LogRel(("HM: Ignoring VPID capabilities of CPU\n"));
 
-    /*
-     * Check for preemption timer config override and log the state of it.
-     */
-    if (pVM->hm.s.vmx.fUsePreemptTimer)
-    {
-        PCFGMNODE pCfgHm = CFGMR3GetChild(CFGMR3GetRoot(pVM), "HM");
-        rc = CFGMR3QueryBoolDef(pCfgHm, "UsePreemptTimer", &pVM->hm.s.vmx.fUsePreemptTimer, true);
-        AssertLogRelRCReturn(rc, rc);
-    }
     if (pVM->hm.s.vmx.fUsePreemptTimer)
         LogRel(("HM: VMX-preemption timer enabled (cPreemptTimerShift=%u)\n", pVM->hm.s.vmx.cPreemptTimerShift));
@@ -1378,4 +1364,5 @@
     LogRel(("HM: AMD-V max ASID                    = %RU32\n",  pVM->hm.s.uMaxAsid));
     LogRel(("HM: AMD-V features                    = %#x\n",    pVM->hm.s.svm.u32Features));
+    LogRel(("HM: Max resume loops                  = %u\n",     pVM->hm.s.cMaxResumeLoops));
 
     /*
