Index: trunk/include/VBox/vmm/hm_vmx.h
===================================================================
--- trunk/include/VBox/vmm/hm_vmx.h	(revision 78236)
+++ trunk/include/VBox/vmm/hm_vmx.h	(revision 78237)
@@ -1069,5 +1069,5 @@
 /** Guest software reads or writes of this MSR must not cause a VM-exit. */
 #define VMXMSRPM_ALLOW_RD_WR                                    (VMXMSRPM_ALLOW_RD | VMXMSRPM_ALLOW_WR)
-/** Guest software reads and writes of this MSR must cause a VM-exit. */
+/** Guest software reads or writes of this MSR must cause a VM-exit. */
 #define VMXMSRPM_EXIT_RD_WR                                     (VMXMSRPM_EXIT_RD  | VMXMSRPM_EXIT_WR)
 /** Mask of valid MSR read permissions. */
Index: trunk/include/VBox/vmm/iem.h
===================================================================
--- trunk/include/VBox/vmm/iem.h	(revision 78236)
+++ trunk/include/VBox/vmm/iem.h	(revision 78237)
@@ -337,8 +337,5 @@
 VMM_INT_DECL(VBOXSTRICTRC)  IEMExecVmxVmexitNmi(PVMCPU pVCpu);
 VMM_INT_DECL(VBOXSTRICTRC)  IEMExecVmxVmexitStartupIpi(PVMCPU pVCpu, uint8_t uVector);
-VMM_INT_DECL(VBOXSTRICTRC)  IEMExecVmxVmexitInitIpi(PVMCPU pVCpu);
-VMM_INT_DECL(VBOXSTRICTRC)  IEMExecVmxVmexitIntWindow(PVMCPU pVCpu);
-VMM_INT_DECL(VBOXSTRICTRC)  IEMExecVmxVmexitNmiWindow(PVMCPU pVCpu);
-VMM_INT_DECL(VBOXSTRICTRC)  IEMExecVmxVmexitMtf(PVMCPU pVCpu);
+VMM_INT_DECL(VBOXSTRICTRC)  IEMExecVmxVmexit(PVMCPU pVCpu, uint32_t uExitReason);
 VMM_INT_DECL(VBOXSTRICTRC)  IEMExecDecodedVmread(PVMCPU pVCpu, PCVMXVEXITINFO pExitInfo);
 VMM_INT_DECL(VBOXSTRICTRC)  IEMExecDecodedVmwrite(PVMCPU pVCpu, PCVMXVEXITINFO pExitInfo);
Index: trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/IEMAll.cpp	(revision 78236)
+++ trunk/src/VBox/VMM/VMMAll/IEMAll.cpp	(revision 78237)
@@ -986,8 +986,5 @@
 IEM_STATIC VBOXSTRICTRC     iemVmxVmexitNmi(PVMCPU pVCpu);
 IEM_STATIC VBOXSTRICTRC     iemVmxVmexitStartupIpi(PVMCPU pVCpu, uint8_t uVector);
-IEM_STATIC VBOXSTRICTRC     iemVmxVmexitInitIpi(PVMCPU pVCpu);
-IEM_STATIC VBOXSTRICTRC     iemVmxVmexitIntWindow(PVMCPU pVCpu);
-IEM_STATIC VBOXSTRICTRC     iemVmxVmexitNmiWindow(PVMCPU pVCpu);
-IEM_STATIC VBOXSTRICTRC     iemVmxVmexitMtf(PVMCPU pVCpu);
+IEM_STATIC VBOXSTRICTRC     iemVmxVmexit(PVMCPU pVCpu, uint32_t uExitReason);
 IEM_STATIC VBOXSTRICTRC     iemVmxVirtApicAccessMem(PVMCPU pVCpu, uint16_t offAccess, size_t cbAccess, void *pvData, uint32_t fAccess);
 IEM_STATIC VBOXSTRICTRC     iemVmxVmexitApicAccess(PVMCPU pVCpu, uint16_t offAccess, uint32_t fAccess);
