Index: trunk/src/VBox/VMM/VMMAll/EMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/EMAll.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMAll/EMAll.cpp	(revision 39402)
@@ -218,5 +218,5 @@
  * @returns VBox status code, see SELMToFlatEx and EMInterpretDisasOneEx for
  *          details.
- * @retval  VERR_INTERNAL_ERROR on DISCoreOneEx failure.
+ * @retval  VERR_EM_INTERNAL_DISAS_ERROR on DISCoreOneEx failure.
  *
  * @param   pVM             The VM handle.
@@ -246,5 +246,5 @@
  *
  * @returns VBox status code.
- * @retval  VERR_INTERNAL_ERROR on DISCoreOneEx failure.
+ * @retval  VERR_EM_INTERNAL_DISAS_ERROR on DISCoreOneEx failure.
  *
  * @param   pVM             The VM handle.
@@ -291,5 +291,5 @@
         return VINF_SUCCESS;
     AssertMsgFailed(("DISCoreOne failed to GCPtrInstr=%RGv rc=%Rrc\n", GCPtrInstr, rc));
-    return VERR_INTERNAL_ERROR;
+    return VERR_EM_INTERNAL_DISAS_ERROR;
 }
 
Index: trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/IEMAll.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMAll/IEMAll.cpp	(revision 39402)
@@ -154,5 +154,5 @@
 /** Used to shut up GCC warnings about variables that 'may be used uninitialized'
  * due to GCC lacking knowledge about the value range of a switch. */
-#define IEM_NOT_REACHED_DEFAULT_CASE_RET() default: AssertFailedReturn(VERR_INTERNAL_ERROR_4)
+#define IEM_NOT_REACHED_DEFAULT_CASE_RET() default: AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE)
 
 /**
Index: trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp	(revision 39402)
@@ -95,6 +95,6 @@
     AssertReturn(   (pRange->fFlags & IOMMMIO_FLAGS_WRITE_MODE) != IOMMMIO_FLAGS_WRITE_PASSTHRU
                  || (pRange->fFlags & IOMMMIO_FLAGS_WRITE_MODE) <= IOMMMIO_FLAGS_WRITE_DWORD_QWORD_READ_MISSING,
-                 VERR_INTERNAL_ERROR_5);
-    AssertReturn(cbValue != 0 && cbValue <= 16, VERR_INTERNAL_ERROR_4);
+                 VERR_IOM_MMIO_IPE_1);
+    AssertReturn(cbValue != 0 && cbValue <= 16, VERR_IOM_MMIO_IPE_2);
     RTGCPHYS const GCPhysStart  = GCPhys; NOREF(GCPhysStart);
     bool const     fReadMissing = (pRange->fFlags & IOMMMIO_FLAGS_WRITE_MODE) >= IOMMMIO_FLAGS_WRITE_DWORD_READ_MISSING;
@@ -189,5 +189,5 @@
                 break;
             default:
-                AssertFailedReturn(VERR_INTERNAL_ERROR_3);
+                AssertFailedReturn(VERR_IOM_MMIO_IPE_3);
         }
         if (offAccess)
@@ -296,6 +296,6 @@
     AssertReturn(   (pRange->fFlags & IOMMMIO_FLAGS_READ_MODE) == IOMMMIO_FLAGS_READ_DWORD
                  || (pRange->fFlags & IOMMMIO_FLAGS_READ_MODE) == IOMMMIO_FLAGS_READ_DWORD_QWORD,
-                 VERR_INTERNAL_ERROR_5);
-    AssertReturn(cbValue != 0 && cbValue <= 16, VERR_INTERNAL_ERROR_4);
+                 VERR_IOM_MMIO_IPE_1);
+    AssertReturn(cbValue != 0 && cbValue <= 16, VERR_IOM_MMIO_IPE_2);
     RTGCPHYS const GCPhysStart = GCPhys; NOREF(GCPhysStart);
 
@@ -1788,9 +1788,9 @@
      */
     PIOMMMIORANGE pRange = iomMmioGetRange(pVM, GCPhys);
-    AssertMsg(pRange, ("Handlers and page tables are out of sync or something! GCPhys=%RGp cbValue=%d\n", GCPhys, cbValue));
     if (!pRange)
     {
+        AssertMsgFailed(("Handlers and page tables are out of sync or something! GCPhys=%RGp cbValue=%d\n", GCPhys, cbValue));
         IOM_UNLOCK(pVM);
-        return VERR_INTERNAL_ERROR;
+        return VERR_IOM_MMIO_RANGE_NOT_FOUND;
     }
 #ifdef VBOX_WITH_STATISTICS
@@ -1917,9 +1917,9 @@
      */
     PIOMMMIORANGE pRange = iomMmioGetRange(pVM, GCPhys);
-    AssertMsg(pRange, ("Handlers and page tables are out of sync or something! GCPhys=%RGp cbValue=%d\n", GCPhys, cbValue));
     if (!pRange)
     {
+        AssertMsgFailed(("Handlers and page tables are out of sync or something! GCPhys=%RGp cbValue=%d\n", GCPhys, cbValue));
         IOM_UNLOCK(pVM);
-        return VERR_INTERNAL_ERROR;
+        return VERR_IOM_MMIO_RANGE_NOT_FOUND;
     }
 #ifdef VBOX_WITH_STATISTICS
Index: trunk/src/VBox/VMM/VMMAll/PDMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PDMAll.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMAll/PDMAll.cpp	(revision 39402)
@@ -352,5 +352,5 @@
 {
 #ifdef IN_RING3
-    int rc = PDMCritSectEnter(&pVM->pdm.s.CritSect, VERR_INTERNAL_ERROR);
+    int rc = PDMCritSectEnter(&pVM->pdm.s.CritSect, VERR_IGNORED);
 #else
     int rc = PDMCritSectEnter(&pVM->pdm.s.CritSect, VERR_GENERAL_FAILURE);
@@ -402,5 +402,5 @@
         Log(("PDMVMMDevHeapR3ToGCPhys: pv=%p pvVMMDevHeap=%p cbVMMDevHeap=%#x\n",
              pv, pVM->pdm.s.pvVMMDevHeap, pVM->pdm.s.cbVMMDevHeap));
-        return VERR_INTERNAL_ERROR_3;
+        return VERR_PDM_DEV_HEAP_R3_TO_GCPHYS;
     }
 
Index: trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp	(revision 39402)
@@ -482,5 +482,5 @@
 VMMR3DECL(int) PDMR3CritSectEnterEx(PPDMCRITSECT pCritSect, bool fCallRing3)
 {
-    int rc = PDMCritSectEnter(pCritSect, VERR_INTERNAL_ERROR);
+    int rc = PDMCritSectEnter(pCritSect, VERR_IGNORED);
     if (    rc == VINF_SUCCESS
         &&  fCallRing3
Index: trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PGMAll.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMAll/PGMAll.cpp	(revision 39402)
@@ -996,5 +996,5 @@
     {
         pShwPage = pgmPoolGetPage(pPool, pPdpe->u & X86_PDPE_PG_MASK);
-        AssertReturn(pShwPage, VERR_INTERNAL_ERROR);
+        AssertReturn(pShwPage, VERR_PGM_POOL_GET_PAGE_FAILED);
         Assert((pPdpe->u & X86_PDPE_PG_MASK) == pShwPage->Core.Key);
 
@@ -1032,5 +1032,5 @@
     /* Fetch the pgm pool shadow descriptor. */
     PPGMPOOLPAGE pShwPde = pgmPoolGetPage(pVM->pgm.s.CTX_SUFF(pPool), pPdpt->a[iPdPt].u & X86_PDPE_PG_MASK);
-    AssertReturn(pShwPde, VERR_INTERNAL_ERROR);
+    AssertReturn(pShwPde, VERR_PGM_POOL_GET_PAGE_FAILED);
 
     *ppShwPde = pShwPde;
@@ -1095,5 +1095,5 @@
     {
         pShwPage = pgmPoolGetPage(pPool, pPml4e->u & X86_PML4E_PG_MASK);
-        AssertReturn(pShwPage, VERR_INTERNAL_ERROR);
+        AssertReturn(pShwPage, VERR_PGM_POOL_GET_PAGE_FAILED);
 
         pgmPoolCacheUsed(pPool, pShwPage);
@@ -1132,5 +1132,5 @@
     {
         pShwPage = pgmPoolGetPage(pPool, pPdpe->u & X86_PDPE_PG_MASK);
-        AssertReturn(pShwPage, VERR_INTERNAL_ERROR);
+        AssertReturn(pShwPage, VERR_PGM_POOL_GET_PAGE_FAILED);
 
         pgmPoolCacheUsed(pPool, pShwPage);
@@ -1160,5 +1160,5 @@
     PGM_LOCK_ASSERT_OWNER(pVCpu->CTX_SUFF(pVM));
 
-    AssertReturn(pPml4e, VERR_INTERNAL_ERROR);
+    AssertReturn(pPml4e, VERR_PGM_PML4_MAPPING);
     if (ppPml4e)
         *ppPml4e = (PX86PML4E)pPml4e;
@@ -1172,5 +1172,5 @@
     PPGMPOOL        pPool    = pVM->pgm.s.CTX_SUFF(pPool);
     PPGMPOOLPAGE    pShwPage = pgmPoolGetPage(pPool, pPml4e->u & X86_PML4E_PG_MASK);
-    AssertReturn(pShwPage, VERR_INTERNAL_ERROR);
+    AssertReturn(pShwPage, VERR_PGM_POOL_GET_PAGE_FAILED);
 
     const unsigned  iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64;
@@ -1180,5 +1180,5 @@
 
     pShwPage = pgmPoolGetPage(pPool, pPdpt->a[iPdPt].u & X86_PDPE_PG_MASK);
-    AssertReturn(pShwPage, VERR_INTERNAL_ERROR);
+    AssertReturn(pShwPage, VERR_PGM_POOL_GET_PAGE_FAILED);
 
     *ppPD = (PX86PDPAE)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
@@ -1228,5 +1228,5 @@
     {
         pShwPage = pgmPoolGetPage(pPool, pPml4e->u & EPT_PML4E_PG_MASK);
-        AssertReturn(pShwPage, VERR_INTERNAL_ERROR);
+        AssertReturn(pShwPage, VERR_PGM_POOL_GET_PAGE_FAILED);
 
         pgmPoolCacheUsed(pPool, pShwPage);
@@ -1257,5 +1257,5 @@
     {
         pShwPage = pgmPoolGetPage(pPool, pPdpe->u & EPT_PDPTE_PG_MASK);
-        AssertReturn(pShwPage, VERR_INTERNAL_ERROR);
+        AssertReturn(pShwPage, VERR_PGM_POOL_GET_PAGE_FAILED);
 
         pgmPoolCacheUsed(pPool, pShwPage);
@@ -1323,5 +1323,5 @@
 
         default:
-            AssertMsgFailedReturn(("%d\n", enmShwPagingMode), VERR_INTERNAL_ERROR_5);
+            AssertMsgFailedReturn(("%d\n", enmShwPagingMode), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
     }
     return rc;
@@ -2054,5 +2054,5 @@
         }
         AssertRCReturn(rc, rc);
-        AssertRCSuccessReturn(rc, VERR_INTERNAL_ERROR);
+        AssertRCSuccessReturn(rc, VERR_IPE_UNEXPECTED_INFO_STATUS);
     }
 
Index: trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PGMAllBth.h	(revision 39400)
+++ trunk/src/VBox/VMM/VMMAll/PGMAllBth.h	(revision 39402)
@@ -588,5 +588,5 @@
     rc = pgmShwSyncPaePDPtr(pVCpu, pvFault, X86_PDPE_P, &pPDDst);       /* RW, US and A are reserved in PAE mode. */
 #   endif
-    AssertMsgReturn(rc == VINF_SUCCESS, ("rc=%Rrc\n", rc), RT_FAILURE_NP(rc) ? rc : VERR_INTERNAL_ERROR_4);
+    AssertMsgReturn(rc == VINF_SUCCESS, ("rc=%Rrc\n", rc), RT_FAILURE_NP(rc) ? rc : VERR_IPE_UNEXPECTED_INFO_STATUS);
 
 #  elif PGM_SHW_TYPE == PGM_TYPE_AMD64
@@ -599,5 +599,5 @@
     rc = pgmShwSyncLongModePDPtr(pVCpu, pvFault, GstWalk.Pml4e.u, GstWalk.Pdpe.u, &pPDDst);
 #   endif
-    AssertMsgReturn(rc == VINF_SUCCESS, ("rc=%Rrc\n", rc), RT_FAILURE_NP(rc) ? rc : VERR_INTERNAL_ERROR_4);
+    AssertMsgReturn(rc == VINF_SUCCESS, ("rc=%Rrc\n", rc), RT_FAILURE_NP(rc) ? rc : VERR_IPE_UNEXPECTED_INFO_STATUS);
 
 #  elif PGM_SHW_TYPE == PGM_TYPE_EPT
@@ -605,5 +605,5 @@
     PEPTPD          pPDDst;
     rc = pgmShwGetEPTPDPtr(pVCpu, pvFault, NULL, &pPDDst);
-    AssertMsgReturn(rc == VINF_SUCCESS, ("rc=%Rrc\n", rc), RT_FAILURE_NP(rc) ? rc : VERR_INTERNAL_ERROR_4);
+    AssertMsgReturn(rc == VINF_SUCCESS, ("rc=%Rrc\n", rc), RT_FAILURE_NP(rc) ? rc : VERR_IPE_UNEXPECTED_INFO_STATUS);
 #  endif
     Assert(pPDDst);
@@ -1091,5 +1091,5 @@
     NOREF(uErr); NOREF(pRegFrame); NOREF(pvFault);
     AssertReleaseMsgFailed(("Shw=%d Gst=%d is not implemented!\n", PGM_GST_TYPE, PGM_SHW_TYPE));
-    return VERR_INTERNAL_ERROR;
+    return VERR_PGM_NOT_USED_IN_MODE;
 # endif
 }
@@ -2276,5 +2276,5 @@
     NOREF(PdeSrc);
     AssertReleaseMsgFailed(("Shw=%d Gst=%d is not implemented!\n", PGM_GST_TYPE, PGM_SHW_TYPE));
-    return VERR_INTERNAL_ERROR;
+    return VERR_PGM_NOT_USED_IN_MODE;
 #endif
 }
@@ -2741,5 +2741,5 @@
         }
         else
-            AssertMsgFailedReturn(("rc=%Rrc\n", rc), VERR_INTERNAL_ERROR);
+            AssertMsgFailedReturn(("rc=%Rrc\n", rc), RT_FAILURE_NP(rc) ? rc : VERR_IPE_UNEXPECTED_INFO_STATUS);
         /** @todo Why do we bother preserving X86_PDE_AVL_MASK here?
          * Both PGM_PDFLAGS_MAPPING and PGM_PDFLAGS_TRACK_DIRTY should be
@@ -3170,5 +3170,5 @@
     {
        STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPT), a);
-       AssertMsgFailedReturn(("rc=%Rrc\n", rc), VERR_INTERNAL_ERROR);
+       AssertMsgFailedReturn(("rc=%Rrc\n", rc), RT_FAILURE_NP(rc) ? rc : VERR_IPE_UNEXPECTED_INFO_STATUS);
     }
 
@@ -3219,5 +3219,5 @@
     NOREF(iPDSrc); NOREF(pPDSrc);
     AssertReleaseMsgFailed(("Shw=%d Gst=%d is not implemented!\n", PGM_SHW_TYPE, PGM_GST_TYPE));
-    return VERR_INTERNAL_ERROR;
+    return VERR_PGM_NOT_USED_IN_MODE;
 #endif
 }
@@ -3553,5 +3553,5 @@
 
     AssertReleaseMsgFailed(("Shw=%d Gst=%d is not implemented!\n", PGM_GST_TYPE, PGM_SHW_TYPE));
-    return VERR_INTERNAL_ERROR;
+    return VERR_PGM_NOT_USED_IN_MODE;
 #endif /* PGM_SHW_TYPE == PGM_TYPE_EPT || PGM_SHW_TYPE == PGM_TYPE_NESTED */
 }
@@ -4435,5 +4435,5 @@
     pgmLock(pVM);
     PPGMPAGE    pPageCR3 = pgmPhysGetPage(pVM, GCPhysCR3);
-    AssertReturn(pPageCR3, VERR_INTERNAL_ERROR_2);
+    AssertReturn(pPageCR3, VERR_PGM_INVALID_CR3_ADDR);
     HCPhysGuestCR3 = PGM_PAGE_GET_HCPHYS(pPageCR3);
     /** @todo this needs some reworking wrt. locking?  */
@@ -4484,5 +4484,5 @@
                     pgmLock(pVM);
                     PPGMPAGE    pPage  = pgmPhysGetPage(pVM, GCPhys);
-                    AssertReturn(pPage, VERR_INTERNAL_ERROR_2);
+                    AssertReturn(pPage, VERR_PGM_INVALID_PDPE_ADDR);
                     HCPhys = PGM_PAGE_GET_HCPHYS(pPage);
 #  if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
Index: trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp	(revision 39402)
@@ -727,5 +727,5 @@
             }
             AssertMsgFailed(("whu?\n"));
