VirtualBox

Changeset 46861 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jun 28, 2013 10:29:10 AM (11 years ago)
Author:
vboxsync
Message:

Don't allow mixing builds.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/VMMAll.cpp

    r46326 r46861  
    360360}
    361361
     362
     363/**
     364 * Returns the build type for matching components.
     365 *
     366 * @returns Build type value.
     367 */
     368uint32_t vmmGetBuildType(void)
     369{
     370    uint32_t uRet = 0xbeef0000;
     371#ifdef DEBUG
     372    uRet |= RT_BIT_32(0);
     373#endif
     374#ifdef VBOX_WITH_STATISTICS
     375    uRet |= RT_BIT_32(1);
     376#endif
     377    return uRet;
     378}
     379
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r46420 r46861  
    264264 * @param   pVM         Pointer to the VM.
    265265 * @param   uSvnRev     The SVN revision of the ring-3 part.
     266 * @param   uBuildType  Build type indicator.
    266267 * @thread  EMT.
    267268 */
    268 static int vmmR0InitVM(PVM pVM, uint32_t uSvnRev)
    269 {
    270     /*
    271      * Match the SVN revisions.
     269static int vmmR0InitVM(PVM pVM, uint32_t uSvnRev, uint32_t uBuildType)
     270{
     271    /*
     272     * Match the SVN revisions and build type.
    272273     */
    273274    if (uSvnRev != VMMGetSvnRev())
     
    277278        return VERR_VMM_R0_VERSION_MISMATCH;
    278279    }
     280    if (uBuildType != vmmGetBuildType())
     281    {
     282        LogRel(("VMMR0InitVM: Build type mismatch, r3=%#x r0=%#x\n", uBuildType, vmmGetBuildType()));
     283        SUPR0Printf("VMMR0InitVM: Build type mismatch, r3=%#x r0=%#x\n", uBuildType, vmmGetBuildType());
     284        return VERR_VMM_R0_VERSION_MISMATCH;
     285    }
    279286    if (    !VALID_PTR(pVM)
    280287        ||  pVM->pVMR0 != pVM)
    281288        return VERR_INVALID_PARAMETER;
     289
    282290
    283291#ifdef LOG_ENABLED
     
    953961         */
    954962        case VMMR0_DO_VMMR0_INIT:
    955             return vmmR0InitVM(pVM, (uint32_t)u64Arg);
     963            return vmmR0InitVM(pVM, RT_LODWORD(u64Arg), RT_HIDWORD(u64Arg));
    956964
    957965        /*
  • trunk/src/VBox/VMM/VMMR3/VMM.cpp

    r46420 r46861  
    511511        rc = VINF_SUCCESS;
    512512#else
    513         rc = SUPR3CallVMMR0Ex(pVM->pVMR0, 0 /*idCpu*/, VMMR0_DO_VMMR0_INIT, VMMGetSvnRev(), NULL);
     513        rc = SUPR3CallVMMR0Ex(pVM->pVMR0, 0 /*idCpu*/, VMMR0_DO_VMMR0_INIT,
     514                              RT_MAKE_U64(VMMGetSvnRev(), vmmGetBuildType()), NULL);
    514515#endif
    515516        /*
     
    569570        CPUMSetHyperESP(pVCpu, pVCpu->vmm.s.pbEMTStackBottomRC); /* Clear the stack. */
    570571        uint64_t u64TS = RTTimeProgramStartNanoTS();
    571         CPUMPushHyper(pVCpu, (uint32_t)(u64TS >> 32));    /* Param 3: The program startup TS - Hi. */
    572         CPUMPushHyper(pVCpu, (uint32_t)u64TS);            /* Param 3: The program startup TS - Lo. */
     572        CPUMPushHyper(pVCpu, (uint32_t)(u64TS >> 32));    /* Param 4: The program startup TS - Hi. */
     573        CPUMPushHyper(pVCpu, (uint32_t)u64TS);            /* Param 4: The program startup TS - Lo. */
     574        CPUMPushHyper(pVCpu, vmmGetBuildType());          /* Param 3: Version argument. */
    573575        CPUMPushHyper(pVCpu, VMMGetSvnRev());             /* Param 2: Version argument. */
    574576        CPUMPushHyper(pVCpu, VMMGC_DO_VMMGC_INIT);        /* Param 1: Operation. */
    575577        CPUMPushHyper(pVCpu, pVM->pVMRC);                 /* Param 0: pVM */
    576         CPUMPushHyper(pVCpu, 5 * sizeof(RTRCPTR));        /* trampoline param: stacksize.  */
     578        CPUMPushHyper(pVCpu, 6 * sizeof(RTRCPTR));        /* trampoline param: stacksize.  */
    577579        CPUMPushHyper(pVCpu, RCPtrEP);                    /* Call EIP. */
    578580        CPUMSetHyperEIP(pVCpu, pVM->vmm.s.pfnCallTrampolineRC);
  • trunk/src/VBox/VMM/VMMRC/VMMRC.cpp

    r44528 r46861  
    7070        {
    7171            /*
    72              * Validate the svn revision (uArg).
     72             * Validate the svn revision (uArg) and build type (ellipsis).
    7373             */
    7474            if (uArg != VMMGetSvnRev())
    7575                return VERR_VMM_RC_VERSION_MISMATCH;
    7676
     77            va_list va;
     78            va_start(va, uArg);
     79
     80            uint32_t uBuildType = va_arg(va, uint32_t);
     81            if (uBuildType != vmmGetBuildType())
     82                return VERR_VMM_RC_VERSION_MISMATCH;
     83
    7784            /*
    7885             * Initialize the runtime.
    79              * (The program timestamp is found in the elipsis.)
    8086             */
    81             va_list va;
    82             va_start(va, uArg);
    8387            uint64_t u64TS = va_arg(va, uint64_t);
     88
    8489            va_end(va);
    8590
  • trunk/src/VBox/VMM/include/VMMInternal.h

    r45701 r46861  
    520520int  vmmInitFormatTypes(void);
    521521void vmmTermFormatTypes(void);
     522uint32_t vmmGetBuildType(void);
    522523
    523524#ifdef IN_RING3
Note: See TracChangeset for help on using the changeset viewer.

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