@@ -14066,5 +14063,5 @@
         else if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_MTF))
         {
-            rcStrict = iemVmxVmexitMtf(pVCpu);
+            rcStrict = iemVmxVmexit(pVCpu, VMX_EXIT_MTF);
             Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS));
             Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_MTF));
@@ -14085,5 +14082,5 @@
         else if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW))
         {
-            rcStrict = iemVmxVmexitNmiWindow(pVCpu);
+            rcStrict = iemVmxVmexit(pVCpu, VMX_EXIT_NMI_WINDOW);
             Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW));
         }
@@ -15913,61 +15910,19 @@
 
 /**
- * Interface for HM and EM to emulate VM-exit due to init-IPI (INIT).
+ * Interface for HM and EM to emulate a VM-exit.
+ *
+ * If a specialized version of a VM-exit handler exists, that must be used instead.
  *
  * @returns Strict VBox status code.
  * @param   pVCpu           The cross context virtual CPU structure of the calling EMT.
+ * @param   uExitReason     The VM-exit reason.
  * @thread  EMT(pVCpu)
- */
-VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitInitIpi(PVMCPU pVCpu)
-{
-    VBOXSTRICTRC rcStrict = iemVmxVmexitInitIpi(pVCpu);
-    if (pVCpu->iem.s.cActiveMappings)
-        iemMemRollback(pVCpu);
-    return iemExecStatusCodeFiddling(pVCpu, rcStrict);
-}
-
-
-/**
- * Interface for HM and EM to emulate VM-exits for interrupt-windows.
- *
- * @returns Strict VBox status code.
- * @param   pVCpu           The cross context virtual CPU structure of the calling EMT.
- * @thread  EMT(pVCpu)
- */
-VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitIntWindow(PVMCPU pVCpu)
-{
-    VBOXSTRICTRC rcStrict = iemVmxVmexitIntWindow(pVCpu);
-    if (pVCpu->iem.s.cActiveMappings)
-        iemMemRollback(pVCpu);
-    return iemExecStatusCodeFiddling(pVCpu, rcStrict);
-}
-
-
-/**
- * Interface for HM and EM to emulate VM-exits for NMI-windows.
- *
- * @returns Strict VBox status code.
- * @param   pVCpu           The cross context virtual CPU structure of the calling EMT.
- * @thread  EMT(pVCpu)
- */
-VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitNmiWindow(PVMCPU pVCpu)
-{
-    VBOXSTRICTRC rcStrict = iemVmxVmexitNmiWindow(pVCpu);
-    if (pVCpu->iem.s.cActiveMappings)
-        iemMemRollback(pVCpu);
-    return iemExecStatusCodeFiddling(pVCpu, rcStrict);
-}
-
-
-/**
- * Interface for HM and EM to emulate VM-exits Monitor-Trap Flag (MTF).
- *
- * @returns Strict VBox status code.
- * @param   pVCpu           The cross context virtual CPU structure of the calling EMT.
- * @thread  EMT(pVCpu)
- */
-VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitMtf(PVMCPU pVCpu)
-{
-    VBOXSTRICTRC rcStrict = iemVmxVmexitMtf(pVCpu);
+ *
+ * @remarks It is the responsibility of the caller to ensure VM-exit qualification
+ *          is updated prior to calling this function!
+ */
+VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexit(PVMCPU pVCpu, uint32_t uExitReason)
+{
+    VBOXSTRICTRC rcStrict = iemVmxVmexit(pVCpu, uExitReason);
     if (pVCpu->iem.s.cActiveMappings)
         iemMemRollback(pVCpu);
Index: trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
===================================================================
--- trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h	(revision 78236)
+++ trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h	(revision 78237)
@@ -3072,21 +3072,4 @@
 
 /**
- * VMX VM-exit handler for VM-exits due to Monitor-Trap Flag (MTF).
- *
- * @returns Strict VBox status code.
- * @param   pVCpu   The cross context virtual CPU structure.
- */
-IEM_STATIC VBOXSTRICTRC iemVmxVmexitMtf(PVMCPU pVCpu)
-{
-    /*
-     * The MTF VM-exit can occur even when the MTF VM-execution control is
-     * not set (e.g. when VM-entry injects an MTF pending event), so do not
-     * check for the intercept here.
-     */
-    return iemVmxVmexit(pVCpu, VMX_EXIT_MTF);
-}
-
-
-/**
  * VMX VM-exit handler for VM-exits due to INVLPG.
  *
@@ -3921,40 +3904,4 @@
     iemVmxVmcsSetExitQual(pVCpu, uVector);
     return iemVmxVmexit(pVCpu, VMX_EXIT_SIPI);
-}
-
-
-/**
- * VMX VM-exit handler for VM-exits due to init-IPIs (INIT).
- *
- * @returns VBox strict status code.
- * @param   pVCpu       The cross context virtual CPU structure.
- */
-IEM_STATIC VBOXSTRICTRC iemVmxVmexitInitIpi(PVMCPU pVCpu)
-{
-    return iemVmxVmexit(pVCpu, VMX_EXIT_INIT_SIGNAL);
-}
-
-
-/**
- * VMX VM-exit handler for interrupt-window VM-exits.
- *
- * @returns VBox strict status code.
- * @param   pVCpu           The cross context virtual CPU structure.
- */
-IEM_STATIC VBOXSTRICTRC iemVmxVmexitIntWindow(PVMCPU pVCpu)
-{
-    return iemVmxVmexit(pVCpu, VMX_EXIT_INT_WINDOW);
-}
-
-
-/**
- * VMX VM-exit handler for NMI-window VM-exits.
- *
- * @returns VBox strict status code.
- * @param   pVCpu           The cross context virtual CPU structure.
- */
-IEM_STATIC VBOXSTRICTRC iemVmxVmexitNmiWindow(PVMCPU pVCpu)
-{
-    return iemVmxVmexit(pVCpu, VMX_EXIT_NMI_WINDOW);
 }
 
Index: trunk/src/VBox/VMM/VMMR3/EM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/EM.cpp	(revision 78236)
+++ trunk/src/VBox/VMM/VMMR3/EM.cpp	(revision 78237)
@@ -1729,5 +1729,5 @@
         && CPUMIsGuestVmxProcCtlsSet(pVCpu, &pVCpu->cpum.GstCtx, VMX_PROC_CTLS_INT_WINDOW_EXIT))
     {
-        VBOXSTRICTRC rcStrict = IEMExecVmxVmexitIntWindow(pVCpu);
+        VBOXSTRICTRC rcStrict = IEMExecVmxVmexit(pVCpu, VMX_EXIT_INT_WINDOW);
         if (RT_SUCCESS(rcStrict))
         {
@@ -2157,5 +2157,5 @@
         if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_MTF))
         {
-            rc2 = VBOXSTRICTRC_VAL(IEMExecVmxVmexitMtf(pVCpu));
+            rc2 = VBOXSTRICTRC_VAL(IEMExecVmxVmexit(pVCpu, VMX_EXIT_MTF));
             Assert(rc2 != VINF_VMX_INTERCEPT_NOT_ACTIVE);
             UPDATE_RC();
@@ -2179,5 +2179,5 @@
         if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW))
         {
-            rc2 = VBOXSTRICTRC_VAL(IEMExecVmxVmexitNmiWindow(pVCpu));
+            rc2 = VBOXSTRICTRC_VAL(IEMExecVmxVmexit(pVCpu, VMX_EXIT_NMI_WINDOW));
             Assert(rc2 != VINF_VMX_INTERCEPT_NOT_ACTIVE);
             UPDATE_RC();
Index: trunk/src/VBox/VMM/VMMR3/VMM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/VMM.cpp	(revision 78236)
+++ trunk/src/VBox/VMM/VMMR3/VMM.cpp	(revision 78237)
@@ -1647,5 +1647,5 @@
     PCCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);
     if (CPUMIsGuestInVmxNonRootMode(pCtx))
-        return VBOXSTRICTRC_TODO(IEMExecVmxVmexitInitIpi(pVCpu));
+        return VBOXSTRICTRC_TODO(IEMExecVmxVmexit(pVCpu, VMX_EXIT_INIT_SIGNAL));
 #endif
 