-            rc = VERR_INTERNAL_ERROR;
+            rc = VERR_PGM_PHYS_HANDLER_IPE;
         }
         else
@@ -792,5 +792,5 @@
 
                     Assert(pCur3 == pCur2);
-                    rc = VERR_INTERNAL_ERROR;
+                    rc = VERR_PGM_PHYS_HANDLER_IPE;
                 }
                 else
@@ -915,5 +915,5 @@
             default:
                 AssertMsgFailed(("Invalid type %d! Corruption!\n",  pCur->enmType));
-                rc = VERR_INTERNAL_ERROR;
+                rc = VERR_PGM_PHYS_HANDLER_IPE;
                 break;
         }
Index: trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp	(revision 39402)
@@ -116,5 +116,5 @@
                 }
             }
-            else if (RT_UNLIKELY(rc == VERR_INTERNAL_ERROR))
+            else if (RT_UNLIKELY(rc == VERR_EM_INTERNAL_DISAS_ERROR))
                 return rc;
             break;
@@ -135,5 +135,5 @@
             AssertMsgFailedReturn(("enmProt=%d iPage=%d GCPhysFault=%RGp\n",
                                    pRom->aPages[iPage].enmProt, iPage, GCPhysFault),
-                                  VERR_INTERNAL_ERROR);
+                                  VERR_IPE_NOT_REACHED_DEFAULT_CASE);
     }
 
@@ -513,5 +513,5 @@
                             &&  pVM->pgm.s.cHandyPages <= RT_ELEMENTS(pVM->pgm.s.aHandyPages),
                             ("%u\n", pVM->pgm.s.cHandyPages),
-                            VERR_INTERNAL_ERROR);
+                            VERR_PGM_HANDY_PAGE_IPE);
         }
         else
@@ -1029,10 +1029,10 @@
     if (idChunk == NIL_GMM_CHUNKID)
     {
-        AssertMsgReturn(PGM_PAGE_GET_PAGEID(pPage) == NIL_GMM_PAGEID, ("pPage=%R[pgmpage]\n", pPage), VERR_INTERNAL_ERROR_2);
+        AssertMsgReturn(PGM_PAGE_GET_PAGEID(pPage) == NIL_GMM_PAGEID, ("pPage=%R[pgmpage]\n", pPage), VERR_PGM_PHYS_PAGE_MAP_IPE_1);
         if (PGM_PAGE_GET_TYPE(pPage) == PGMPAGETYPE_MMIO2)
         {
             /* Lookup the MMIO2 range and use pvR3 to calc the address. */
             PPGMRAMRANGE pRam = pgmPhysGetRange(pVM, GCPhys);
-            AssertMsgReturn(pRam || !pRam->pvR3, ("pRam=%p pPage=%R[pgmpage]\n", pRam, pPage), VERR_INTERNAL_ERROR_2);
+            AssertMsgReturn(pRam || !pRam->pvR3, ("pRam=%p pPage=%R[pgmpage]\n", pRam, pPage), VERR_PGM_PHYS_PAGE_MAP_IPE_2);
             *ppv = (void *)((uintptr_t)pRam->pvR3 + (uintptr_t)((GCPhys & ~(RTGCPHYS)PAGE_OFFSET_MASK) - pRam->GCPhys));
         }
@@ -1043,13 +1043,13 @@
              * them, that would also avoid this mess. It would actually be kind of
              * elegant... */
-            AssertLogRelMsgFailedReturn(("%RGp\n", GCPhys), VERR_INTERNAL_ERROR_3);
+            AssertLogRelMsgFailedReturn(("%RGp\n", GCPhys), VERR_PGM_MAP_MMIO2_ALIAS_MMIO);
         }
         else
         {
             /** @todo handle MMIO2 */
-            AssertMsgReturn(PGM_PAGE_IS_ZERO(pPage), ("pPage=%R[pgmpage]\n", pPage), VERR_INTERNAL_ERROR_2);
+            AssertMsgReturn(PGM_PAGE_IS_ZERO(pPage), ("pPage=%R[pgmpage]\n", pPage), VERR_PGM_PHYS_PAGE_MAP_IPE_3);
             AssertMsgReturn(PGM_PAGE_GET_HCPHYS(pPage) == pVM->pgm.s.HCPhysZeroPg,
                             ("pPage=%R[pgmpage]\n", pPage),
-                            VERR_INTERNAL_ERROR_2);
+                            VERR_PGM_PHYS_PAGE_MAP_IPE_4);
             *ppv = pVM->pgm.s.CTXALLSUFF(pvZeroPg);
         }
@@ -1306,5 +1306,5 @@
 {
     int rc;
-    AssertReturn(pPage, VERR_INTERNAL_ERROR);
+    AssertReturn(pPage, VERR_PGM_PHYS_NULL_PAGE_PARAM);
     PGM_LOCK_ASSERT_OWNER(pVM);
     pVM->pgm.s.cDeprecatedPageLocks++;
@@ -1436,5 +1436,5 @@
 {
     int rc;
-    AssertReturn(pPage, VERR_INTERNAL_ERROR);
+    AssertReturn(pPage, VERR_PGM_PHYS_NULL_PAGE_PARAM);
     PGM_LOCK_ASSERT_OWNER(pVM);
 
@@ -1499,5 +1499,5 @@
 int pgmPhysGCPhys2CCPtrInternalReadOnly(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, const void **ppv, PPGMPAGEMAPLOCK pLock)
 {
-    AssertReturn(pPage, VERR_INTERNAL_ERROR);
+    AssertReturn(pPage, VERR_PGM_PHYS_NULL_PAGE_PARAM);
     PGM_LOCK_ASSERT_OWNER(pVM);
     Assert(PGM_PAGE_GET_HCPHYS(pPage) != 0);
Index: trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp	(revision 39402)
@@ -2030,5 +2030,5 @@
         LogFlow(("pgmPoolCacheFreeOne: refuse CR3 mapping\n"));
         pgmPoolCacheUsed(pPool, pPage);
-        AssertLogRelReturn(iLoop < 8192, VERR_INTERNAL_ERROR);
+        AssertLogRelReturn(iLoop < 8192, VERR_PGM_POOL_TOO_MANY_LOOPS);
     }
 
@@ -4998,5 +4998,5 @@
         }
         iNew = pPool->iFreeHead;
-        AssertReleaseReturn(iNew != NIL_PGMPOOL_IDX, VERR_INTERNAL_ERROR);
+        AssertReleaseReturn(iNew != NIL_PGMPOOL_IDX, VERR_PGM_POOL_IPE);
     }
 
Index: trunk/src/VBox/VMM/VMMAll/PGMAllShw.h
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PGMAllShw.h	(revision 39400)
+++ trunk/src/VBox/VMM/VMMAll/PGMAllShw.h	(revision 39402)
@@ -306,5 +306,5 @@
 
         PPGMMAPPING pMap = pgmGetMapping(pVM, (RTGCPTR)GCPtr);
-        AssertMsgReturn(pMap, ("GCPtr=%RGv\n", GCPtr), VERR_INTERNAL_ERROR);
+        AssertMsgReturn(pMap, ("GCPtr=%RGv\n", GCPtr), VERR_PGM_MAPPING_IPE);
 #  if PGM_SHW_TYPE == PGM_TYPE_32BIT
         pPT = pMap->aPTs[(GCPtr - pMap->GCPtr) >> X86_PD_SHIFT].CTX_SUFF(pPT);
Index: trunk/src/VBox/VMM/VMMAll/TMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/TMAll.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMAll/TMAll.cpp	(revision 39402)
@@ -1347,5 +1347,5 @@
     AssertMsgFailed(("Failed waiting for stable state. state=%d (%s)\n", pTimer->enmState, R3STRING(pTimer->pszDesc)));
     STAM_PROFILE_STOP(&pVM->tm.s.CTX_SUFF_Z(StatTimerSet), a);
-    return VERR_INTERNAL_ERROR;
+    return VERR_TM_TIMER_UNSTABLE_STATE;
 }
 
@@ -1693,5 +1693,5 @@
         {
             AssertMsgFailed(("Failed waiting for stable state. state=%d (%s)\n", pTimer->enmState, R3STRING(pTimer->pszDesc)));
-            rc = VERR_INTERNAL_ERROR;
+            rc = VERR_TM_TIMER_UNSTABLE_STATE;
             tmTimerSetRelativeNowWorker(pVM, enmClock, pu64Now);
             break;
@@ -1922,5 +1922,5 @@
     AssertMsgFailed(("Failed waiting for stable state. state=%d (%s)\n", pTimer->enmState, R3STRING(pTimer->pszDesc)));
     STAM_PROFILE_STOP(&pVM->tm.s.CTX_SUFF_Z(StatTimerStop), a);
-    return VERR_INTERNAL_ERROR;
+    return VERR_TM_TIMER_UNSTABLE_STATE;
 }
 
@@ -2119,5 +2119,5 @@
         default:
             AssertMsgFailed(("Invalid enmClock=%d\n", pTimer->enmClock));
-            return VERR_INTERNAL_ERROR;
+            return VERR_TM_TIMER_BAD_CLOCK;
     }
 }
@@ -2149,5 +2149,5 @@
         default:
             AssertMsgFailed(("Invalid enmClock=%d\n", pTimer->enmClock));
-            return VERR_INTERNAL_ERROR;
+            return VERR_TM_TIMER_BAD_CLOCK;
     }
 }
@@ -2179,5 +2179,5 @@
         default:
             AssertMsgFailed(("Invalid enmClock=%d\n", pTimer->enmClock));
-            return VERR_INTERNAL_ERROR;
+            return VERR_TM_TIMER_BAD_CLOCK;
     }
 }
Index: trunk/src/VBox/VMM/VMMAll/TMAllCpu.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/TMAllCpu.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMAll/TMAllCpu.cpp	(revision 39402)
@@ -76,5 +76,5 @@
     }
     AssertFailed();
-    return VERR_INTERNAL_ERROR;
+    return VERR_TM_TSC_ALREADY_TICKING;
 }
 
@@ -96,5 +96,5 @@
     }
     AssertFailed();
-    return VERR_INTERNAL_ERROR;
+    return VERR_TM_TSC_ALREADY_PAUSED;
 }
 
Index: trunk/src/VBox/VMM/VMMAll/TMAllVirtual.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/TMAllVirtual.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMAll/TMAllVirtual.cpp	(revision 39402)
@@ -964,5 +964,5 @@
  * Worker for TMR3PauseClocks.
  *
- * @returns VINF_SUCCESS or VERR_INTERNAL_ERROR (asserted).
+ * @returns VINF_SUCCESS or VERR_TM_VIRTUAL_TICKING_IPE (asserted).
  * @param   pVM     The VM handle.
  */
@@ -970,5 +970,5 @@
 {
     uint32_t c = ASMAtomicDecU32(&pVM->tm.s.cVirtualTicking);
-    AssertMsgReturn(c < pVM->cCpus, ("%u vs %u\n", c, pVM->cCpus), VERR_INTERNAL_ERROR);
+    AssertMsgReturn(c < pVM->cCpus, ("%u vs %u\n", c, pVM->cCpus), VERR_TM_VIRTUAL_TICKING_IPE);
     if (c == 0)
     {
@@ -984,5 +984,5 @@
  * Worker for TMR3ResumeClocks.
  *
- * @returns VINF_SUCCESS or VERR_INTERNAL_ERROR (asserted).
+ * @returns VINF_SUCCESS or VERR_TM_VIRTUAL_TICKING_IPE (asserted).
  * @param   pVM     The VM handle.
  */
@@ -990,5 +990,5 @@
 {
     uint32_t c = ASMAtomicIncU32(&pVM->tm.s.cVirtualTicking);
-    AssertMsgReturn(c <= pVM->cCpus, ("%u vs %u\n", c, pVM->cCpus), VERR_INTERNAL_ERROR);
+    AssertMsgReturn(c <= pVM->cCpus, ("%u vs %u\n", c, pVM->cCpus), VERR_TM_VIRTUAL_TICKING_IPE);
     if (c == 1)
     {
Index: trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/GMMR0.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR0/GMMR0.cpp	(revision 39402)
@@ -595,9 +595,11 @@
 
 /** Macro for obtaining and validating the g_pGMM pointer.
- * On failure it will return from the invoking function with the specified return value.
+ *  
+ * On failure it will return from the invoking function with the specified
+ * return value. 
  *
  * @param   pGMM    The name of the pGMM variable.
- * @param   rc      The return value on failure. Use VERR_INTERNAL_ERROR for
- *                  VBox status codes.
+ * @param   rc      The return value on failure. Use VERR_GMM_INSTANCE for VBox
+ *                  status codes.
  */
 #define GMM_GET_VALID_INSTANCE(pGMM, rc) \
@@ -608,6 +610,8 @@
     } while (0)
 
-/** Macro for obtaining and validating the g_pGMM pointer, void function variant.
- * On failure it will return from the invoking function.
+/** Macro for obtaining and validating the g_pGMM pointer, void function
+ * variant. 
+ *  
+ * On failure it will return from the invoking function. 
  *
  * @param   pGMM    The name of the pGMM variable.
@@ -1097,5 +1101,5 @@
 static int gmmR0ChunkMutexDropGiant(PGMMR0CHUNKMTXSTATE pMtxState)
 {
-    AssertReturn(pMtxState->fFlags == GMMR0CHUNK_MTX_KEEP_GIANT, VERR_INTERNAL_ERROR_2);
+    AssertReturn(pMtxState->fFlags == GMMR0CHUNK_MTX_KEEP_GIANT, VERR_GMM_MTX_FLAGS);
     Assert(pMtxState->pGMM->hMtxOwner == RTThreadNativeSelf());
     pMtxState->fFlags = GMMR0CHUNK_MTX_RETAKE_GIANT;
@@ -1458,5 +1462,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
@@ -1502,5 +1506,5 @@
     }
     else
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
     gmmR0MutexRelease(pGMM);
     LogFlow(("GMMR0InitialReservation: returns %Rrc\n", rc));
@@ -1555,5 +1559,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
@@ -1596,5 +1600,5 @@
     }
     else
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
     gmmR0MutexRelease(pGMM);
     LogFlow(("GMMR0UpdateReservation: returns %Rrc\n", rc));
@@ -2070,8 +2074,8 @@
 
                 /* bail out */
-                rc = VERR_INTERNAL_ERROR;
+                rc = VERR_GMM_CHUNK_INSERT;
             }
             else
-                rc = VERR_INTERNAL_ERROR_5;
+                rc = VERR_GMM_IS_NOT_SANE;
             gmmR0MutexRelease(pGMM);
         }
@@ -2415,5 +2419,5 @@
             break;
         default:
-            AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_INTERNAL_ERROR);
+            AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
     }
 
@@ -2439,5 +2443,5 @@
         case GMMACCOUNT_SHADOW: pGVM->gmm.s.Allocated.cShadowPages += cPages; break;
         case GMMACCOUNT_FIXED:  pGVM->gmm.s.Allocated.cFixedPages  += cPages; break;
-        default:                AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_INTERNAL_ERROR);
+        default:                AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
     }
     pGVM->gmm.s.cPrivatePages += cPages;
@@ -2451,5 +2455,5 @@
     {
         iPage = gmmR0AllocatePagesInBoundMode(pGVM, iPage, cPages, paPages);
-        AssertReleaseReturn(iPage == cPages, VERR_INTERNAL_ERROR_3);
+        AssertReleaseReturn(iPage == cPages, VERR_GMM_ALLOC_PAGES_IPE);
         return VINF_SUCCESS;
     }
@@ -2528,5 +2532,5 @@
             case GMMACCOUNT_SHADOW: pGVM->gmm.s.Allocated.cShadowPages -= cPages; break;
             case GMMACCOUNT_FIXED:  pGVM->gmm.s.Allocated.cFixedPages  -= cPages; break;
-            default:                AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_INTERNAL_ERROR);
+            default:                AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
         }
 
@@ -2599,5 +2603,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
@@ -2755,5 +2759,5 @@
     }
     else
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
     gmmR0MutexRelease(pGMM);
     LogFlow(("GMMR0AllocateHandyPages: returns %Rrc\n", rc));
@@ -2793,5 +2797,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
@@ -2830,5 +2834,5 @@
     }
     else
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
     gmmR0MutexRelease(pGMM);
     LogFlow(("GMMR0AllocatePages: returns %Rrc\n", rc));
@@ -2892,5 +2896,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
@@ -2969,5 +2973,5 @@
     {
         gmmR0MutexRelease(pGMM);
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
     }
 
@@ -2993,5 +2997,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
@@ -3036,5 +3040,5 @@
     }
     else
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
 
     gmmR0MutexRelease(pGMM);
@@ -3310,5 +3314,5 @@
             break;
         default:
-            AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_INTERNAL_ERROR);
+            AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
     }
 
@@ -3381,5 +3385,5 @@
         case GMMACCOUNT_FIXED:  pGVM->gmm.s.Allocated.cFixedPages  -= iPage; break;
         default:
-            AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_INTERNAL_ERROR);
+            AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
     }
 
@@ -3415,5 +3419,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
@@ -3440,5 +3444,5 @@
     }
     else
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
     gmmR0MutexRelease(pGMM);
     LogFlow(("GMMR0FreePages: returns %Rrc\n", rc));
@@ -3507,5 +3511,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
@@ -3606,5 +3610,5 @@
     }
     else
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
 
     gmmR0MutexRelease(pGMM);
@@ -3658,5 +3662,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     pReq->cAllocPages     = pGMM->cAllocatedPages;
     pReq->cFreePages      = (pGMM->cChunks << (GMM_CHUNK_SHIFT- PAGE_SHIFT)) - pGMM->cAllocatedPages;
@@ -3692,5 +3696,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
@@ -3710,5 +3714,5 @@
     }
     else
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
 
     gmmR0MutexRelease(pGMM);
@@ -3977,5 +3981,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVM(pVM, &pGVM);
@@ -4042,5 +4046,5 @@
     }
     else
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
     gmmR0MutexRelease(pGMM);
 
@@ -4087,5 +4091,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
@@ -4174,5 +4178,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
@@ -4322,5 +4326,5 @@
     }
     else
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
 
 end:
@@ -4378,5 +4382,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
@@ -4443,5 +4447,5 @@
     }
     else
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
 
     gmmR0MutexRelease(pGMM);
@@ -4553,5 +4557,5 @@
     int rc = VINF_SUCCESS;
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     unsigned cPages = pModule->aRegions[idxRegion].cbRegion >> PAGE_SHIFT;
 
@@ -4701,5 +4705,5 @@
  * RTAvlGCPtrDestroy callback.
  *
- * @returns 0 or VERR_INTERNAL_ERROR.
+ * @returns 0 or VERR_GMM_INSTANCE.
  * @param   pNode   The node to destroy.
  * @param   pvGVM   The GVM handle.
@@ -4727,5 +4731,5 @@
             /* Remove from the tree and free memory. */
             PGMM pGMM;
-            GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+            GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
             RTAvlGCPtrRemove(&pGMM->pGlobalSharedModuleTree, pRec->Core.Key);
             RTMemFree(pRec);
@@ -4772,5 +4776,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
@@ -4791,5 +4795,5 @@
     }
     else
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
 
     gmmR0MutexRelease(pGMM);
@@ -4845,5 +4849,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
 
     /*
@@ -4852,5 +4856,5 @@
     gmmR0MutexAcquire(pGMM);
     if (!GMM_CHECK_SANITY_UPON_ENTERING(pGMM))
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
     else
         rc = VINF_SUCCESS;
@@ -4871,5 +4875,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
 
     gmmR0MutexRelease(pGMM);
@@ -4893,5 +4897,5 @@
      */
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
     PGVM pGVM;
     int rc = GVMMR0ByVMAndEMT(pVM, pVCpu->idCpu, &pGVM);
@@ -4923,5 +4927,5 @@
     }
     else
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
 
 # ifndef DEBUG_sandervl
@@ -5007,5 +5011,5 @@
 
     PGMM pGMM;
-    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
+    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
 
     PGVM pGVM;
@@ -5052,5 +5056,5 @@
     }
     else
-        rc = VERR_INTERNAL_ERROR_5;
+        rc = VERR_GMM_IS_NOT_SANE;
 
     gmmR0MutexRelease(pGMM);
Index: trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp	(revision 39402)
@@ -272,6 +272,6 @@
  *
  * @param   pGVMM   The name of the pGVMM variable.
- * @param   rc      The return value on failure. Use VERR_INTERNAL_ERROR for
- *                  VBox status codes.
+ * @param   rc      The return value on failure. Use VERR_GVMM_INSTANCE for VBox
+ *                  status codes.
  */
 #define GVMM_GET_VALID_INSTANCE(pGVMM, rc) \
@@ -322,5 +322,5 @@
      */
     uint32_t cHostCpus = RTMpGetArraySize();
-    AssertMsgReturn(cHostCpus > 0 && cHostCpus < _64K, ("%d", (int)cHostCpus), VERR_INTERNAL_ERROR_2);
+    AssertMsgReturn(cHostCpus > 0 && cHostCpus < _64K, ("%d", (int)cHostCpus), VERR_GVMM_HOST_CPU_RANGE);
 
     PGVMM pGVMM = (PGVMM)RTMemAllocZ(RT_UOFFSETOF(GVMM, aHostCpus[cHostCpus]));
