VirtualBox

Changeset 39405 in vbox for trunk/src


Ignore:
Timestamp:
Nov 23, 2011 7:30:29 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
75023
Message:

VMM: Don't use generic IPE status codes, use specific ones. Part 2.

Location:
trunk/src/VBox/VMM
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp

    r39402 r39405  
    873873
    874874    /* Should never happen */
    875     if (pCpu->hMemObj == NIL_RTR0MEMOBJ)
    876     {
    877         AssertLogRelMsgFailed(("hmR0EnableCpu failed idCpu=%u.\n", idCpu));
    878         return VERR_INTERNAL_ERROR;
    879     }
     875    AssertLogRelMsgReturn(pCpu->hMemObj != NIL_RTR0MEMOBJ, ("hmR0EnableCpu failed idCpu=%u.\n", idCpu), VERR_HM_IPE_1);
    880876
    881877    void    *pvCpuPage     = RTR0MemObjAddress(pCpu->hMemObj);
     
    14771473    /* Keep track of the CPU owning the VMCS for debugging scheduling weirdness
    14781474       and ring-3 calls. */
    1479 #ifdef RT_STRICT
    1480     if (RT_UNLIKELY(   pVCpu->hwaccm.s.idEnteredCpu != idCpu
    1481                     && RT_FAILURE(rc)))
    1482     {
    1483         AssertMsgFailed(("Owner is %d, I'm %d", (int)pVCpu->hwaccm.s.idEnteredCpu, (int)idCpu));
    1484         rc = VERR_INTERNAL_ERROR;
    1485     }
    1486 #endif
     1475    AssertMsgStmt(   pVCpu->hwaccm.s.idEnteredCpu == idCpu
     1476                  || RT_FAILURE_NP(rc),
     1477                  ("Owner is %u, I'm %u", pVCpu->hwaccm.s.idEnteredCpu, idCpu),
     1478                  rc = VERR_HM_WRONG_CPU_1);
    14871479    pVCpu->hwaccm.s.idEnteredCpu = NIL_RTCPUID;
    14881480
     
    17131705
    17141706        default:
    1715             AssertFailed();
    1716             return VERR_INTERNAL_ERROR;
     1707            AssertFailedReturn(VERR_HM_WRONG_SWITCHER);
    17171708    }
    17181709
    17191710    PHMGLOBLCPUINFO pCpu = HWACCMR0GetCurrentCpu();
    1720     AssertReturn(pCpu && pCpu->hMemObj != NIL_RTR0MEMOBJ, VERR_INTERNAL_ERROR);
     1711    AssertReturn(pCpu && pCpu->hMemObj != NIL_RTR0MEMOBJ, VERR_HM_IPE_2);
    17211712
    17221713    *pfVTxDisabled = true;
     
    17471738
    17481739    PHMGLOBLCPUINFO pCpu = HWACCMR0GetCurrentCpu();
    1749     AssertReturn(pCpu && pCpu->hMemObj != NIL_RTR0MEMOBJ, VERR_INTERNAL_ERROR);
     1740    AssertReturn(pCpu && pCpu->hMemObj != NIL_RTR0MEMOBJ, VERR_HM_IPE_2);
    17501741
    17511742    void           *pvCpuPage     = RTR0MemObjAddress(pCpu->hMemObj);
  • trunk/src/VBox/VMM/VMMR3/CFGM.cpp

    r36819 r39405  
    556556
    557557            default:
    558                 rc = VERR_INTERNAL_ERROR;
     558                rc = VERR_CFGM_IPE_1;
    559559                AssertMsgFailed(("Invalid value type %d\n", pLeaf->enmType));
    560560                break;
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r39078 r39405  
    392392     * completely overridden by VirtualBox custom strings.  Some
    393393     * CPUID information is withheld, like the cache info. */
    394     rc = CFGMR3QueryBoolDef(pCpumCfg, "SyntheticCpu",  &pCPUM->fSyntheticCpu,  false);
     394    rc = CFGMR3QueryBoolDef(pCpumCfg, "SyntheticCpu",  &pCPUM->fSyntheticCpu, false);
    395395    AssertRCReturn(rc, rc);
    396396
     
    403403    AssertRCReturn(rc, rc);
    404404
    405     AssertLogRelReturn(!pCPUM->fSyntheticCpu || !pCPUM->u8PortableCpuIdLevel, VERR_INTERNAL_ERROR_2);
     405    AssertLogRelReturn(!pCPUM->fSyntheticCpu || !pCPUM->u8PortableCpuIdLevel, VERR_CPUM_INCOMPATIBLE_CONFIG);
    406406
    407407    /*
     
    19091909static DECLCALLBACK(int) cpumR3LiveExec(PVM pVM, PSSMHANDLE pSSM, uint32_t uPass)
    19101910{
    1911     AssertReturn(uPass == 0, VERR_INTERNAL_ERROR_4);
     1911    AssertReturn(uPass == 0, VERR_SSM_UNEXPECTED_PASS);
    19121912    cpumR3SaveCpuId(pVM, pSSM);
    19131913    return VINF_SSM_DONT_CALL_AGAIN;
  • trunk/src/VBox/VMM/VMMR3/CPUMDbg.cpp

    r39078 r39405  
    5151        case DBGFREGVALTYPE_U128:      pValue->u128 = *(PCRTUINT128U    )pv; return VINF_SUCCESS;
    5252        default:
    53             AssertMsgFailedReturn(("%d %s\n", pDesc->enmType, pDesc->pszName), VERR_INTERNAL_ERROR_3);
     53            AssertMsgFailedReturn(("%d %s\n", pDesc->enmType, pDesc->pszName), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    5454    }
    5555}
     
    9797
    9898        default:
    99             AssertMsgFailedReturn(("%d %s\n", pDesc->enmType, pDesc->pszName), VERR_INTERNAL_ERROR_3);
     99            AssertMsgFailedReturn(("%d %s\n", pDesc->enmType, pDesc->pszName), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    100100    }
    101101}
     
    280280        case DBGFREGVALTYPE_U32:    pValue->u32 = (uint32_t)u64Value; break;
    281281        default:
    282             AssertFailedReturn(VERR_INTERNAL_ERROR_4);
     282            AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    283283    }
    284284    return VINF_SUCCESS;
     
    314314            fMaskMax = UINT32_MAX;
    315315            break;
    316         default:                    AssertFailedReturn(VERR_INTERNAL_ERROR_4);
     316        default:                   
     317            AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    317318    }
    318319    if (fMask != fMaskMax)
     
    337338        case 8: rc = PDMApicSetTPR(pVCpu, (uint8_t)(u64Value << 4)); break;
    338339        default:
    339             AssertFailedReturn(VERR_INTERNAL_ERROR_2);
     340            AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    340341    }
    341342    return rc;
     
    359360        case DBGFREGVALTYPE_U32:    pValue->u32 = (uint32_t)u64Value; break;
    360361        default:
    361             AssertFailedReturn(VERR_INTERNAL_ERROR_4);
     362            AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    362363    }
    363364    return VINF_SUCCESS;
     
    393394            fMaskMax = UINT32_MAX;
    394395            break;
    395         default:                    AssertFailedReturn(VERR_INTERNAL_ERROR_4);
     396        default:                   
     397            AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    396398    }
    397399    if (fMask != fMaskMax)
     
    430432            case DBGFREGVALTYPE_U16:    pValue->u16 = (uint16_t)u64Value; break;
    431433            default:
    432                 AssertFailedReturn(VERR_INTERNAL_ERROR_4);
     434                AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    433435        }
    434436    }
     
    471473            fMaskMax = UINT16_MAX;
    472474            break;
    473         default:                    AssertFailedReturn(VERR_INTERNAL_ERROR_4);
     475        default:                   
     476            AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    474477    }
    475478    if (fMask != fMaskMax)
     
    555558        case 8: u64Value = UINT64_MAX; break;
    556559        default:
    557             AssertFailedReturn(VERR_INTERNAL_ERROR_3);
     560            AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    558561    }
    559562    switch (pDesc->enmType)
     
    562565        case DBGFREGVALTYPE_U32:    pValue->u32 = (uint32_t)u64Value; break;
    563566        default:
    564             AssertFailedReturn(VERR_INTERNAL_ERROR_4);
     567            AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    565568    }
    566569    return VINF_SUCCESS;
     
    597600        case 7: u64Value = CPUMGetHyperDR7(pVCpu); break;
    598601        default:
    599             AssertFailedReturn(VERR_INTERNAL_ERROR_3);
     602            AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    600603    }
    601604    switch (pDesc->enmType)
     
    604607        case DBGFREGVALTYPE_U32:    pValue->u32 = (uint32_t)u64Value; break;
    605608        default:
    606             AssertFailedReturn(VERR_INTERNAL_ERROR_4);
     609            AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    607610    }
    608611    return VINF_SUCCESS;
     
    636639        case DBGFREGVALTYPE_U16:    pValue->u16 = (uint16_t)u64Value; break;
    637640        default:
    638             AssertFailedReturn(VERR_INTERNAL_ERROR_4);
     641            AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    639642    }
    640643    return VINF_SUCCESS;
  • trunk/src/VBox/VMM/VMMR3/DBGFBp.cpp

    r38838 r39405  
    746746
    747747            default:
    748                 AssertMsgFailed(("Invalid enmType=%d!\n", pBp->enmType));
    749                 return VERR_INTERNAL_ERROR;
     748                AssertMsgFailedReturn(("Invalid enmType=%d!\n", pBp->enmType), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    750749        }
    751750        AssertRCReturn(rc, rc);
     
    823822
    824823        default:
    825             AssertMsgFailed(("Invalid enmType=%d!\n", pBp->enmType));
    826             return VERR_INTERNAL_ERROR;
     824            AssertMsgFailedReturn(("Invalid enmType=%d!\n", pBp->enmType), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    827825    }
    828826    if (RT_FAILURE(rc))
     
    896894
    897895        default:
    898             AssertMsgFailed(("Invalid enmType=%d!\n", pBp->enmType));
    899             return VERR_INTERNAL_ERROR;
     896            AssertMsgFailedReturn(("Invalid enmType=%d!\n", pBp->enmType), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    900897    }
    901898
  • trunk/src/VBox/VMM/VMMR3/DBGFInfo.cpp

    r39078 r39405  
    772772
    773773            default:
    774                 AssertMsgFailed(("Invalid info type enmType=%d\n", Info.enmType));
    775                 rc = VERR_INTERNAL_ERROR;
    776                 break;
     774                AssertMsgFailedReturn(("Invalid info type enmType=%d\n", Info.enmType), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    777775        }
    778776    }
     
    931929
    932930                default:
    933                     AssertMsgFailed(("Invalid info type enmType=%d\n", pInfo->enmType));
    934                     rc = VERR_INTERNAL_ERROR;
    935                     break;
     931                    AssertMsgFailedReturn(("Invalid info type enmType=%d\n", pInfo->enmType), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    936932            }
    937933        }
  • trunk/src/VBox/VMM/VMMR3/DBGFR3Trace.cpp

    r39078 r39405  
    7878    if (rc != VERR_BUFFER_OVERFLOW)
    7979    {
    80         AssertReturn(!RT_SUCCESS_NP(rc), VERR_INTERNAL_ERROR_4);
     80        AssertReturn(!RT_SUCCESS_NP(rc), VERR_IPE_UNEXPECTED_INFO_STATUS);
    8181        return rc;
    8282    }
  • trunk/src/VBox/VMM/VMMR3/DBGFReg.cpp

    r39078 r39405  
    10451045                        break;
    10461046                    default:
    1047                         AssertMsgFailedReturn(("%s %d\n", pDesc->pszName, pDesc->enmType), VERR_INTERNAL_ERROR_3);
     1047                        AssertMsgFailedReturn(("%s %d\n", pDesc->pszName, pDesc->enmType), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    10481048                }
    10491049            }
     
    18731873            ssize_t cch = RTStrFormatU64(pszTmp, cbTmp, pValue->dtr.u64Base,
    18741874                                         16, 2+16, 0, RTSTR_F_SPECIAL | RTSTR_F_ZEROPAD);
    1875             AssertReturn(cch > 0, VERR_INTERNAL_ERROR_4);
     1875            AssertReturn(cch > 0, VERR_DBGF_REG_IPE_1);
    18761876            pszTmp[cch++] = ':';
    18771877            cch += RTStrFormatU64(&pszTmp[cch], cbTmp - cch, pValue->dtr.u32Limit,
     
    18881888
    18891889    RTStrPrintf(pszTmp, cbTmp, "!enmType=%d!", enmType);
    1890     return VERR_INTERNAL_ERROR_5;
     1890    return VERR_DBGF_REG_IPE_2;
    18911891}
    18921892
  • trunk/src/VBox/VMM/VMMR3/DBGFStack.cpp

    r38838 r39405  
    181181        case 4:    pFrame->AddrReturnFrame.off = *uBp.pu32; break;
    182182        case 8:    pFrame->AddrReturnFrame.off = *uBp.pu64; break;
    183         default:    AssertMsgFailed(("cbStackItem=%d\n", cbStackItem)); return VERR_INTERNAL_ERROR;
     183        default:    AssertMsgFailedReturn(("cbStackItem=%d\n", cbStackItem), VERR_DBGF_STACK_IPE_1);
    184184    }
    185185    pFrame->AddrReturnFrame.FlatPtr += pFrame->AddrReturnFrame.off - pFrame->AddrFrame.off;
     
    263263        case 4: pFrame->fFlags |= DBGFSTACKFRAME_FLAGS_32BIT; break;
    264264        case 8: pFrame->fFlags |= DBGFSTACKFRAME_FLAGS_64BIT; break;
    265         default:    AssertMsgFailed(("cbStackItem=%d\n", cbStackItem)); return VERR_INTERNAL_ERROR;
     265        default:    AssertMsgFailedReturn(("cbStackItem=%d\n", cbStackItem), VERR_DBGF_STACK_IPE_2);
    266266    }
    267267
  • trunk/src/VBox/VMM/VMMR3/EMHwaccm.cpp

    r39078 r39405  
    307307    }
    308308    AssertMsgReturn(rcStrict == VERR_NOT_FOUND, ("%Rrc\n", VBOXSTRICTRC_VAL(rcStrict)),
    309                     RT_SUCCESS_NP(rcStrict) ? VERR_INTERNAL_ERROR_5 : VBOXSTRICTRC_TODO(rcStrict));
     309                    RT_SUCCESS_NP(rcStrict) ? VERR_IPE_UNEXPECTED_INFO_STATUS : VBOXSTRICTRC_TODO(rcStrict));
    310310
    311311    /** @todo probably we should fall back to the recompiler; otherwise we'll go back and forth between HC & GC
     
    477477int emR3HwAccExecute(PVM pVM, PVMCPU pVCpu, bool *pfFFDone)
    478478{
    479     int      rc = VERR_INTERNAL_ERROR;
     479    int      rc = VERR_IPE_UNINITIALIZED_STATUS;
    480480    PCPUMCTX pCtx = pVCpu->em.s.pCtx;
    481481
  • trunk/src/VBox/VMM/VMMR3/EMRaw.cpp

    r39070 r39405  
    13831383    STAM_REL_PROFILE_ADV_START(&pVCpu->em.s.StatRAWTotal, a);
    13841384
    1385     int      rc = VERR_INTERNAL_ERROR;
     1385    int      rc = VERR_IPE_UNINITIALIZED_STATUS;
    13861386    PCPUMCTX pCtx = pVCpu->em.s.pCtx;
    13871387    LogFlow(("emR3RawExecute: (cs:eip=%04x:%08x)\n", pCtx->cs, pCtx->eip));
     
    14141414            PGMMapCheck(pVM);
    14151415            AssertMsgFailed(("We should not get conflicts any longer!!!\n"));
    1416             return VERR_INTERNAL_ERROR;
     1416            return VERR_EM_UNEXPECTED_MAPPING_CONFLICT;
    14171417        }
    14181418#endif /* VBOX_STRICT */
     
    15491549            PGMMapCheck(pVM);
    15501550            AssertMsgFailed(("We should not get conflicts any longer!!! rc=%Rrc\n", rc));
    1551             return VERR_INTERNAL_ERROR;
     1551            return VERR_EM_UNEXPECTED_MAPPING_CONFLICT;
    15521552        }
    15531553#endif /* VBOX_STRICT */
  • trunk/src/VBox/VMM/VMMR3/GMM.cpp

    r35346 r39405  
    211211    if (cActualPages != pReq->cPages)
    212212    {
    213         AssertReturn(cActualPages < pReq->cPages, VERR_INTERNAL_ERROR);
     213        AssertReturn(cActualPages < pReq->cPages, VERR_GMM_ACTUAL_PAGES_IPE);
    214214        if (!cActualPages)
    215215            return VINF_SUCCESS;
  • trunk/src/VBox/VMM/VMMR3/HWACCM.cpp

    r39402 r39405  
    25612561
    25622562    default:
    2563         AssertLogRelFailedReturn(VERR_INTERNAL_ERROR);
     2563        AssertLogRelFailedReturn(VERR_HM_UNKNOWN_IO_INSTRUCTION);
    25642564    }
    25652565
  • trunk/src/VBox/VMM/VMMRZ/DBGFRZ.cpp

    r35346 r39405  
    9595
    9696    LogFlow(("DBGFRZTrap01Handler: guest debug event %RTreg at %04x:%RGv!\n", uDr6, pRegFrame->cs, pRegFrame->rip));
    97     return fInHyper ? VERR_INTERNAL_ERROR : VINF_EM_RAW_GUEST_TRAP;
     97    return fInHyper ? VERR_DBGF_HYPER_DB_XCPT : VINF_EM_RAW_GUEST_TRAP;
    9898}
    9999
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette