Index: /trunk/src/VBox/VMM/VMMAll/EMAll.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/EMAll.cpp	(revision 41829)
+++ /trunk/src/VBox/VMM/VMMAll/EMAll.cpp	(revision 41830)
@@ -660,4 +660,30 @@
 
 
+/**
+ * Interpret CPUID given the parameters in the CPU context
+ *
+ * @returns VBox status code.
+ * @param   pVM         Pointer to the VM.
+ * @param   pVCpu       Pointer to the VMCPU.
+ * @param   pRegFrame   The register frame.
+ *
+ */
+VMMDECL(int) EMInterpretCpuId(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
+{
+    uint32_t iLeaf = pRegFrame->eax;
+    NOREF(pVM);
+
+    /* cpuid clears the high dwords of the affected 64 bits registers. */
+    pRegFrame->rax = 0;
+    pRegFrame->rbx = 0;
+    pRegFrame->rcx &= UINT64_C(0x00000000ffffffff);
+    pRegFrame->rdx = 0;
+
+    /* Note: operates the same in 64 and non-64 bits mode. */
+    CPUMGetGuestCpuId(pVCpu, iLeaf, &pRegFrame->eax, &pRegFrame->ebx, &pRegFrame->ecx, &pRegFrame->edx);
+    Log(("Emulate: CPUID %x -> %08x %08x %08x %08x\n", iLeaf, pRegFrame->eax, pRegFrame->ebx, pRegFrame->ecx, pRegFrame->edx));
+    return VINF_SUCCESS;
+}
+
 
 /**
@@ -790,6 +816,64 @@
 
 
+/**
+ * MONITOR Emulation.
+ */
+VMMDECL(int) EMInterpretMonitor(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
+{
+    uint32_t u32Dummy, u32ExtFeatures, cpl;
+    NOREF(pVM);
+
+    if (pRegFrame->ecx != 0)
+    {
+        Log(("emInterpretMonitor: unexpected ecx=%x -> recompiler!!\n", pRegFrame->ecx));
+        return VERR_EM_INTERPRETER; /* illegal value. */
+    }
+
+    /* Get the current privilege level. */
+    cpl = CPUMGetGuestCPL(pVCpu, pRegFrame);
+    if (cpl != 0)
+        return VERR_EM_INTERPRETER; /* supervisor only */
+
+    CPUMGetGuestCpuId(pVCpu, 1, &u32Dummy, &u32Dummy, &u32ExtFeatures, &u32Dummy);
+    if (!(u32ExtFeatures & X86_CPUID_FEATURE_ECX_MONITOR))
+        return VERR_EM_INTERPRETER; /* not supported */
+
+    EMMonitorWaitPrepare(pVCpu, pRegFrame->rax, pRegFrame->rcx, pRegFrame->rdx);
+    return VINF_SUCCESS;
+}
+
+
 
 /* VT-x only: */
+
+/**
+ * Interpret INVLPG
+ *
+ * @returns VBox status code.
+ * @param   pVM         Pointer to the VM.
+ * @param   pVCpu       Pointer to the VMCPU.
+ * @param   pRegFrame   The register frame.
+ * @param   pAddrGC     Operand address
+ *
+ */
+VMMDECL(VBOXSTRICTRC) EMInterpretInvlpg(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pAddrGC)
+{
+    /** @todo is addr always a flat linear address or ds based
+     * (in absence of segment override prefixes)????
+     */
+    NOREF(pVM); NOREF(pRegFrame);
+#ifdef IN_RC
+    LogFlow(("RC: EMULATE: invlpg %RGv\n", pAddrGC));
+#endif
+    VBOXSTRICTRC rc = PGMInvalidatePage(pVCpu, pAddrGC);
+    if (    rc == VINF_SUCCESS
+        ||  rc == VINF_PGM_SYNC_CR3 /* we can rely on the FF */)
+        return VINF_SUCCESS;
+    AssertMsgReturn(rc == VINF_EM_RAW_EMULATE_INSTR,
+                    ("%Rrc addr=%RGv\n", VBOXSTRICTRC_VAL(rc), pAddrGC),
+                    VERR_EM_INTERPRETER);
+    return rc;
+}
+
 
 /**
@@ -2439,34 +2523,4 @@
 
 /**
- * Interpret INVLPG
- *
- * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
- * @param   pVCpu       Pointer to the VMCPU.
- * @param   pRegFrame   The register frame.
- * @param   pAddrGC     Operand address
- *
- */
-VMMDECL(VBOXSTRICTRC) EMInterpretInvlpg(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pAddrGC)
-{
-    /** @todo is addr always a flat linear address or ds based
-     * (in absence of segment override prefixes)????
-     */
-    NOREF(pVM); NOREF(pRegFrame);
-#ifdef IN_RC
-    LogFlow(("RC: EMULATE: invlpg %RGv\n", pAddrGC));
-#endif
-    VBOXSTRICTRC rc = PGMInvalidatePage(pVCpu, pAddrGC);
-    if (    rc == VINF_SUCCESS
-        ||  rc == VINF_PGM_SYNC_CR3 /* we can rely on the FF */)
-        return VINF_SUCCESS;
-    AssertMsgReturn(rc == VINF_EM_RAW_EMULATE_INSTR,
-                    ("%Rrc addr=%RGv\n", VBOXSTRICTRC_VAL(rc), pAddrGC),
-                    VERR_EM_INTERPRETER);
-    return rc;
-}
-
-
-/**
  * INVLPG Emulation.
  */
@@ -2513,31 +2567,4 @@
 
 /**
- * Interpret CPUID given the parameters in the CPU context
- *
- * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
- * @param   pVCpu       Pointer to the VMCPU.
- * @param   pRegFrame   The register frame.
- *
- */
-VMMDECL(int) EMInterpretCpuId(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
-{
-    uint32_t iLeaf = pRegFrame->eax;
-    NOREF(pVM);
-
-    /* cpuid clears the high dwords of the affected 64 bits registers. */
-    pRegFrame->rax = 0;
-    pRegFrame->rbx = 0;
-    pRegFrame->rcx &= UINT64_C(0x00000000ffffffff);
-    pRegFrame->rdx = 0;
-
-    /* Note: operates the same in 64 and non-64 bits mode. */
-    CPUMGetGuestCpuId(pVCpu, iLeaf, &pRegFrame->eax, &pRegFrame->ebx, &pRegFrame->ecx, &pRegFrame->edx);
-    Log(("Emulate: CPUID %x -> %08x %08x %08x %08x\n", iLeaf, pRegFrame->eax, pRegFrame->ebx, pRegFrame->ecx, pRegFrame->edx));
-    return VINF_SUCCESS;
-}
-
-
-/**
  * CPUID Emulation.
  */
@@ -2834,31 +2861,4 @@
 
 
-/**
- * MONITOR Emulation.
- */
-VMMDECL(int) EMInterpretMonitor(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
-{
-    uint32_t u32Dummy, u32ExtFeatures, cpl;
-    NOREF(pVM);
-
-    if (pRegFrame->ecx != 0)
-    {
-        Log(("emInterpretMonitor: unexpected ecx=%x -> recompiler!!\n", pRegFrame->ecx));
-        return VERR_EM_INTERPRETER; /* illegal value. */
-    }
-
-    /* Get the current privilege level. */
-    cpl = CPUMGetGuestCPL(pVCpu, pRegFrame);
-    if (cpl != 0)
-        return VERR_EM_INTERPRETER; /* supervisor only */
-
-    CPUMGetGuestCpuId(pVCpu, 1, &u32Dummy, &u32Dummy, &u32ExtFeatures, &u32Dummy);
-    if (!(u32ExtFeatures & X86_CPUID_FEATURE_ECX_MONITOR))
-        return VERR_EM_INTERPRETER; /* not supported */
-
-    EMMonitorWaitPrepare(pVCpu, pRegFrame->rax, pRegFrame->rcx, pRegFrame->rdx);
-    return VINF_SUCCESS;
-}
-
 static int emInterpretMonitor(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pDis, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize)
 {
@@ -2866,4 +2866,5 @@
     return EMInterpretMonitor(pVM, pVCpu, pRegFrame);
 }
+
 
 static VBOXSTRICTRC emInterpretMWait(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pDis, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize)