@@ -535,5 +535,5 @@
      */
     PGVMM pGVMM;
-    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
+    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
     AssertPtrReturn(pSession, VERR_INVALID_HANDLE);
     AssertPtrReturn(pszName, VERR_INVALID_POINTER);
@@ -602,5 +602,5 @@
      */
     PGVMM pGVMM;
-    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
+    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
     AssertPtrReturn(pSession, VERR_INVALID_HANDLE);
     AssertPtrReturn(pszName, VERR_INVALID_POINTER);
@@ -740,5 +740,5 @@
     LogFlow(("GVMMR0CreateVM: pSession=%p\n", pSession));
     PGVMM pGVMM;
-    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
+    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
 
     AssertPtrReturn(ppVM, VERR_INVALID_POINTER);
@@ -750,7 +750,7 @@
 
     RTNATIVETHREAD hEMT0 = RTThreadNativeSelf();
-    AssertReturn(hEMT0 != NIL_RTNATIVETHREAD, VERR_INTERNAL_ERROR);
+    AssertReturn(hEMT0 != NIL_RTNATIVETHREAD, VERR_GVMM_BROKEN_IPRT);
     RTNATIVETHREAD ProcId = RTProcSelf();
-    AssertReturn(ProcId != NIL_RTPROCESS, VERR_INTERNAL_ERROR);
+    AssertReturn(ProcId != NIL_RTPROCESS, VERR_GVMM_BROKEN_IPRT);
 
     /*
@@ -927,5 +927,5 @@
         }
         else
-            rc = VERR_INTERNAL_ERROR;
+            rc = VERR_GVMM_IPE_1;
     }
     else
@@ -1066,5 +1066,5 @@
     LogFlow(("GVMMR0DestroyVM: pVM=%p\n", pVM));
     PGVMM pGVMM;
-    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
+    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
 
 
@@ -1118,5 +1118,5 @@
                     pHandle, pHandle->pVM, pHandle->hEMT0, pHandle->ProcId, pHandle->pvObj, pVM, hSelf);
         gvmmR0CreateDestroyUnlock(pGVMM);
-        rc = VERR_INTERNAL_ERROR;
+        rc = VERR_GVMM_IPE_2;
     }
 
@@ -1391,5 +1391,5 @@
     RTPROCESS ProcId = RTProcSelf();
     PGVMM pGVMM;
-    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
+    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
 
     /*
@@ -1484,5 +1484,5 @@
 {
     PGVMM pGVMM;
-    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
+    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
 
     /*
@@ -1503,12 +1503,12 @@
     RTPROCESS ProcId = RTProcSelf();
     AssertReturn(pHandle->ProcId == ProcId, VERR_NOT_OWNER);
-    AssertPtrReturn(pHandle->pvObj, VERR_INTERNAL_ERROR);
+    AssertPtrReturn(pHandle->pvObj, VERR_NOT_OWNER);
 
     PGVM pGVM = pHandle->pGVM;
-    AssertPtrReturn(pGVM, VERR_INTERNAL_ERROR);
-    AssertReturn(pGVM->pVM == pVM, VERR_INTERNAL_ERROR);
+    AssertPtrReturn(pGVM, VERR_NOT_OWNER);
+    AssertReturn(pGVM->pVM == pVM, VERR_NOT_OWNER);
     RTNATIVETHREAD hAllegedEMT = RTThreadNativeSelf();
     AssertReturn(idCpu < pGVM->cCpus, VERR_INVALID_CPU_ID);
-    AssertReturn(pGVM->aCpus[idCpu].hEMT == hAllegedEMT, VERR_INTERNAL_ERROR);
+    AssertReturn(pGVM->aCpus[idCpu].hEMT == hAllegedEMT, VERR_NOT_OWNER);
 
     *ppGVM = pGVM;
@@ -2352,5 +2352,5 @@
     else
     {
-        GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
+        GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
         memset(&pStats->SchedVM, 0, sizeof(pStats->SchedVM));
 
@@ -2501,5 +2501,5 @@
     else
     {
-        GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
+        GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
 
         int rc = gvmmR0UsedLock(pGVMM);
Index: trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp	(revision 39402)
@@ -926,5 +926,5 @@
      *       notification.  Kind of unlikely though, so ignored for now.
      */
-    AssertReturn(!g_HvmR0.fEnabled, VERR_INTERNAL_ERROR_3);
+    AssertReturn(!g_HvmR0.fEnabled, VERR_HM_ALREADY_ENABLED_IPE);
     ASMAtomicWriteBool(&g_HvmR0.fEnabled, true);
 
Index: trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp	(revision 39402)
@@ -280,5 +280,5 @@
         SVM_VMCB *pVMCB = (SVM_VMCB *)pVM->aCpus[i].hwaccm.s.svm.pVMCB;
 
-        AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_EM_INTERNAL_ERROR);
+        AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_HMSVM_INVALID_PVMCB);
 
         /* Program the control fields. Most of them never have to be changed again. */
@@ -661,5 +661,5 @@
 
     pVMCB = (SVM_VMCB *)pVCpu->hwaccm.s.svm.pVMCB;
-    AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_EM_INTERNAL_ERROR);
+    AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_HMSVM_INVALID_PVMCB);
 
     /* Guest CPU context: ES, CS, SS, DS, FS, GS. */
@@ -979,5 +979,5 @@
 
     pVMCB = (SVM_VMCB *)pVCpu->hwaccm.s.svm.pVMCB;
-    AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_EM_INTERNAL_ERROR);
+    AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_HMSVM_INVALID_PVMCB);
 
     /* We can jump to this point to resume execution after determining that a VM-exit is innocent.
@@ -1850,5 +1850,5 @@
         default:
             AssertMsgFailed(("Unexpected vm-exit caused by exception %x\n", vector));
-            rc = VERR_EM_INTERNAL_ERROR;
+            rc = VERR_HMSVM_UNEXPECTED_XCPT_EXIT;
             break;
 
@@ -2516,5 +2516,5 @@
     default:
         /* Unexpected exit codes. */
-        rc = VERR_EM_INTERNAL_ERROR;
+        rc = VERR_HMSVM_UNEXPECTED_EXIT;
         AssertMsgFailed(("Unexpected exit code %x\n", exitCode));                 /* Can't happen. */
         break;
@@ -2620,5 +2620,5 @@
             break;
         default:
-            AssertMsgFailedReturn(("Unexpected type %d\n", pPatch->enmType), VERR_INTERNAL_ERROR);
+            AssertMsgFailedReturn(("Unexpected type %d\n", pPatch->enmType), VERR_HMSVM_UNEXPECTED_PATCH_TYPE);
         }
     }
@@ -2793,5 +2793,5 @@
 
         pVMCB = (SVM_VMCB *)pVCpu->hwaccm.s.svm.pVMCB;
-        AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_EM_INTERNAL_ERROR);
+        AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_HMSVM_INVALID_PVMCB);
 
 #if HC_ARCH_BITS == 32
Index: trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp	(revision 39402)
@@ -2138,5 +2138,5 @@
         default:
             AssertFailed();
-            return VERR_INTERNAL_ERROR;
+            return VERR_HM_UNEXPECTED_LD_ST_MSR;
         }
     }
@@ -4817,5 +4817,5 @@
     RTHCUINTREG     uOldEFlags;
 
-    AssertReturn(pVM->hwaccm.s.pfnHost32ToGuest64R0, VERR_INTERNAL_ERROR);
+    AssertReturn(pVM->hwaccm.s.pfnHost32ToGuest64R0, VERR_HM_NO_32_TO_64_SWITCHER);
     Assert(pfnHandler);
     Assert(pVCpu->hwaccm.s.vmx.VMCSCache.Write.cValidEntries <= RT_ELEMENTS(pVCpu->hwaccm.s.vmx.VMCSCache.Write.aField));
Index: trunk/src/VBox/VMM/VMMR0/PGMR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/PGMR0.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR0/PGMR0.cpp	(revision 39402)
@@ -80,5 +80,5 @@
      */
     uint32_t iFirst = pVM->pgm.s.cHandyPages;
-    AssertReturn(iFirst <= RT_ELEMENTS(pVM->pgm.s.aHandyPages), VERR_INTERNAL_ERROR);
+    AssertReturn(iFirst <= RT_ELEMENTS(pVM->pgm.s.aHandyPages), VERR_PGM_HANDY_PAGE_IPE);
     uint32_t cPages = RT_ELEMENTS(pVM->pgm.s.aHandyPages) - iFirst;
     if (!cPages)
@@ -589,6 +589,6 @@
 #else
     AssertLogRelFailed();
-    return VERR_INTERNAL_ERROR_4;
-#endif
-}
-
+    return VERR_PGM_NOT_USED_IN_MODE;
+#endif
+}
+
Index: trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-amd64.asm
===================================================================
--- trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-amd64.asm	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-amd64.asm	(revision 39402)
@@ -21,5 +21,5 @@
 %include "VBox/asmdefs.mac"
 %include "VMMInternal.mac"
-%include "iprt/err.mac"
+%include "VBox/err.mac"
 %include "VBox/param.mac"
 
@@ -173,9 +173,9 @@
 
 .entry_error:
-    mov     eax, VERR_INTERNAL_ERROR_2
+    mov     eax, VERR_VMM_SET_JMP_ERROR
     jmp     .proper_return
 
 .stack_overflow:
-    mov     eax, VERR_INTERNAL_ERROR_5
+    mov     eax, VERR_VMM_SET_JMP_STACK_OVERFLOW
     jmp     .proper_return
 
@@ -195,5 +195,5 @@
     mov     r14, [xDX + VMMR0JMPBUF.r14]
     mov     r15, [xDX + VMMR0JMPBUF.r15]
-    mov     eax, VERR_INTERNAL_ERROR_3    ; todo better return code!
+    mov     eax, VERR_VMM_SET_JMP_ABORTED_RESUME
     leave
     ret
@@ -413,5 +413,5 @@
 .magic_ok:
 %endif
-    mov     eax, VERR_INTERNAL_ERROR_4
+    mov     eax, VERR_VMM_LONG_JMP_ERROR
 %ifdef RT_OS_WINDOWS
     add     rsp, 0a0h                   ; skip XMM registers since they are unmodified.
Index: trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-x86.asm
===================================================================
--- trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-x86.asm	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-x86.asm	(revision 39402)
@@ -179,14 +179,14 @@
 
 .entry_error:
-    mov     eax, VERR_INTERNAL_ERROR_2
+    mov     eax, VERR_VMM_SET_JMP_ERROR
     jmp     .proper_return
 
 .stack_overflow:
-    mov     eax, VERR_INTERNAL_ERROR_5
+    mov     eax, VERR_VMM_SET_JMP_STACK_OVERFLOW
     mov     edx, ebx
     jmp     .proper_return
 
 .stack_overflow_almost:
-    mov     eax, VERR_INTERNAL_ERROR
+    mov     eax, VERR_VMM_SET_JMP_STACK_OVERFLOW
     mov     edx, ebx
     jmp     .proper_return
@@ -200,5 +200,5 @@
     mov     esi, [xDX + VMMR0JMPBUF.esi]
     mov     ebx, [xDX + VMMR0JMPBUF.ebx]
-    mov     eax, VERR_INTERNAL_ERROR_3    ; todo better return code!
+    mov     eax, VERR_VMM_SET_JMP_ABORTED_RESUME
     ret
 
@@ -373,5 +373,5 @@
     pop     esi
     pop     edi
-    mov     eax, VERR_INTERNAL_ERROR_4
+    mov     eax, VERR_VMM_LONG_JMP_ERROR
     leave
     ret
Index: trunk/src/VBox/VMM/VMMR3/HWACCM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/HWACCM.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/HWACCM.cpp	(revision 39402)
@@ -2561,6 +2561,5 @@
 
     default:
-        AssertFailed();
-        return VERR_INTERNAL_ERROR;
+        AssertLogRelFailedReturn(VERR_INTERNAL_ERROR);
     }
 
Index: trunk/src/VBox/VMM/VMMR3/IOM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/IOM.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/IOM.cpp	(revision 39402)
@@ -952,5 +952,5 @@
                     AssertMsgFailed(("This cannot happen!\n"));
                     MMHyperFree(pVM, pRangeNew);
-                    rc = VERR_INTERNAL_ERROR;
+                    rc = VERR_IOM_IOPORT_IPE_1;
                 }
                 break;
@@ -1035,5 +1035,5 @@
                     AssertMsgFailed(("This cannot happen!\n"));
                     MMHyperFree(pVM, pRangeNew);
-                    rc = VERR_INTERNAL_ERROR;
+                    rc = VERR_IOM_IOPORT_IPE_1;
                 }
                 break;
@@ -1117,5 +1117,5 @@
                     AssertMsgFailed(("This cannot happen!\n"));
                     MMHyperFree(pVM, pRangeNew);
-                    rc = VERR_INTERNAL_ERROR;
+                    rc = VERR_IOM_IOPORT_IPE_1;
                 }
                 break;
