Index: /trunk/src/VBox/VMM/VMMAll/VMXAllTemplate.cpp.h
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/VMXAllTemplate.cpp.h	(revision 93042)
+++ /trunk/src/VBox/VMM/VMMAll/VMXAllTemplate.cpp.h	(revision 93043)
@@ -900,5 +900,5 @@
 }
 
-
+#ifdef IN_RING0
 /**
  * Sets the given Processor-based VM-execution controls.
@@ -967,5 +967,5 @@
     }
 }
-
+#endif
 
 /**
@@ -1253,4 +1253,5 @@
 
 
+#ifdef IN_RING0
 /**
  * Updates the VM's last error record.
@@ -1272,8 +1273,7 @@
         VMX_VMCS_READ_32(pVCpu, VMX_VMCS32_RO_VM_INSTR_ERROR, &VCPU_2_VMXSTATE(pVCpu).vmx.LastError.u32InstrError);
     }
-#ifdef IN_RING0
     pVCpu->CTX_SUFF(pVM)->hm.s.ForR3.rcInit = rc;
-#endif
-}
+}
+#endif
 
 
@@ -1547,4 +1547,5 @@
 #endif
 
+#ifdef IN_RING0
 /**
  * Sets the permission bits for the specified MSR in the given MSR bitmap.
@@ -1751,5 +1752,4 @@
     pHostMsr[i].u32Msr = idMsr;
 
-#ifdef IN_RING0
     /*
      * Only if the caller requests to update the host MSR value AND we've newly added the
@@ -1773,7 +1773,5 @@
         }
     }
-#else
-    RT_NOREF(fUpdateHostMsr);
-#endif
+
     return VINF_SUCCESS;
 }
@@ -1875,4 +1873,5 @@
     return false;
 }
+#endif
 
 
@@ -3040,4 +3039,5 @@
 
 
+#ifdef IN_RING0
 /**
  * Exports the guest's RSP into the guest-state area in the VMCS.
@@ -3060,4 +3060,5 @@
     }
 }
+#endif
 
 
@@ -3279,4 +3280,5 @@
 
 
+#ifdef IN_RING0
 /**
  * Exports the guest hardware-virtualization state.
@@ -3338,4 +3340,5 @@
     return VINF_SUCCESS;
 }
+#endif
 
 
@@ -3762,4 +3765,5 @@
 
 
+#ifdef IN_RING0
 /**
  * Exports the guest debug registers into the guest-state area in the VMCS.
@@ -3776,7 +3780,5 @@
 static int vmxHCExportSharedDebugState(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient)
 {
-#ifdef IN_RING0
     Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
-#endif
 
     /** @todo NSTVMX: Figure out what we want to do with nested-guest instruction
@@ -3816,5 +3818,4 @@
 #endif
 
-#ifdef IN_RING0 /** @todo */
     bool     fSteppingDB      = false;
     bool     fInterceptMovDRx = false;
@@ -3938,8 +3939,8 @@
         }
     }
+
+    return VINF_SUCCESS;
+}
 #endif /* !IN_RING0 */
-
-    return VINF_SUCCESS;
-}
 
 
@@ -4445,4 +4446,5 @@
 
 
+#ifdef IN_RING0
 /**
  * Exports certain guest MSRs into the VM-entry MSR-load and VM-exit MSR-store
@@ -4591,5 +4593,4 @@
         }
 
-#ifdef IN_RING0 /** @todo */
         /* Last Branch Record. */
         if (VM_IS_VMX_LBR(pVM))
@@ -4623,5 +4624,4 @@
             AssertRCReturn(rc, rc);
         }
-#endif /* !IN_RING0 */
 
         ASMAtomicUoAndU64(&VCPU_2_VMXSTATE(pVCpu).fCtxChanged, ~HM_CHANGED_GUEST_OTHER_MSRS);
@@ -4632,5 +4632,4 @@
 
 
-#ifdef IN_RING0
 /**
  * Sets up the usage of TSC-offsetting and updates the VMCS.
@@ -6796,4 +6795,5 @@
 
 
+#ifdef IN_RING0
 /**
  * Exports the guest state into the VMCS guest-state area.
@@ -6825,5 +6825,4 @@
     STAM_PROFILE_ADV_START(&VCPU_2_VMXSTATS(pVCpu).StatExportGuestState, x);
 
-#ifdef IN_RING0
     /*
      * Determine real-on-v86 mode.
@@ -6839,5 +6838,4 @@
         pVmcsInfoShared->RealMode.fRealOnV86Active = true;
     }
-#endif
 
     /*
@@ -6904,8 +6902,6 @@
 static void vmxHCExportSharedState(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient)
 {
-#ifdef IN_RING0
     Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
     Assert(!VMMRZCallRing3IsEnabled(pVCpu));
-#endif
 
     if (VCPU_2_VMXSTATE(pVCpu).fCtxChanged & HM_CHANGED_GUEST_DR_MASK)
@@ -6920,5 +6916,4 @@
     }
 
-#ifdef IN_RING0
     if (VCPU_2_VMXSTATE(pVCpu).fCtxChanged & HM_CHANGED_VMX_GUEST_LAZY_MSRS)
     {
@@ -6926,5 +6921,4 @@
         VCPU_2_VMXSTATE(pVCpu).fCtxChanged &= ~HM_CHANGED_VMX_GUEST_LAZY_MSRS;
     }
-#endif
 
     AssertMsg(!(VCPU_2_VMXSTATE(pVCpu).fCtxChanged & HM_CHANGED_VMX_HOST_GUEST_SHARED_STATE),
@@ -6949,7 +6943,5 @@
 {
     HMVMX_ASSERT_PREEMPT_SAFE(pVCpu);
-#ifdef IN_RING0
     Assert(!VMMRZCallRing3IsEnabled(pVCpu));
-#endif
 
 #ifdef HMVMX_ALWAYS_SYNC_FULL_GUEST_STATE
@@ -6986,7 +6978,5 @@
             AssertMsg(rcStrict == VINF_EM_RESCHEDULE_REM, ("Failed to export guest state! rc=%Rrc\n",
                                                            VBOXSTRICTRC_VAL(rcStrict)));
-#ifdef IN_RING0
             Assert(!VMMRZCallRing3IsEnabled(pVCpu));
-#endif
             return rcStrict;
         }
@@ -7004,4 +6994,5 @@
     return rcStrict;
 }
+#endif
 
 