@@ -1153,5 +1153,5 @@
         default:
             AssertReleaseMsgFailed(("cb=%d\n", cb));
-            return VERR_INTERNAL_ERROR;
+            return VERR_IOM_IOPORT_IPE_2;
     }
     return VINF_SUCCESS;
@@ -1489,5 +1489,5 @@
             DBGFR3Info(pVM, "mmio", NULL, NULL);
             AssertMsgFailed(("This cannot happen!\n"));
-            rc = VERR_INTERNAL_ERROR;
+            rc = VERR_IOM_IOPORT_IPE_3;
         }
         else
Index: trunk/src/VBox/VMM/VMMR3/MMHyper.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/MMHyper.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/MMHyper.cpp	(revision 39402)
@@ -582,5 +582,5 @@
                 RTHCPHYS HCPhys;
                 rc = PGMR3PhysMMIO2GetHCPhys(pVM, pDevIns, iRegion, offCur, &HCPhys);
-                AssertRCReturn(rc, VERR_INTERNAL_ERROR);
+                AssertRCReturn(rc, rc);
                 rc = PGMMap(pVM, GCPtr + (offCur - off), HCPhys, PAGE_SIZE, 0);
                 if (RT_FAILURE(rc))
Index: trunk/src/VBox/VMM/VMMR3/PDM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PDM.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/PDM.cpp	(revision 39402)
@@ -739,5 +739,5 @@
 {
     LogFlow(("pdmR3LiveExec:\n"));
-    AssertReturn(uPass == 0, VERR_INTERNAL_ERROR_4);
+    AssertReturn(uPass == 0, VERR_SSM_UNEXPECTED_PASS);
     pdmR3SaveBoth(pVM, pSSM);
     return VINF_SSM_DONT_CALL_AGAIN;
Index: trunk/src/VBox/VMM/VMMR3/PDMCritSect.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PDMCritSect.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/PDMCritSect.cpp	(revision 39402)
@@ -429,5 +429,5 @@
     PVM             pVM   = pCritSect->s.pVMR3;
     PUVM            pUVM  = pVM->pUVM;
-    AssertReleaseReturn(pVM, VERR_INTERNAL_ERROR);
+    AssertReleaseReturn(pVM, VERR_PDM_CRITSECT_IPE);
     PPDMCRITSECTINT pPrev = NULL;
     RTCritSectEnter(&pUVM->pdm.s.ListCritSect);
@@ -448,5 +448,5 @@
     RTCritSectLeave(&pUVM->pdm.s.ListCritSect);
     AssertReleaseMsgFailed(("pCritSect=%p wasn't found!\n", pCritSect));
-    return VERR_INTERNAL_ERROR;
+    return VERR_PDM_CRITSECT_NOT_FOUND;
 }
 
@@ -518,8 +518,8 @@
 
 #ifdef PDMCRITSECT_STRICT
-    int rc = PDMCritSectEnterDebug(pCritSect, VERR_INTERNAL_ERROR,
+    int rc = PDMCritSectEnterDebug(pCritSect, VERR_IGNORED,
                                    SrcPos.uId, SrcPos.pszFile, SrcPos.uLine, SrcPos.pszFunction);
 #else
-    int rc = PDMCritSectEnter(pCritSect, VERR_INTERNAL_ERROR);
+    int rc = PDMCritSectEnter(pCritSect, VERR_IGNORED);
 #endif
     AssertLogRelRC(rc);
Index: trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp	(revision 39402)
@@ -1093,5 +1093,5 @@
          */
         AssertMsgFailed(("Only one PCI device per device is currently implemented!\n"));
-        return VERR_INTERNAL_ERROR;
+        return VERR_PDM_ONE_PCI_FUNCTION_PER_DEVICE;
     }
 
@@ -1136,25 +1136,19 @@
         if (RT_SUCCESS(rc))
         {
-            if (u8Device > 31)
-            {
-                AssertMsgFailed(("Configuration error: PCIDeviceNo=%d, max is 31. (%s/%d)\n",
-                                 u8Device, pDevIns->pReg->szName, pDevIns->iInstance));
-                return VERR_INTERNAL_ERROR;
-            }
-
-            uint8_t     u8Function;
+            AssertMsgReturn(u8Device <= 31,
+                            ("Configuration error: PCIDeviceNo=%d, max is 31. (%s/%d)\n",
+                             u8Device, pDevIns->pReg->szName, pDevIns->iInstance),
+                            VERR_PDM_BAD_PCI_CONFIG);
+
+            uint8_t u8Function;
             rc = CFGMR3QueryU8(pDevIns->Internal.s.pCfgHandle, "PCIFunctionNo", &u8Function);
-            if (RT_FAILURE(rc))
-            {
-                AssertMsgFailed(("Configuration error: PCIDeviceNo, but PCIFunctionNo query failed with rc=%Rrc (%s/%d)\n",
-                                 rc, pDevIns->pReg->szName, pDevIns->iInstance));
-                return rc;
-            }
-            if (u8Function > 7)
-            {
-                AssertMsgFailed(("Configuration error: PCIFunctionNo=%d, max is 7. (%s/%d)\n",
-                                 u8Function, pDevIns->pReg->szName, pDevIns->iInstance));
-                return VERR_INTERNAL_ERROR;
-            }
+            AssertMsgRCReturn(rc, ("Configuration error: PCIDeviceNo, but PCIFunctionNo query failed with rc=%Rrc (%s/%d)\n",
+                                   rc, pDevIns->pReg->szName, pDevIns->iInstance),
+                              rc);
+            AssertMsgReturn(u8Function <= 7, 
+                            ("Configuration error: PCIFunctionNo=%d, max is 7. (%s/%d)\n",
+                             u8Function, pDevIns->pReg->szName, pDevIns->iInstance),
+                            VERR_PDM_BAD_PCI_CONFIG);
+
             iDev = (u8Device << 3) | u8Function;
         }
@@ -1610,5 +1604,5 @@
     VM_ASSERT_STATE_RETURN(pVM, VMSTATE_CREATING, VERR_WRONG_ORDER);
 
-    AssertReturn(pDevIns->pCritSectRoR3, VERR_INTERNAL_ERROR_4);
+    AssertReturn(pDevIns->pCritSectRoR3, VERR_PDM_DEV_IPE_1);
     AssertReturn(pDevIns->pCritSectRoR3->s.fAutomaticDefaultCritsect, VERR_WRONG_ORDER);
     AssertReturn(!pDevIns->pCritSectRoR3->s.fUsedByTimerOrSimilar, VERR_WRONG_ORDER);
Index: trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp	(revision 39402)
@@ -579,5 +579,5 @@
         {
             PPDMIHPETLEGACYNOTIFY pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIHPETLEGACYNOTIFY);
-            AssertLogRelMsgBreakStmt(pPort, ("%s\n", s_apszDevsToNotify[i]), rc = VERR_INTERNAL_ERROR_3);
+            AssertLogRelMsgBreakStmt(pPort, ("%s\n", s_apszDevsToNotify[i]), rc = VERR_PDM_HPET_LEGACY_NOTIFY_MISSING);
             pPort->pfnModeChanged(pPort, fActivated);
         }
Index: trunk/src/VBox/VMM/VMMR3/PDMThread.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PDMThread.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/PDMThread.cpp	(revision 39402)
@@ -86,5 +86,5 @@
         default:
             AssertMsgFailed(("%d\n", pThread->Internal.s.enmType));
-            rc = VERR_INTERNAL_ERROR;
+            rc = VERR_PDM_THREAD_IPE_1;
             break;
     }
@@ -156,5 +156,5 @@
                 if (    RT_SUCCESS(rc)
                     &&  pThread->enmState != PDMTHREADSTATE_SUSPENDED)
-                    rc = VERR_INTERNAL_ERROR;
+                    rc = VERR_PDM_THREAD_IPE_2;
                 if (RT_SUCCESS(rc))
                 {
@@ -409,5 +409,5 @@
                 default:
                     AssertMsgFailed(("enmState=%d\n", enmState));
-                    rc = VERR_INTERNAL_ERROR;
+                    rc = VERR_PDM_THREAD_IPE_2;
                     break;
             }
@@ -668,5 +668,5 @@
 
             if (RT_SUCCESS(rc))
-                rc = VERR_INTERNAL_ERROR;
+                rc = VERR_PDM_THREAD_IPE_2;
         }
     }
@@ -732,6 +732,6 @@
      * Assert sanity.
      */
-    AssertReturn(pThread->enmState > PDMTHREADSTATE_INVALID && pThread->enmState < PDMTHREADSTATE_TERMINATED, VERR_INTERNAL_ERROR);
-    AssertReturn(pThread->Thread == RTThreadSelf(), VERR_INTERNAL_ERROR);
+    AssertReturn(pThread->enmState > PDMTHREADSTATE_INVALID && pThread->enmState < PDMTHREADSTATE_TERMINATED, VERR_PDM_THREAD_IPE_2);
+    AssertReturn(pThread->Thread == RTThreadSelf(), VERR_PDM_THREAD_INVALID_CALLER);
 
     /*
@@ -798,5 +798,5 @@
             default:
                 AssertMsgFailed(("%d\n", pThread->Internal.s.enmType));
-                rc = VERR_INTERNAL_ERROR;
+                rc = VERR_PDM_THREAD_IPE_1;
                 break;
         }
@@ -947,5 +947,5 @@
                     if (    RT_SUCCESS(rc)
                         &&  pThread->enmState != PDMTHREADSTATE_SUSPENDED)
-                        rc = VERR_INTERNAL_ERROR;
+                        rc = VERR_PDM_THREAD_IPE_2;
                     if (RT_SUCCESS(rc))
                         return rc;
@@ -1040,5 +1040,5 @@
                 if (    RT_SUCCESS(rc)
                     &&  pThread->enmState != PDMTHREADSTATE_RUNNING)
-                    rc = VERR_INTERNAL_ERROR;
+                    rc = VERR_PDM_THREAD_IPE_2;
                 if (RT_SUCCESS(rc))
                     return rc;
Index: trunk/src/VBox/VMM/VMMR3/PGM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGM.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/PGM.cpp	(revision 39402)
@@ -2216,5 +2216,5 @@
             }
 #else
-            AssertLogRelReturn(!pVM->pgm.s.fPciPassthrough, VERR_INTERNAL_ERROR_5);
+            AssertLogRelReturn(!pVM->pgm.s.fPciPassthrough, VERR_PGM_PCI_PASSTHRU_MISCONFIG);
 #endif
             break;
Index: trunk/src/VBox/VMM/VMMR3/PGMMap.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGMMap.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/PGMMap.cpp	(revision 39402)
@@ -551,6 +551,6 @@
     AssertMsgReturn(cb && !(cb & X86_PAGE_4M_OFFSET_MASK), ("cb (%#x) is 0 or not aligned on a 4MB address!\n", cb),
                     VERR_INVALID_PARAMETER);
-    AssertReturn(pgmMapAreMappingsEnabled(pVM), VERR_INTERNAL_ERROR_3);
-    AssertReturn(pVM->cCpus == 1, VERR_INTERNAL_ERROR_4);
+    AssertReturn(pgmMapAreMappingsEnabled(pVM), VERR_PGM_MAPPINGS_DISABLED);
+    AssertReturn(pVM->cCpus == 1, VERR_PGM_MAPPINGS_SMP);
 
     /*
@@ -684,6 +684,6 @@
 VMMR3DECL(int) PGMR3MappingsDisable(PVM pVM)
 {
-    AssertReturn(!pVM->pgm.s.fMappingsFixed,            VERR_INTERNAL_ERROR_4);
-    AssertReturn(!pVM->pgm.s.fMappingsFixedRestored,    VERR_INTERNAL_ERROR_4);
+    AssertReturn(!pVM->pgm.s.fMappingsFixed,            VERR_PGM_MAPPINGS_FIXED);
+    AssertReturn(!pVM->pgm.s.fMappingsFixedRestored,    VERR_PGM_MAPPINGS_FIXED);
     if (pVM->pgm.s.fMappingsDisabled)
         return VINF_SUCCESS;
Index: trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp	(revision 39402)
@@ -3394,5 +3394,5 @@
                 AssertMsgFailedReturn(("enmProt=%d iPage=%d GCPhys=%RGp\n",
                                        pRom->aPages[iPage].enmProt, iPage, GCPhys),
-                                      VERR_INTERNAL_ERROR);
+                                      VERR_IPE_NOT_REACHED_DEFAULT_CASE);
         }
     }
@@ -3432,5 +3432,5 @@
                 {
                     pShadowPage = pgmPhysGetPage(pVM, GCPhys);
-                    AssertLogRelReturn(pShadowPage, VERR_INTERNAL_ERROR);
+                    AssertLogRelReturn(pShadowPage, VERR_PGM_PHYS_PAGE_GET_IPE);
                 }
 
@@ -3450,5 +3450,5 @@
                 AssertMsgFailedReturn(("enmProt=%d iPage=%d GCPhys=%RGp\n",
                                        pRom->aPages[iPage].enmProt, iPage, GCPhys),
-                                      VERR_INTERNAL_ERROR);
+                                      VERR_IPE_NOT_REACHED_DEFAULT_CASE);
         }
     }
@@ -4240,5 +4240,5 @@
      */
     uint32_t iClear = pVM->pgm.s.cHandyPages;
-    AssertMsgReturn(iClear <= RT_ELEMENTS(pVM->pgm.s.aHandyPages), ("%d", iClear), VERR_INTERNAL_ERROR);
+    AssertMsgReturn(iClear <= RT_ELEMENTS(pVM->pgm.s.aHandyPages), ("%d", iClear), VERR_PGM_HANDY_PAGE_IPE);
     Log(("PGMR3PhysAllocateHandyPages: %d -> %d\n", iClear, RT_ELEMENTS(pVM->pgm.s.aHandyPages)));
     int rcAlloc = VINF_SUCCESS;
Index: trunk/src/VBox/VMM/VMMR3/PGMPool.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGMPool.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/PGMPool.cpp	(revision 39402)
@@ -459,5 +459,5 @@
 {
     PPGMPOOL pPool = pVM->pgm.s.pPoolR3;
-    AssertReturn(pPool->cCurPages < pPool->cMaxPages, VERR_INTERNAL_ERROR);
+    AssertReturn(pPool->cCurPages < pPool->cMaxPages, VERR_PGM_POOL_MAXED_OUT_ALREADY);
 
     pgmLock(pVM);
Index: trunk/src/VBox/VMM/VMMR3/PGMSavedState.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGMSavedState.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/PGMSavedState.cpp	(revision 39402)
@@ -1998,5 +1998,5 @@
     {
         pgmUnlock(pVM);
-        AssertLogRelFailedReturn(VERR_INTERNAL_ERROR_2);
+        AssertLogRelFailedReturn(VERR_PGM_WRITE_MONITOR_ENGAGED);
     }
     pVM->pgm.s.fPhysWriteMonitoringEngaged = true;
@@ -2266,5 +2266,5 @@
         rc = pgmR3LoadPageBitsOld(pVM, pSSM, uType, pPage, GCPhys, pRam);
     else
-        rc = VERR_INTERNAL_ERROR;
+        rc = VERR_PGM_INVALID_SAVED_PAGE_STATE;
     AssertLogRelMsgRCReturn(rc, ("pPage=%R[pgmpage] uState=%d uType=%d GCPhys=%RGp %s rc=%Rrc\n",
                                  pPage, uState, uType, GCPhys, pRam->pszDesc, rc),
@@ -2291,5 +2291,5 @@
      */
     PPGMROMPAGE pRomPage = pgmR3GetRomPage(pVM, GCPhys);
-    AssertLogRelMsgReturn(pRomPage, ("GCPhys=%RGp %s\n", GCPhys, pRam->pszDesc), VERR_INTERNAL_ERROR);
+    AssertLogRelMsgReturn(pRomPage, ("GCPhys=%RGp %s\n", GCPhys, pRam->pszDesc), VERR_PGM_SAVED_ROM_PAGE_NOT_FOUND);
 
     uint8_t uProt;
@@ -2306,5 +2306,5 @@
         rc = PGMR3PhysRomProtect(pVM, GCPhys, PAGE_SIZE, enmProt);
         AssertLogRelRCReturn(rc, rc);
-        AssertLogRelReturn(pRomPage->enmProt == enmProt, VERR_INTERNAL_ERROR);
+        AssertLogRelReturn(pRomPage->enmProt == enmProt, VERR_PGM_SAVED_ROM_PAGE_PROT);
     }
 
@@ -2677,5 +2677,5 @@
                         }
 
-                        AssertLogRelMsgReturn(PGM_PAGE_GET_STATE(pPage) == PGM_PAGE_STATE_ALLOCATED, ("GCPhys=%RGp %R[pgmpage]\n", GCPhys, pPage), VERR_INTERNAL_ERROR_5);
+                        AssertLogRelMsgReturn(PGM_PAGE_GET_STATE(pPage) == PGM_PAGE_STATE_ALLOCATED, ("GCPhys=%RGp %R[pgmpage]\n", GCPhys, pPage), VERR_PGM_UNEXPECTED_PAGE_STATE);
 
                         /* If this is a ROM page, we must clear it and not try
@@ -2717,5 +2717,5 @@
                             AssertLogRelMsgReturn(   PGM_PAGE_GET_PDE_TYPE(pPage) != PGM_PAGE_PDE_TYPE_PDE
                                                   && PGM_PAGE_GET_PDE_TYPE(pPage) != PGM_PAGE_PDE_TYPE_PDE_DISABLED,
-                                                     ("GCPhys=%RGp %R[pgmpage]\n", GCPhys, pPage), VERR_INTERNAL_ERROR_5);
+                                                     ("GCPhys=%RGp %R[pgmpage]\n", GCPhys, pPage), VERR_PGM_LOAD_UNEXPECTED_PAGE_TYPE);
 
                             rc = pgmPhysFreePage(pVM, pReq, &cPendingPages, pPage, GCPhys);
@@ -2741,5 +2741,5 @@
 
                     default:
-                        AssertMsgFailedReturn(("%#x\n", u8), VERR_INTERNAL_ERROR);
+                        AssertMsgFailedReturn(("%#x\n", u8), VERR_PGM_SAVED_REC_TYPE);
                 }
                 id = UINT8_MAX;
@@ -2771,7 +2771,7 @@
                         if (pMmio2->idSavedState == id)
                             break;
-                    AssertLogRelMsgReturn(pMmio2, ("id=%#u iPage=%#x\n", id, iPage), VERR_INTERNAL_ERROR);
+                    AssertLogRelMsgReturn(pMmio2, ("id=%#u iPage=%#x\n", id, iPage), VERR_PGM_SAVED_MMIO2_RANGE_NOT_FOUND);
                 }
-                AssertLogRelMsgReturn(iPage < (pMmio2->RamRange.cb >> PAGE_SHIFT), ("iPage=%#x cb=%RGp %s\n", iPage, pMmio2->RamRange.cb, pMmio2->RamRange.pszDesc), VERR_INTERNAL_ERROR);
+                AssertLogRelMsgReturn(iPage < (pMmio2->RamRange.cb >> PAGE_SHIFT), ("iPage=%#x cb=%RGp %s\n", iPage, pMmio2->RamRange.cb, pMmio2->RamRange.pszDesc), VERR_PGM_SAVED_MMIO2_PAGE_NOT_FOUND);
                 void *pvDstPage = (uint8_t *)pMmio2->RamRange.pvR3 + ((size_t)iPage << PAGE_SHIFT);
 
@@ -2817,7 +2817,7 @@
                         if (pRom->idSavedState == id)
                             break;
-                    AssertLogRelMsgReturn(pRom, ("id=%#u iPage=%#x\n", id, iPage), VERR_INTERNAL_ERROR);
+                    AssertLogRelMsgReturn(pRom, ("id=%#u iPage=%#x\n", id, iPage), VERR_PGM_SAVED_ROM_RANGE_NOT_FOUND);
                 }
-                AssertLogRelMsgReturn(iPage < (pRom->cb >> PAGE_SHIFT), ("iPage=%#x cb=%RGp %s\n", iPage, pRom->cb, pRom->pszDesc), VERR_INTERNAL_ERROR);
+                AssertLogRelMsgReturn(iPage < (pRom->cb >> PAGE_SHIFT), ("iPage=%#x cb=%RGp %s\n", iPage, pRom->cb, pRom->pszDesc), VERR_PGM_SAVED_ROM_PAGE_NOT_FOUND);
                 PPGMROMPAGE pRomPage = &pRom->aPages[iPage];
                 GCPhys = pRom->GCPhys + ((RTGCPHYS)iPage << PAGE_SHIFT);
@@ -2831,5 +2831,5 @@
                     return rc;
                 PGMROMPROT enmProt = (PGMROMPROT)u8Prot;
-                AssertLogRelMsgReturn(enmProt > PGMROMPROT_INVALID && enmProt < PGMROMPROT_END, ("GCPhys=%RGp enmProt=%d\n", GCPhys, enmProt), VERR_INTERNAL_ERROR);
+                AssertLogRelMsgReturn(enmProt > PGMROMPROT_INVALID && enmProt < PGMROMPROT_END, ("GCPhys=%RGp enmProt=%d\n", GCPhys, enmProt), VERR_PGM_SAVED_ROM_PAGE_PROT);
 
                 if (enmProt != pRomPage->enmProt)
@@ -2841,5 +2841,5 @@
                     rc = PGMR3PhysRomProtect(pVM, GCPhys, PAGE_SIZE, enmProt);
                     AssertLogRelMsgRCReturn(rc, ("GCPhys=%RGp rc=%Rrc\n", GCPhys, rc), rc);
-                    AssertLogRelReturn(pRomPage->enmProt == enmProt, VERR_INTERNAL_ERROR);
+                    AssertLogRelReturn(pRomPage->enmProt == enmProt, VERR_PGM_SAVED_ROM_PAGE_PROT);
                 }
                 if ((u8 & ~PGM_STATE_REC_FLAG_ADDR) == PGM_STATE_REC_ROM_PROT)
@@ -2871,5 +2871,5 @@
                         break;
 
-                    default: AssertLogRelFailedReturn(VERR_INTERNAL_ERROR); /* shut up gcc */
+                    default: AssertLogRelFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE); /* shut up gcc */
                 }
                 if (!pRealPage)
@@ -2925,5 +2925,5 @@
              */
             default:
-                AssertLogRelMsgFailedReturn(("%#x\n", u8), VERR_INTERNAL_ERROR);
+                AssertLogRelMsgFailedReturn(("%#x\n", u8), VERR_PGM_SAVED_REC_TYPE);
         }
     } /* forever */
Index: trunk/src/VBox/VMM/VMMR3/SELM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/SELM.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/SELM.cpp	(revision 39402)
@@ -1719,5 +1719,5 @@
     {
         Log(("SELMR3DebugCheck: ldt is out of bound SelLdt=%#x\n", SelLdt));
-        return VERR_INTERNAL_ERROR;
+        return VERR_SELM_LDT_OUT_OF_BOUNDS;
     }
     X86DESC    LDTDesc;
@@ -1745,5 +1745,5 @@
     {
         Log(("SELmR3DebugCheck: Invalid LDT %04x!\n", SelLdt));
-        return VERR_INTERNAL_ERROR;
+        return VERR_SELM_INVALID_LDT;
     }
 
Index: trunk/src/VBox/VMM/VMMR3/SSM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/SSM.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/SSM.cpp	(revision 39402)
@@ -964,5 +964,5 @@
     }
     AssertFailed();
-    return VERR_INTERNAL_ERROR_3;
+    return VERR_SSM_UNEXPECTED_PASS;
 }
 
@@ -2769,5 +2769,5 @@
     {
         uint64_t offCur = ssmR3StrmTell(pStrm);
-        AssertReturn(offCur <= offDst, VERR_INTERNAL_ERROR_4);
+        AssertReturn(offCur <= offDst, VERR_SSM_SKIP_BACKWARDS);
         if (offCur == offDst)
             return VINF_SUCCESS;
@@ -3188,5 +3188,5 @@
     }
     else
-        AssertLogRelMsgFailedReturn(("cb=%#x\n", cb), pSSM->rc = VERR_INTERNAL_ERROR);
+        AssertLogRelMsgFailedReturn(("cb=%#x\n", cb), pSSM->rc = VERR_SSM_MEM_TOO_BIG);
 
     Log3(("ssmR3DataWriteRecHdr: %08llx|%08llx/%08x: Type=%02x fImportant=%RTbool cbHdr=%u\n",
@@ -4257,5 +4257,5 @@
                     break;
                 default:
-                    rc = VERR_INTERNAL_ERROR;
+                    rc = VERR_SSM_IPE_1;
                     break;
             }
@@ -4605,5 +4605,5 @@
                 break;
             default:
-                rc = VERR_INTERNAL_ERROR;
+                rc = VERR_SSM_IPE_1;
                 break;
         }
@@ -4692,5 +4692,5 @@
                     break;
                 default:
-                    rc = VERR_INTERNAL_ERROR;
+                    rc = VERR_SSM_IPE_1;
                     break;
             }
@@ -5032,5 +5032,5 @@
                     break;
                 default:
-                    rc = VERR_INTERNAL_ERROR;
+                    rc = VERR_SSM_IPE_1;
                     break;
             }
@@ -5170,5 +5170,5 @@
                 break;
             default:
-                rc = VERR_INTERNAL_ERROR;
+                rc = VERR_SSM_IPE_1;
                 break;
         }
@@ -5327,5 +5327,5 @@
                     break;
                 default:
-                    rc = VERR_INTERNAL_ERROR;
+                    rc = VERR_SSM_IPE_1;
                     break;
             }
@@ -5904,5 +5904,5 @@
                 break;
             default:
-                return VERR_INTERNAL_ERROR;
+                return VERR_IPE_NOT_REACHED_DEFAULT_CASE;
         }
 
@@ -5952,5 +5952,5 @@
                 break;
             default:
-                return VERR_INTERNAL_ERROR;
+                return VERR_IPE_NOT_REACHED_DEFAULT_CASE;
         }
 
@@ -6072,5 +6072,5 @@
 
             default:
-                AssertMsgFailedReturn(("%x\n", pSSM->u.Read.u8TypeAndFlags), VERR_INTERNAL_ERROR_5);
+                AssertMsgFailedReturn(("%x\n", pSSM->u.Read.u8TypeAndFlags), VERR_SSM_BAD_REC_TYPE);
         }
 
@@ -6173,5 +6173,5 @@
 
             default:
-                AssertMsgFailedReturn(("%x\n", pSSM->u.Read.u8TypeAndFlags), VERR_INTERNAL_ERROR_5);
+                AssertMsgFailedReturn(("%x\n", pSSM->u.Read.u8TypeAndFlags), VERR_SSM_BAD_REC_TYPE);
         }
         /*pSSM->u.Read.offDataBuffer = 0;*/
@@ -7483,5 +7483,5 @@
         }
         else
-            AssertFailedReturn(VERR_INTERNAL_ERROR);
+            AssertFailedReturn(VERR_SSM_IPE_2);
         if (!pSSM->u.Read.fStreamCrc32)
             ssmR3StrmDisableChecksumming(&pSSM->Strm);
@@ -7581,5 +7581,5 @@
         }
         else
-            AssertFailedReturn(VERR_INTERNAL_ERROR);
+            AssertFailedReturn(VERR_SSM_IPE_1);
 
         /*
@@ -7894,5 +7894,5 @@
                                 break;
                             default:
-                                rc = VERR_INTERNAL_ERROR;
+                                rc = VERR_SSM_IPE_1;
                                 break;
                         }
@@ -8156,5 +8156,5 @@
                     break;
                 default:
-                    rc = VERR_INTERNAL_ERROR;
+                    rc = VERR_SSM_IPE_1;
                     break;
             }
@@ -8323,5 +8323,5 @@
                         break;
                     default:
-                        rc = VERR_INTERNAL_ERROR;
+                        rc = VERR_SSM_IPE_1;
                         break;
                 }
@@ -8394,5 +8394,5 @@
                         break;
                     default:
-                        rc = VERR_INTERNAL_ERROR;
+                        rc = VERR_SSM_IPE_1;
                         break;
                 }
@@ -9121,5 +9121,5 @@
         {
             AssertLogRelMsgFailed(("fCancelled=%RX32 enmOp=%d\n", u32Old, pSSM->enmOp));
-            rc = VERR_INTERNAL_ERROR_2;
+            rc = VERR_SSM_IPE_3;
         }
     }
Index: trunk/src/VBox/VMM/VMMR3/TM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/TM.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/TM.cpp	(revision 39402)
@@ -224,7 +224,7 @@
      */
     pVM->tm.s.pvGIPR3 = (void *)g_pSUPGlobalInfoPage;
-    AssertMsgReturn(pVM->tm.s.pvGIPR3, ("GIP support is now required!\n"), VERR_INTERNAL_ERROR);
+    AssertMsgReturn(pVM->tm.s.pvGIPR3, ("GIP support is now required!\n"), VERR_TM_GIP_REQUIRED);
     AssertMsgReturn((g_pSUPGlobalInfoPage->u32Version >> 16) == (SUPGLOBALINFOPAGE_VERSION >> 16),
-                    ("Unsupported GIP version!\n"), VERR_INTERNAL_ERROR);
+                    ("Unsupported GIP version!\n"), VERR_TM_GIP_VERSION);
 
     RTHCPHYS HCPhysGIP;
@@ -251,5 +251,5 @@
     if (    g_pSUPGlobalInfoPage->u32Magic == SUPGLOBALINFOPAGE_MAGIC
         &&  g_pSUPGlobalInfoPage->u32UpdateIntervalNS >= 250000000 /* 0.25s */)
-        return VMSetError(pVM, VERR_INTERNAL_ERROR, RT_SRC_POS,
+        return VMSetError(pVM, VERR_TM_GIP_UPDATE_INTERVAL_TOO_BIG, RT_SRC_POS,
                           N_("The GIP update interval is too big. u32UpdateIntervalNS=%RU32 (u32UpdateHz=%RU32)"),
                           g_pSUPGlobalInfoPage->u32UpdateIntervalNS, g_pSUPGlobalInfoPage->u32UpdateHz);
@@ -282,5 +282,5 @@
     pVM->tm.s.VirtualGetRawDataRC.pu64Prev = MMHyperR3ToRC(pVM, (void *)&pVM->tm.s.u64VirtualRawPrev);
     pVM->tm.s.VirtualGetRawDataR0.pu64Prev = MMHyperR3ToR0(pVM, (void *)&pVM->tm.s.u64VirtualRawPrev);
-    AssertReturn(pVM->tm.s.VirtualGetRawDataR0.pu64Prev, VERR_INTERNAL_ERROR);
+    AssertRelease(pVM->tm.s.VirtualGetRawDataR0.pu64Prev);
     /* The rest is done in TMR3InitFinalize since it's too early to call PDM. */
 
@@ -1994,5 +1994,5 @@
         PPDMCRITSECT    pCritSect = pTimer->pCritSect;
         if (pCritSect)
-            PDMCritSectEnter(pCritSect, VERR_INTERNAL_ERROR);
+            PDMCritSectEnter(pCritSect, VERR_IGNORED);
         Log2(("tmR3TimerQueueRun: %p:{.enmState=%s, .enmClock=%d, .enmType=%d, u64Expire=%llx (now=%llx) .pszDesc=%s}\n",
               pTimer, tmTimerState(pTimer->enmState), pTimer->enmClock, pTimer->enmType, pTimer->u64Expire, u64Now, pTimer->pszDesc));
@@ -2181,5 +2181,5 @@
         PPDMCRITSECT pCritSect = pTimer->pCritSect;
         if (pCritSect)
-            PDMCritSectEnter(pCritSect, VERR_INTERNAL_ERROR);
+            PDMCritSectEnter(pCritSect, VERR_IGNORED);
 
         Log2(("tmR3TimerQueueRun: %p:{.enmState=%s, .enmClock=%d, .enmType=%d, u64Expire=%llx (now=%llx) .pszDesc=%s}\n",
Index: trunk/src/VBox/VMM/VMMR3/VM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/VM.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/VM.cpp	(revision 39402)
@@ -1218,5 +1218,5 @@
     AssertMsgReturn(enmVMState == VMSTATE_POWERING_ON,
                     ("%s\n", VMR3GetStateName(enmVMState)),
-                    VERR_INTERNAL_ERROR_4);
+                    VERR_VM_UNEXPECTED_UNSTABLE_STATE);
 
     /*
@@ -1311,5 +1311,5 @@
                     ||  enmVMState == VMSTATE_SUSPENDING_EXT_LS,
                     ("%s\n", VMR3GetStateName(enmVMState)),
-                    VERR_INTERNAL_ERROR_4);
+                    VERR_VM_UNEXPECTED_UNSTABLE_STATE);
 
     /*
@@ -1325,5 +1325,5 @@
                                  VMSTATE_SUSPENDED_EXT_LS, VMSTATE_SUSPENDING_EXT_LS);
         if (RT_FAILURE(rc))
-            return VERR_INTERNAL_ERROR_3;
+            return VERR_VM_UNEXPECTED_UNSTABLE_STATE;
     }
 
@@ -1389,5 +1389,5 @@
     AssertMsgReturn(enmVMState == VMSTATE_RESUMING,
                     ("%s\n", VMR3GetStateName(enmVMState)),
-                    VERR_INTERNAL_ERROR_4);
+                    VERR_VM_UNEXPECTED_UNSTABLE_STATE);
 
 #if 0
@@ -1504,5 +1504,5 @@
             default:
                 AssertMsgFailed(("%s\n", VMR3GetStateName(enmVMState)));
-                rc = VERR_INTERNAL_ERROR_3;
+                rc = VERR_VM_UNEXPECTED_VM_STATE;
                 break;
         }
@@ -1518,5 +1518,5 @@
     AssertMsgReturn(enmVMState == VMSTATE_SUSPENDING_LS,
                     ("%s\n", VMR3GetStateName(enmVMState)),
-                    VERR_INTERNAL_ERROR_4);
+                    VERR_VM_UNEXPECTED_UNSTABLE_STATE);
 
     /*
@@ -1529,5 +1529,5 @@
                                  VMSTATE_SUSPENDED_LS, VMSTATE_SUSPENDING_LS);
         if (RT_FAILURE(rc))
-            return VERR_INTERNAL_ERROR_3;
+            return VERR_VM_UNEXPECTED_UNSTABLE_STATE;
 
         *pfSuspended = true;
@@ -2551,5 +2551,5 @@
         for (PVMREQ pReq = pReqHead; pReq; pReq = pReq->pNext)
         {
-            ASMAtomicUoWriteS32(&pReq->iStatus, VERR_INTERNAL_ERROR);
+            ASMAtomicUoWriteS32(&pReq->iStatus, VERR_VM_REQUEST_KILLED);
             ASMAtomicWriteSize(&pReq->enmState, VMREQSTATE_INVALID);
             RTSemEventSignal(pReq->EventSem);
@@ -2581,5 +2581,5 @@
             for (PVMREQ pReq = pReqHead; pReq; pReq = pReq->pNext)
             {
-                ASMAtomicUoWriteS32(&pReq->iStatus, VERR_INTERNAL_ERROR);
+                ASMAtomicUoWriteS32(&pReq->iStatus, VERR_VM_REQUEST_KILLED);
                 ASMAtomicWriteSize(&pReq->enmState, VMREQSTATE_INVALID);
                 RTSemEventSignal(pReq->EventSem);
@@ -2797,5 +2797,5 @@
                           || enmVMState == VMSTATE_RESETTING_LS,
                           ("%s\n", VMR3GetStateName(enmVMState)),
-                          VERR_INTERNAL_ERROR_4);
+                          VERR_VM_UNEXPECTED_UNSTABLE_STATE);
 
     /*
Index: trunk/src/VBox/VMM/VMMR3/VMEmt.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/VMEmt.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/VMEmt.cpp	(revision 39402)
@@ -307,5 +307,5 @@
     if (pUVCpu->pVM)
         VM_FF_SET(pUVCpu->pVM, VM_FF_CHECK_VM_STATE);
-    return VERR_INTERNAL_ERROR;
+    return VERR_VM_FATAL_WAIT_ERROR;
 }
 
Index: trunk/src/VBox/VMM/VMMR3/VMM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/VMM.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/VMM.cpp	(revision 39402)
@@ -526,5 +526,5 @@
         LogRel(("R0 init failed, rc=%Rra\n", rc));
         if (RT_SUCCESS(rc))
-            rc = VERR_INTERNAL_ERROR;
+            rc = VERR_IPE_UNEXPECTED_INFO_STATUS;
     }
     return rc;
@@ -602,5 +602,5 @@
             VMMR3FatalDump(pVM, pVCpu, rc);
             if (rc >= VINF_EM_FIRST && rc <= VINF_EM_LAST)
-                rc = VERR_INTERNAL_ERROR;
+                rc = VERR_IPE_UNEXPECTED_INFO_STATUS;
         }
         AssertRC(rc);
@@ -736,5 +736,5 @@
         LogRel(("VMMR3Term: R0 term failed, rc=%Rra. (warning)\n", rc));
         if (RT_SUCCESS(rc))
-            rc = VERR_INTERNAL_ERROR;
+            rc = VERR_IPE_UNEXPECTED_INFO_STATUS;
     }
 
@@ -1972,5 +1972,5 @@
     AssertLogRelMsgReturn(rc == VINF_SUCCESS || RT_FAILURE(rc),
                           ("uOperation=%u rc=%Rrc\n", uOperation, rc),
-                          VERR_INTERNAL_ERROR);
+                          VERR_IPE_UNEXPECTED_INFO_STATUS);
     return rc;
 }
@@ -2194,5 +2194,5 @@
         default:
             AssertMsgFailed(("enmCallRing3Operation=%d\n", pVCpu->vmm.s.enmCallRing3Operation));
-            return VERR_INTERNAL_ERROR;
+            return VERR_VMM_UNKNOWN_RING3_CALL;
     }
 
Index: trunk/src/VBox/VMM/VMMR3/VMMSwitcher.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/VMMSwitcher.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/VMMSwitcher.cpp	(revision 39402)
@@ -992,5 +992,5 @@
 /** @todo r=bird: I would suggest that we create a dummy switcher which just does something like:
  * @code
- *       mov eax, VERR_INTERNAL_ERROR
+ *       mov eax, VERR_VMM_DUMMY_SWITCHER
  *       ret
  * @endcode
Index: trunk/src/VBox/VMM/VMMR3/VMReq.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/VMReq.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMR3/VMReq.cpp	(revision 39402)
@@ -1186,5 +1186,5 @@
                 default:
                     AssertReleaseMsgFailed(("cArgs=%d\n", pReq->u.Internal.cArgs));
-                    rcRet = rcReq = VERR_INTERNAL_ERROR;
+                    rcRet = rcReq = VERR_VM_REQUEST_TOO_MANY_ARGS_IPE;
                     break;
             }
Index: trunk/src/VBox/VMM/VMMRC/IOMRC.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMRC/IOMRC.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMRC/IOMRC.cpp	(revision 39402)
@@ -87,5 +87,5 @@
         default:
             AssertMsgFailed(("Unknown I/O port access opcode %d.\n", pCpu->pCurInstr->opcode));
-            return VERR_INTERNAL_ERROR;
+            return VERR_IOM_IOPORT_UNKNOWN_OPCODE;
     }
 }
Index: trunk/src/VBox/VMM/VMMRC/MMRamRC.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMRC/MMRamRC.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMRC/MMRamRC.cpp	(revision 39402)
@@ -143,5 +143,5 @@
     {
         /* Must be a read violation. */
-        AssertReturn(!(TRPMGetErrorCode(VMMGetCpu0(pVM)) & X86_TRAP_PF_RW), VERR_INTERNAL_ERROR);
+        AssertReturn(!(TRPMGetErrorCode(VMMGetCpu0(pVM)) & X86_TRAP_PF_RW), VERR_MM_BAD_TRAP_TYPE_IPE);
         pRegFrame->eip = (uintptr_t)&MMGCRamRead_Error;
         return VINF_SUCCESS;
@@ -155,5 +155,5 @@
     {
         /* Must be a write violation. */
-        AssertReturn(TRPMGetErrorCode(VMMGetCpu0(pVM)) & X86_TRAP_PF_RW, VERR_INTERNAL_ERROR);
+        AssertReturn(TRPMGetErrorCode(VMMGetCpu0(pVM)) & X86_TRAP_PF_RW, VERR_MM_BAD_TRAP_TYPE_IPE);
         pRegFrame->eip = (uintptr_t)&MMGCRamWrite_Error;
         return VINF_SUCCESS;
Index: trunk/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp	(revision 39402)
@@ -344,5 +344,5 @@
      */
     int rc = DBGFRZTrap01Handler(pVM, pVCpu, pRegFrame, uDr6);
-    AssertStmt(rc != VINF_EM_RAW_GUEST_TRAP, rc = VERR_INTERNAL_ERROR_3);
+    AssertStmt(rc != VINF_EM_RAW_GUEST_TRAP, rc = VERR_TRPM_IPE_1);
 
     Log6(("TRPMGCHyper01: %Rrc (%04x:%08x %RTreg)\n", rc, pRegFrame->cs, pRegFrame->eip, uDr6));
@@ -462,5 +462,5 @@
      */
     int rc = DBGFRZTrap03Handler(pVM, pVCpu, pRegFrame);
-    AssertStmt(rc != VINF_EM_RAW_GUEST_TRAP, rc = VERR_INTERNAL_ERROR_3);
+    AssertStmt(rc != VINF_EM_RAW_GUEST_TRAP, rc = VERR_TRPM_IPE_2);
 
     Log6(("TRPMGCHyper03: %Rrc (%04x:%08x)\n", rc, pRegFrame->cs, pRegFrame->eip));
@@ -1317,5 +1317,5 @@
             default:
                 AssertMsgFailed(("Invalid uUser=%#x\n", uUser));
-                return VERR_INTERNAL_ERROR;
+                return VERR_TRPM_BAD_TRAP_IN_OP;
         }
     }
@@ -1379,5 +1379,5 @@
             default:
                 AssertMsgFailed(("Invalid uUser=%#x\n", uUser));
-                return VERR_INTERNAL_ERROR;
+                return VERR_TRPM_BAD_TRAP_IN_OP;
         }
 
@@ -1388,5 +1388,5 @@
 
     AssertMsgFailed(("Impossible!\n"));
-    return VERR_INTERNAL_ERROR;
-}
-
+    return VERR_TRPM_IPE_3;
+}
+
Index: trunk/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp	(revision 39402)
@@ -338,5 +338,5 @@
  * Initializes the auto mapping sets for a VM.
  *
- * @returns VINF_SUCCESS on success, VERR_INTERNAL_ERROR on failure.
+ * @returns VINF_SUCCESS on success, VERR_PGM_DYNMAP_IPE on failure.
  * @param   pVM         The VM in question.
  */
@@ -344,5 +344,5 @@
 {
     VMCPUID idCpu = pVM->cCpus;
-    AssertReturn(idCpu > 0 && idCpu <= VMM_MAX_CPU_COUNT, VERR_INTERNAL_ERROR);
+    AssertReturn(idCpu > 0 && idCpu <= VMM_MAX_CPU_COUNT, VERR_PGM_DYNMAP_IPE);
     while (idCpu-- > 0)
     {
@@ -400,5 +400,5 @@
             break;
         default:
-            rc = VERR_INTERNAL_ERROR;
+            rc = VERR_PGM_DYNMAP_IPE;
             break;
     }
@@ -489,5 +489,5 @@
      */
     PPGMRZDYNMAP pThis = g_pPGMR0DynMap;
-    AssertPtrReturn(pThis, VERR_INTERNAL_ERROR);
+    AssertPtrReturn(pThis, VERR_PGM_DYNMAP_IPE);
     rc = RTSemFastMutexRequest(pThis->hInitLock);
     AssertLogRelRCReturn(rc, rc);
@@ -819,5 +819,5 @@
             ASMIntEnable();
             if (i + 1 == pPgLvl->cLevels)
-                AssertReturn(pSeg->cPTs < cMaxPTs, VERR_INTERNAL_ERROR);
+                AssertReturn(pSeg->cPTs < cMaxPTs, VERR_PGM_DYNMAP_IPE);
             else
             {
@@ -872,5 +872,5 @@
                     i, pPgLvl->cLevels, uEntry, pPgLvl->a[i].fAndMask, pPgLvl->a[i].fResMask, uEntry & pPgLvl->a[i].fAndMask,
                     pPgLvl->a[i].u.pv, pvPage, iEntry, pThis->fLegacyMode));
-            return VERR_INTERNAL_ERROR;
+            return VERR_PGM_DYNMAP_IPE;
         }
         /*Log(("#%d: iEntry=%4d uEntry=%#llx pvEntry=%p HCPhys=%RHp \n", i, iEntry, uEntry, pvEntry, pPgLvl->a[i].HCPhys));*/
@@ -1007,5 +1007,5 @@
                 LogRel(("pgmR0DynMapAddSeg: internal error - page #%u HCPhysPage=%RHp HCPhysPte=%RHp pbPage=%p pvPte=%p\n",
                         iPage - pSeg->iPage, HCPhysPage, HCPhysPte, pbPage, pThis->paPages[iPage].uPte.pv));
-                rc = VERR_INTERNAL_ERROR;
+                rc = VERR_PGM_DYNMAP_IPE;
                 break;
             }
@@ -1089,5 +1089,5 @@
     uint32_t cMinPages;
     uint32_t cPages = pgmR0DynMapCalcNewSize(pThis, &cMinPages);
-    AssertReturn(cPages, VERR_INTERNAL_ERROR);
+    AssertReturn(cPages, VERR_PGM_DYNMAP_IPE);
     int rc = pgmR0DynMapAddSeg(pThis, cPages);
     if (rc == VERR_NO_MEMORY)
@@ -1132,5 +1132,5 @@
     uint32_t cMinPages;
     uint32_t cPages = pgmR0DynMapCalcNewSize(pThis, &cMinPages);
-    AssertReturn(cPages, VERR_INTERNAL_ERROR);
+    AssertReturn(cPages, VERR_PGM_DYNMAP_IPE);
     if (pThis->cPages >= cPages)
         return VINF_SUCCESS;
@@ -1578,5 +1578,5 @@
             RTAssertMsg1Weak(#expr, __LINE__, __FILE__, __PRETTY_FUNCTION__); \
             RTAssertMsg2Weak a; \
-            return VERR_INTERNAL_ERROR; \
+            return VERR_PGM_DYNMAP_IPE; \
         } \
     } while (0)
@@ -2529,10 +2529,10 @@
         {
             LogRel(("failed(%d): rc=%Rrc; pv=%p pv2=%p i=%p\n", __LINE__, rc, pv, pv2, i));
-            if (RT_SUCCESS(rc)) rc = VERR_INTERNAL_ERROR;
+            if (RT_SUCCESS(rc)) rc = VERR_PGM_DYNMAP_IPE;
         }
         else if (pSet->cEntries != 5)
         {
             LogRel(("failed(%d): cEntries=%d expected %d\n", __LINE__, pSet->cEntries, RT_ELEMENTS(pSet->aEntries) / 2));
-            rc = VERR_INTERNAL_ERROR;
+            rc = VERR_PGM_DYNMAP_IPE;
         }
         else if (   pSet->aEntries[4].cRefs != UINT16_MAX - 1
@@ -2546,5 +2546,5 @@
                 LogRel(("[%d]=%d, ", i, pSet->aEntries[i].cRefs));
             LogRel(("\n"));
-            rc = VERR_INTERNAL_ERROR;
+            rc = VERR_PGM_DYNMAP_IPE;
         }
         if (RT_SUCCESS(rc))
@@ -2568,10 +2568,10 @@
             {
                 LogRel(("failed(%d): rc=%Rrc; pv=%p pv2=%p i=%d\n", __LINE__, rc, pv, pv2, i));
-                if (RT_SUCCESS(rc)) rc = VERR_INTERNAL_ERROR;
+                if (RT_SUCCESS(rc)) rc = VERR_PGM_DYNMAP_IPE;
             }
             else if (pSet->cEntries != RT_ELEMENTS(pSet->aEntries))
             {
                 LogRel(("failed(%d): cEntries=%d expected %d\n", __LINE__, pSet->cEntries, RT_ELEMENTS(pSet->aEntries)));
-                rc = VERR_INTERNAL_ERROR;
+                rc = VERR_PGM_DYNMAP_IPE;
             }
             LogRel(("Load=%u/%u/%u Set=%u/%u\n", pThis->cLoad, pThis->cMaxLoad, pThis->cPages - pThis->cPages, pSet->cEntries, RT_ELEMENTS(pSet->aEntries)));
@@ -2611,5 +2611,5 @@
                     LogRel(("failed(%d): rc=%Rrc, wanted %d ; pv2=%p Set=%u/%u; i=%d\n", __LINE__,
                             rc, VERR_PGM_DYNMAP_FULL_SET, pv2, pSet->cEntries, RT_ELEMENTS(pSet->aEntries), i));
-                    if (RT_SUCCESS(rc)) rc = VERR_INTERNAL_ERROR;
+                    if (RT_SUCCESS(rc)) rc = VERR_PGM_DYNMAP_IPE;
                 }
             }
@@ -2649,5 +2649,5 @@
                 LogRel(("failed(%d): cFailures=%d pu32Real=%p pu32=%p u32Expect=%#x *pu32=%#x\n", __LINE__,
                         Test.cFailures, pu32Real, Test.pu32, Test.u32Expect, *Test.pu32));
-                rc = VERR_INTERNAL_ERROR;
+                rc = VERR_PGM_DYNMAP_IPE;
             }
             else
Index: trunk/src/VBox/VMM/VMMRZ/VMMRZ.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMRZ/VMMRZ.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/VMMRZ/VMMRZ.cpp	(revision 39402)
@@ -80,5 +80,5 @@
     pVCpu->vmm.s.enmCallRing3Operation = enmOperation;
     pVCpu->vmm.s.u64CallRing3Arg = uArg;
-    pVCpu->vmm.s.rcCallRing3 = VERR_INTERNAL_ERROR;
+    pVCpu->vmm.s.rcCallRing3 = VERR_VMM_RING3_CALL_NO_RC;
 #ifdef IN_RC
     pVM->vmm.s.pfnGuestToHostRC(VINF_VMM_CALL_HOST);
Index: trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
===================================================================
--- trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp	(revision 39400)
+++ trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp	(revision 39402)
@@ -75,5 +75,5 @@
     static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0, a_Type1 a_Name1) RT_NO_THROW
 
-#define IEM_NOT_REACHED_DEFAULT_CASE_RET()                  default: return VERR_INTERNAL_ERROR_4
+#define IEM_NOT_REACHED_DEFAULT_CASE_RET()                  default: return VERR_IPE_NOT_REACHED_DEFAULT_CASE
 
 #define IEM_OPCODE_GET_NEXT_U8(a_pu8)                       do { *(a_pu8)  = g_bRandom; CHK_PTYPE(uint8_t  *, a_pu8);  } while (0)
