VirtualBox

Changeset 4917

Show
Ignore:
Timestamp:
09/20/07 12:06:48 (1 year ago)
Author:
vboxsync
Message:

Don't trigger breakpoints in ring 0. (AssertRelease? & co)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/VBox/vmm.h

    r4811 r4917  
    9191    /** Set the VM runtime error message. */ 
    9292    VMMCALLHOST_VM_SET_RUNTIME_ERROR, 
     93    /** Signal a ring 0 hypervisor assertion. */ 
     94    VMMCALLHOST_VM_R0_HYPER_ASSERTION, 
    9395    /** The usual 32-bit hack. */ 
    9496    VMMCALLHOST_32BIT_HACK = 0x7fffffff 
  • trunk/include/iprt/assert.h

    r4071 r4917  
    496496# endif 
    497497#elif defined(_MSC_VER) 
    498 # define AssertReleaseBreakpoint()      __debugbreak() 
     498# ifdef IN_VMM_R0 
     499#  define AssertReleaseBreakpoint()      RTR0AssertBreakpoint(pVM) 
     500# else 
     501#  define AssertReleaseBreakpoint()      __debugbreak() 
     502# endif 
    499503#else 
    500504# error "Unknown compiler" 
     
    11841188 
    11851189 
     1190/** 
     1191 * Ring 0 VMM breakpoint function. 
     1192 *  
     1193 * Generates a guru meditation  
     1194 *  
     1195 * @remark does not return 
     1196 */ 
     1197RTDECL(void)    RTR0AssertBreakpoint(void *pVM); 
     1198 
    11861199/** The last assert message, 1st part. */ 
    11871200extern RTDATADECL(char) g_szRTAssertMsg1[1024]; 
  • trunk/src/VBox/VMM/PGMHandler.cpp

    r4787 r4917  
    180180{ 
    181181    PPGMPHYSHANDLER pCur = (PPGMPHYSHANDLER)pNode; 
    182     unsigned        fFlags = pgmHandlerPhysicalCalcFlags(pCur); 
     182    unsigned        fFlags = pgmHandlerPhysicalCalcFlags((PVM)pvUser, pCur); 
    183183    PPGMRAMRANGE    pRamHint = NULL; 
    184184    RTGCPHYS        GCPhys = pCur->Core.Key; 
     
    434434        for (unsigned iPage = 0; iPage < pCur->cPages; iPage++) 
    435435            if (pCur->aPhysToVirt[iPage].offNextAlias & PGMPHYS2VIRTHANDLER_IN_TREE) 
    436                 pgmHandlerVirtualClearPage(pPGM, pCur, iPage); 
     436                pgmHandlerVirtualClearPage(pVM, pPGM, pCur, iPage); 
    437437 
    438438        /* 
  • trunk/src/VBox/VMM/PGMInternal.h

    r4787 r4917  
    28722872 * 
    28732873 * @returns The ram flags. 
    2874  * @param   pCur        The physical handler in question. 
    2875  */ 
    2876 DECLINLINE(unsigned) pgmHandlerPhysicalCalcFlags(PPGMPHYSHANDLER pCur) 
     2874 * @param   pVM     The VM handle. 
     2875 * @param   pCur    The physical handler in question. 
     2876 */ 
     2877DECLINLINE(unsigned) pgmHandlerPhysicalCalcFlags(PVM pVM, PPGMPHYSHANDLER pCur) 
    28772878{ 
    28782879    switch (pCur->enmType) 
     
    28972898 * Clears one physical page of a virtual handler 
    28982899 * 
    2899  * @param   pPGM    Pointer to the PGM instance. 
     2900 * @param   pVM     The VM handle. 
    29002901 * @param   pCur    Virtual handler structure 
    29012902 * @param   iPage   Physical page index 
    29022903 */ 
    2903 DECLINLINE(void) pgmHandlerVirtualClearPage(PPGM pPGM, PPGMVIRTHANDLER pCur, unsigned iPage) 
     2904DECLINLINE(void) pgmHandlerVirtualClearPage(PVM pVM, PPGM pPGM, PPGMVIRTHANDLER pCur, unsigned iPage) 
    29042905{ 
    29052906    const PPGMPHYS2VIRTHANDLER pPhys2Virt = &pCur->aPhysToVirt[iPage]; 
     
    30003001 * 
    30013002 * @returns Pointer to the shadow page structure. 
     3003 * @param   pVM         The VM handle. 
    30023004 * @param   pPool       The pool. 
    30033005 * @param   HCPhys      The HC physical address of the shadow page. 
    30043006 */ 
    3005 DECLINLINE(PPGMPOOLPAGE) pgmPoolGetPage(PPGMPOOL pPool, RTHCPHYS HCPhys) 
     3007DECLINLINE(PPGMPOOLPAGE) pgmPoolGetPage(PVM pVM, PPGMPOOL pPool, RTHCPHYS HCPhys) 
    30063008{ 
    30073009    /* 
     
    30183020 * 
    30193021 * @returns Pointer to the shadow page structure. 
     3022 * @param   pVM         The VM handle. 
    30203023 * @param   pPool       The pool. 
    30213024 * @param   idx         The pool page index. 
    30223025 */ 
    3023 DECLINLINE(PPGMPOOLPAGE) pgmPoolGetPageByIdx(PPGMPOOL pPool, unsigned idx) 
     3026DECLINLINE(PPGMPOOLPAGE) pgmPoolGetPageByIdx(PVM pVM, PPGMPOOL pPool, unsigned idx) 
    30243027{ 
    30253028    AssertFatalMsg(idx >= PGMPOOL_IDX_FIRST && idx < pPool->cCurPages, ("idx=%d\n", idx)); 
  • trunk/src/VBox/VMM/VMM.cpp

    r4811 r4917  
    22332233            break; 
    22342234 
     2235        /* 
     2236         * Signal a ring 0 hypervisor assertion. 
     2237         */ 
     2238        case VMMCALLHOST_VM_R0_HYPER_ASSERTION: 
     2239            return VINF_EM_DBG_HYPER_ASSERTION; 
     2240 
    22352241        default: 
    22362242            AssertMsgFailed(("enmCallHostOperation=%d\n", pVM->vmm.s.enmCallHostOperation)); 
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r4788 r4917  
    26732673                if (PdeDst.n.u1Present) 
    26742674                { 
    2675                     PPGMPOOLPAGE pShwPage = pgmPoolGetPage(pPool, PdeDst.u & SHW_PDE_PG_MASK); 
     2675                    PPGMPOOLPAGE pShwPage = pgmPoolGetPage(pVM, pPool, PdeDst.u & SHW_PDE_PG_MASK); 
    26762676                    RTGCPHYS     GCPhys; 
    26772677                    if (    !PdeSrc.b.u1Size 
     
    27532753                if (pPDEDst->n.u1Present) 
    27542754                { 
    2755                     pgmPoolFreeByPage(pPool, pgmPoolGetPage(pPool, pPDEDst->u & SHW_PDE_PG_MASK), SHW_POOL_ROOT_IDX, iPdShw); 
     2755                    pgmPoolFreeByPage(pPool, pgmPoolGetPage(pVM, pPool, pPDEDst->u & SHW_PDE_PG_MASK), SHW_POOL_ROOT_IDX, iPdShw); 
    27562756                    pPDEDst->u = 0; 
    27572757                    MY_STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,SyncCR3DstFreedSrcNP)); 
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r4787 r4917  
    609609    PPGMVIRTHANDLER pCur  = (PPGMVIRTHANDLER)pNode; 
    610610    PPGMHVUSTATE    pState = (PPGMHVUSTATE)pvUser; 
     611    PVM             pVM = pState->pVM; 
    611612 
    612613#if PGM_GST_TYPE == PGM_TYPE_32BIT 
    613     PX86PD          pPDSrc = pState->pVM->pgm.s.CTXSUFF(pGuestPD); 
     614    PX86PD          pPDSrc = pVM->pgm.s.CTXSUFF(pGuestPD); 
    614615#endif 
    615616 
     
    667668                        { 
    668669                            if (pCur->aPhysToVirt[iPage].Core.Key != NIL_RTGCPHYS) 
    669                                 pgmHandlerVirtualClearPage(&pState->pVM->pgm.s, pCur, iPage); 
     670                                pgmHandlerVirtualClearPage(pState->pVM, &pState->pVM->pgm.s, pCur, iPage); 
    670671#ifdef VBOX_STRICT_PGM_HANDLER_VIRTUAL 
    671672                            AssertReleaseMsg(!pCur->aPhysToVirt[iPage].offNextAlias, 
     
    690691                        if (pCur->aPhysToVirt[iPage].Core.Key != NIL_RTGCPHYS) 
    691692                        { 
    692                             pgmHandlerVirtualClearPage(&pState->pVM->pgm.s, pCur, iPage); 
     693                            pgmHandlerVirtualClearPage(pState->pVM, &pState->pVM->pgm.s, pCur, iPage); 
    693694#ifdef VBOX_STRICT_PGM_HANDLER_VIRTUAL 
    694695                            AssertReleaseMsg(!pCur->aPhysToVirt[iPage].offNextAlias, 
     
    717718                    { 
    718719                        if (pCur->aPhysToVirt[iPage].Core.Key != NIL_RTGCPHYS) 
    719                             pgmHandlerVirtualClearPage(&pState->pVM->pgm.s, pCur, iPage); 
     720                            pgmHandlerVirtualClearPage(pState->pVM, &pState->pVM->pgm.s, pCur, iPage); 
    720721#ifdef VBOX_STRICT_PGM_HANDLER_VIRTUAL 
    721722                        AssertReleaseMsg(!pCur->aPhysToVirt[iPage].offNextAlias, 
     
    739740                if (pCur->aPhysToVirt[iPage].Core.Key != NIL_RTGCPHYS) 
    740741                { 
    741                     pgmHandlerVirtualClearPage(&pState->pVM->pgm.s, pCur, iPage); 
     742                    pgmHandlerVirtualClearPage(pState->pVM, &pState->pVM->pgm.s, pCur, iPage); 
    742743                    pCur->aPhysToVirt[iPage].Core.Key = NIL_RTGCPHYS; 
    743744                    pState->fTodo |= PGM_SYNC_UPDATE_PAGE_BIT_VIRTUAL; 
  • trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp

    r4620 r4917  
    4545*   Internal Functions                                                         * 
    4646*******************************************************************************/ 
    47 DECLINLINE(unsigned) pgmHandlerPhysicalCalcFlags(PPGMPHYSHANDLER pCur); 
    4847static int pgmHandlerPhysicalSetRamFlagsAndFlushShadowPTs(PVM pVM, PPGMPHYSHANDLER pCur, PPGMRAMRANGE pRam); 
    4948static void pgmHandlerPhysicalDeregisterNotifyREM(PVM pVM, PPGMPHYSHANDLER pCur); 
     
    234233    const int       rc = VINF_PGM_GCPHYS_ALIASED; 
    235234#endif 
    236     const unsigned  fFlags = pgmHandlerPhysicalCalcFlags(pCur); Assert(!(fFlags & X86_PTE_PAE_PG_MASK)); 
     235    const unsigned  fFlags = pgmHandlerPhysicalCalcFlags(pVM, pCur); Assert(!(fFlags & X86_PTE_PAE_PG_MASK)); 
    237236    RTUINT          cPages = pCur->cPages; 
    238237    RTUINT          i = (pCur->Core.Key - pRam->GCPhys) >> PAGE_SHIFT; 
     
    433432                ||  (pBelow->Core.KeyLast >> PAGE_SHIFT) != (pCur->Core.Key >> PAGE_SHIFT)) 
    434433                break; 
    435             pgmRamFlagsSetByGCPhysWithHint(pPGM, GCPhys, pgmHandlerPhysicalCalcFlags(pCur), &pRamHint); 
     434            pgmRamFlagsSetByGCPhysWithHint(pPGM, GCPhys, pgmHandlerPhysicalCalcFlags(pVM, pCur), &pRamHint); 
    436435 
    437436            /* next? */ 
     
    455454                ||  (pAbove->Core.Key >> PAGE_SHIFT) != (pCur->Core.KeyLast >> PAGE_SHIFT)) 
    456455                break; 
    457             pgmRamFlagsSetByGCPhysWithHint(pPGM, GCPhys, pgmHandlerPhysicalCalcFlags(pCur), &pRamHint); 
     456            pgmRamFlagsSetByGCPhysWithHint(pPGM, GCPhys, pgmHandlerPhysicalCalcFlags(pVM, pCur), &pRamHint); 
    458457 
    459458            /* next? */ 
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r4620 r4917  
    4343static void pgmPoolFlushAllInt(PPGMPOOL pPool); 
    4444#ifdef PGMPOOL_WITH_USER_TRACKING 
    45 DECLINLINE(unsigned) pgmPoolTrackGetShadowEntrySize(PGMPOOLKIND enmKind); 
    46 DECLINLINE(unsigned) pgmPoolTrackGetGuestEntrySize(PGMPOOLKIND enmKind); 
     45DECLINLINE(unsigned) pgmPoolTrackGetShadowEntrySize(PVM pVM, PGMPOOLKIND enmKind); 
     46DECLINLINE(unsigned) pgmPoolTrackGetGuestEntrySize(PVM pVM, PGMPOOLKIND enmKind); 
    4747static void pgmPoolTrackDeref(PPGMPOOL pPool, PPGMPOOLPAGE pPage); 
    4848#endif 
     
    203203 
    204204#elif defined(IN_RING0) 
     205    PVM   pVM = pPool->CTXSUFF(pVM); 
    205206    void *pvRet; 
     207 
    206208    int rc = pgmRamGCPhys2HCPtr(&pPool->pVMHC->pgm.s, GCPhysFault & ~(RTGCPHYS)(cbEntry - 1), &pvRet); 
    207209    AssertFatalRCSuccess(rc); 
     
    236238#endif 
    237239{ 
     240    const PVM pVM = pPool->CTXSUFF(pVM); 
     241 
    238242    Assert(pPage->iMonitoredPrev == NIL_PGMPOOL_IDX); 
    239243    const unsigned off = GCPhysFault & PAGE_OFFSET_MASK; 
     
    248252            PX86PDPAE   pPDPae; 
    249253        } uShw; 
    250         uShw.pv = PGMPOOL_PAGE_2_PTR(pPool->CTXSUFF(pVM), pPage); 
     254        uShw.pv = PGMPOOL_PAGE_2_PTR(pVM, pPage); 
    251255 
    252256        switch (pPage->enmKind) 
     
    310314                if (uShw.pPD->a[iShw].u & PGM_PDFLAGS_MAPPING) 
    311315                { 
    312                     Assert(pgmMapAreMappingsEnabled(&pPool->CTXSUFF(pVM)->pgm.s)); 
    313                     VM_FF_SET(pPool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3); 
     316                    Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 
     317                    VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3); 
    314318                    LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw=%#x!\n", iShw)); 
    315319                } 
     
    324328                        &&  uShw.pPD->a[iShw2].u & PGM_PDFLAGS_MAPPING) 
    325329                    { 
    326                         Assert(pgmMapAreMappingsEnabled(&pPool->CTXSUFF(pVM)->pgm.s)); 
    327                         VM_FF_SET(pPool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3); 
     330                        Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 
     331                        VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3); 
    328332                        LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw2=%#x!\n", iShw2)); 
    329333                    } 
     
    331335#if 0 /* useful when running PGMAssertCR3(), a bit too troublesome for general use (TLBs). */ 
    332336                if (    uShw.pPD->a[iShw].n.u1Present 
    333                     &&  !VM_FF_ISSET(pPool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3)) 
     337                    &&  !VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3)) 
    334338                { 
    335339                    LogFlow(("pgmPoolMonitorChainChanging: iShw=%#x: %RX32 -> freeing it!\n", iShw, uShw.pPD->a[iShw].u)); 
     
    337341                    ASMProbeReadByte(pvAddress); 
    338342# endif 
    339                     pgmPoolFree(pPool->CTXSUFF(pVM), uShw.pPD->a[iShw].u & X86_PDE_PG_MASK, pPage->idx, iShw); 
     343                    pgmPoolFree(pVM, uShw.pPD->a[iShw].u & X86_PDE_PG_MASK, pPage->idx, iShw); 
    340344                    uShw.pPD->a[iShw].u = 0; 
    341345                } 
     
    351355                    if ((uShw.pPDPae->a[iShw].u & (PGM_PDFLAGS_MAPPING | X86_PDE_P)) == (PGM_PDFLAGS_MAPPING | X86_PDE_P)) 
    352356                    { 
    353                         Assert(pgmMapAreMappingsEnabled(&pPool->CTXSUFF(pVM)->pgm.s)); 
    354                         VM_FF_SET(pPool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3); 
     357                        Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 
     358                        VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3); 
    355359                        LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw=%#x!\n", iShw)); 
    356360                    } 
     
    364368                            &&  (uShw.pPDPae->a[iShw2].u & (PGM_PDFLAGS_MAPPING | X86_PDE_P)) == (PGM_PDFLAGS_MAPPING | X86_PDE_P)) 
    365369                        { 
    366                             Assert(pgmMapAreMappingsEnabled(&pPool->CTXSUFF(pVM)->pgm.s)); 
    367                             VM_FF_SET(pPool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3); 
     370                            Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 
     371                            VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3); 
    368372                            LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw2=%#x!\n", iShw2)); 
    369373                        } 
     
    371375#if 0 /* useful when running PGMAssertCR3(), a bit too troublesome for general use (TLBs). */ 
    372376                    if (    uShw.pPDPae->a[iShw].n.u1Present 
    373                         &&  !VM_FF_ISSET(pPool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3)) 
     377                        &&  !VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3)) 
    374378                    { 
    375379                        LogFlow(("pgmPoolMonitorChainChanging: iShw=%#x: %RX64 -> freeing it!\n", iShw, uShw.pPDPae->a[iShw].u)); 
     
    377381                        ASMProbeReadByte(pvAddress); 
    378382# endif 
    379                         pgmPoolFree(pPool->CTXSUFF(pVM), uShw.pPDPae->a[iShw].u & X86_PDE_PAE_PG_MASK, pPage->idx, iShw); 
     383                        pgmPoolFree(pVM, uShw.pPDPae->a[iShw].u & X86_PDE_PAE_PG_MASK, pPage->idx, iShw); 
    380384                        uShw.pPDPae->a[iShw].u = 0; 
    381385                    } 
     
    781785DECLINLINE(void) pgmPoolHashRemove(PPGMPOOL pPool, PPGMPOOLPAGE pPage) 
    782786{ 
     787    const PVM pVM = pPool->CTXSUFF(pVM); 
     788 
    783789    uint16_t iHash = PGMPOOL_HASH(pPage->GCPhys); 
    784790    if (pPool->aiHash[iHash] == pPage->idx) 
     
    818824static int pgmPoolCacheFreeOne(PPGMPOOL pPool, uint16_t iUser) 
    819825{ 
     826    const PVM pVM = pPool->CTXSUFF(pVM); 
     827 
    820828    Assert(pPool->iAgeHead != pPool->iAgeTail); /* We shouldn't be here if there < 2 cached entries! */ 
    821829    STAM_COUNTER_INC(&pPool->StatCacheFreeUpOne); 
     
    856864 * @returns true if reused and the cached page (enmKind1) should be flushed 
    857865 * @returns false if not reused. 
     866 * @param   pVM         The VM handle. 
    858867 * @param   enmKind1    The kind of the cached page. 
    859868 * @param   enmKind2    The kind of the requested page. 
    860869 */ 
    861 static bool pgmPoolCacheReusedByKind(PGMPOOLKIND enmKind1, PGMPOOLKIND enmKind2) 
     870static bool pgmPoolCacheReusedByKind(PVM pVM, PGMPOOLKIND enmKind1, PGMPOOLKIND enmKind2) 
    862871{ 
    863872    switch (enmKind1) 
     
    942951static int pgmPoolCacheAlloc(PPGMPOOL pPool, RTGCPHYS GCPhys, PGMPOOLKIND enmKind, uint16_t iUser, uint16_t iUserTable, PPPGMPOOLPAGE ppPage) 
    943952{ 
     953    const PVM pVM = pPool->CTXSUFF(pVM); 
     954 
    944955    /* 
    945956     * Look up the GCPhys in the hash. 
     
    971982                 * different way than the other kinds. 
    972983                 */ 
    973                 if (pgmPoolCacheReusedByKind((PGMPOOLKIND)pPage->enmKind, enmKind)) 
     984                if (pgmPoolCacheReusedByKind(pVM, (PGMPOOLKIND)pPage->enmKind, enmKind)) 
    974985                { 
    975986                    STAM_COUNTER_INC(&pPool->StatCacheKindMismatches); 
     
    10801091{ 
    10811092#ifdef PGMPOOL_WITH_CACHE 
     1093    const PVM pVM = pPool->CTXSUFF(pVM); 
     1094 
    10821095    /* 
    10831096     * Look up the GCPhys in the hash. 
     
    11451158static int pgmPoolMonitorInsert(PPGMPOOL pPool, PPGMPOOLPAGE pPage) 
    11461159{ 
     1160    const PVM pVM = pPool->CTXSUFF(pVM); 
     1161 
    11471162    /* 
    11481163     * Filter out the relevant kinds. 
     
    11961211    { 
    11971212        Assert(pPage->iMonitoredNext == NIL_PGMPOOL_IDX); Assert(pPage->iMonitoredPrev == NIL_PGMPOOL_IDX); 
    1198         PVM pVM = pPool->CTXSUFF(pVM); 
    11991213        const RTGCPHYS GCPhysPage = pPage->GCPhys & ~(RTGCPHYS)(PAGE_SIZE - 1); 
    12001214        rc = PGMHandlerPhysicalRegisterEx(pVM, PGMPHYSHANDLERTYPE_PHYSICAL_WRITE, 
     
    12261240static int pgmPoolMonitorFlush(PPGMPOOL pPool, PPGMPOOLPAGE pPage) 
    12271241{ 
     1242    const PVM pVM = pPool->CTXSUFF(pVM); 
     1243 
    12281244    /* 
    12291245     * Filter out the relevant kinds. 
     
    12611277     * Remove the page from the monitored list or uninstall it if last. 
    12621278     */ 
    1263     const PVM pVM = pPool->CTXSUFF(pVM); 
    12641279    int rc; 
    12651280    if (    pPage->iMonitoredNext != NIL_PGMPOOL_IDX 
     
    13541369int pgmPoolMonitorMonitorCR3(PPGMPOOL pPool, uint16_t idxRoot, RTGCPHYS GCPhysCR3) 
    13551370{ 
     1371    const PVM pVM = pPool->CTXSUFF(pVM); 
     1372 
    13561373    Assert(idxRoot != NIL_PGMPOOL_IDX && idxRoot < PGMPOOL_IDX_FIRST); 
    13571374    PPGMPOOLPAGE pPage = &pPool->aPages[idxRoot]; 
     
    14091426int pgmPoolMonitorUnmonitorCR3(PPGMPOOL pPool, uint16_t idxRoot) 
    14101427{ 
     1428    const PVM pVM = pPool->CTXSUFF(pVM); 
     1429 
    14111430    Assert(idxRoot != NIL_PGMPOOL_IDX && idxRoot < PGMPOOL_IDX_FIRST); 
    14121431    PPGMPOOLPAGE pPage = &pPool->aPages[idxRoot]; 
     
    18511870static void pgmPoolTrackFreeUser(PPGMPOOL pPool, PPGMPOOLPAGE pPage, uint16_t iUser, uint16_t iUserTable) 
    18521871{ 
     1872    const PVM pVM = pPool->CTXSUFF(pVM); 
     1873 
    18531874    /* 
    18541875     * Unlink and free the specified user entry. 
     
    19001921 * Gets the entry size of a shadow table. 
    19011922 * 
    1902  * @param enmKind 
    1903  *          The kind of page. 
     1923 * @param   pVM         The VM handle. 
     1924 * @param   enmKind     The kind of page. 
    19041925 * 
    19051926 * @returns The size of the entry in bytes. That is, 4 or 8. 
     
    19071928 *          returned. 
    19081929 */ 
    1909 DECLINLINE(unsigned) pgmPoolTrackGetShadowEntrySize(PGMPOOLKIND enmKind) 
     1930DECLINLINE(unsigned) pgmPoolTrackGetShadowEntrySize(PVM pVM, PGMPOOLKIND enmKind) 
    19101931{ 
    19111932    switch (enmKind) 
     
    19391960 * Gets the entry size of a guest table. 
    19401961 * 
    1941  * @param enmKind 
    1942  *          The kind of page. 
     1962 * @param   pVM         The VM handle. 
     1963 * @param   enmKind     The kind of page. 
    19431964 * 
    19441965 * @returns The size of the entry in bytes. That is, 0, 4 or 8. 
     
    19461967 *          returned. 
    19471968 */ 
    1948 DECLINLINE(unsigned) pgmPoolTrackGetGuestEntrySize(PGMPOOLKIND enmKind) 
     1969DECLINLINE(unsigned) pgmPoolTrackGetGuestEntrySize(PVM pVM, PGMPOOLKIND enmKind) 
    19491970{ 
    19501971    switch (enmKind) 
     
    22502271        uint32_t       *pau32; 
    22512272    } u; 
    2252     u.pau64 = (uint64_t *)PGMPOOL_PAGE_2_PTR(pPool->CTXSUFF(pVM), pUserPage); 
     2273    const PVM pVM = pPool->CTXSUFF(pVM); 
     2274 
     2275    u.pau64 = (uint64_t *)PGMPOOL_PAGE_2_PTR(pVM, pUserPage); 
    22532276 
    22542277#ifdef VBOX_STRICT 
     
    25242547{ 
    25252548    const unsigned cRefs = pPhysPage->HCPhys >> MM_RAM_FLAGS_CREFS_SHIFT; /** @todo PAGE FLAGS */ 
     2549    const PVM pVM = pPool->CTXSUFF(pVM); 
     2550 
    25262551    AssertFatalMsg(cRefs == MM_RAM_FLAGS_CREFS_PHYSEXT, ("cRefs=%d HCPhys=%RHp pPage=%p:{.idx=%d}\n", cRefs, pPhysPage->HCPhys, pPage, pPage->idx)); 
    25272552 
     
    25522577 
    25532578                    /* we can free the node. */ 
    2554                     PVM pVM = pPool->CTXSUFF(pVM); 
    25552579                    const uint16_t iPhysExtNext = paPhysExts[iPhysExt].iNext; 
    25562580                    if (    iPhysExtPrev == NIL_PGMPOOL_PHYSEXT_INDEX 
     
    26102634static void pgmPoolTracDerefGCPhys(PPGMPOOL pPool, PPGMPOOLPAGE pPage, RTHCPHYS HCPhys, RTGCPHYS GCPhys) 
    26112635{ 
     2636    const PVM pVM = pPool->CTXSUFF(pVM); 
    26122637    /* 
    26132638     * Walk range list. 
    26142639     */ 
    2615     PPGMRAMRANGE pRam = pPool->CTXSUFF(pVM)->pgm.s.CTXSUFF(pRamRanges); 
     2640    PPGMRAMRANGE pRam = pVM->pgm.s.CTXSUFF(pRamRanges); 
    26162641    while (pRam) 
    26172642    { 
     
    26452670static void pgmPoolTracDerefGCPhysHint(PPGMPOOL pPool, PPGMPOOLPAGE pPage, RTHCPHYS HCPhys, RTGCPHYS GCPhysHint) 
    26462671{ 
     2672    const PVM pVM = pPool->CTXSUFF(pVM); 
    26472673    /* 
    26482674     * Walk range list. 
    26492675     */ 
    2650     PPGMRAMRANGE pRam = pPool->CTXSUFF(pVM)->pgm.s.CTXSUFF(pRamRanges); 
     2676    PPGMRAMRANGE pRam = pVM->pgm.s.CTXSUFF(pRamRanges); 
    26512677    while (pRam) 
    26522678    { 
     
    26712697     */ 
    26722698    STAM_COUNTER_INC(&pPool->StatTrackLinearRamSearches); 
    2673     pRam = pPool->CTXSUFF(pVM)->pgm.s.CTXSUFF(pRamRanges); 
     2699    pRam = pVM->pgm.s.CTXSUFF(pRamRanges); 
    26742700    while (pRam) 
    26752701    { 
     
    28042830DECLINLINE(void) pgmPoolTrackDerefPDPae(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PDPAE pShwPD) 
    28052831{ 
     2832    const PVM pVM = pPool->CTXSUFF(pVM); 
     2833 
    28062834    for (unsigned i = 0; i < ELEMENTS(pShwPD->a); i++) 
    28072835    { 
     
    28282856DECLINLINE(void) pgmPoolTrackDerefPDPTR64Bit(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PDPTR pShwPdPtr) 
    28292857{ 
     2858    const PVM pVM = pPool->CTXSUFF(pVM); 
     2859 
    28302860    for (unsigned i = 0; i < ELEMENTS(pShwPdPtr->a); i++) 
    28312861    { 
     
    28532883static void pgmPoolTrackDeref(PPGMPOOL pPool, PPGMPOOLPAGE pPage) 
    28542884{ 
     2885    const PVM pVM = pPool->CTXSUFF(pVM); 
     2886 
    28552887    /* 
    28562888     * Map the shadow page and take action according to the page kind. 
     
    31433175        if (pPage->fMonitored) 
    31443176        { 
    3145             PVM pVM = pPool->CTXSUFF(pVM); 
     3177            const PVM pVM = pPool->CTXSUFF(pVM); 
    31463178            int rc = PGMHandlerPhysicalChangeCallbacks(pVM, pPage->GCPhys & ~(RTGCPHYS)(PAGE_SIZE - 1), 
    31473179                                                       pPool->pfnAccessHandlerR3, MMHyperCCToR3(pVM, pPage), 
     
    34633495    LogFlow(("pgmPoolFree: HCPhys=%VHp iUser=%#x iUserTable=%#x\n", HCPhys, iUser, iUserTable)); 
    34643496    PPGMPOOL pPool = pVM->pgm.s.CTXSUFF(pPool); 
    3465     pgmPoolFreeByPage(pPool, pgmPoolGetPage(pPool, HCPhys), iUser, iUserTable); 
     3497    pgmPoolFreeByPage(pPool, pgmPoolGetPage(pVM, pPool, HCPhys), iUser, iUserTable); 
    34663498} 
    34673499 
     
    34793511    /** @todo profile this! */ 
    34803512    PPGMPOOL pPool = pVM->pgm.s.CTXSUFF(pPool); 
    3481     PPGMPOOLPAGE pPage = pgmPoolGetPage(pPool, HCPhys); 
     3513    PPGMPOOLPAGE pPage = pgmPoolGetPage(pVM, pPool, HCPhys); 
    34823514    Log3(("pgmPoolGetPageByHCPhys: HCPhys=%VHp -> %p:{.idx=%d .GCPhys=%VGp .enmKind=%d}\n", 
    34833515          HCPhys, pPage, pPage->idx, pPage->GCPhys, pPage->enmKind)); 
  • trunk/src/VBox/VMM/VMMAll/TMAll.cpp

    r4787 r4917  
    696696TMDECL(uint64_t) TMTimerToNano(PTMTIMER pTimer, uint64_t u64Ticks) 
    697697{ 
     698    PVM pVM = pTimer->CTXALLSUFF(pVM);  NOREF(pVM); 
     699 
    698700    switch (pTimer->enmClock) 
    699701    { 
     
    729731TMDECL(uint64_t) TMTimerToMicro(PTMTIMER pTimer, uint64_t u64Ticks) 
    730732{ 
     733    PVM pVM = pTimer->CTXALLSUFF(pVM);  NOREF(pVM); 
     734 
    731735    switch (pTimer->enmClock) 
    732736    { 
     
    762766TMDECL(uint64_t) TMTimerToMilli(PTMTIMER pTimer, uint64_t u64Ticks) 
    763767{ 
     768    PVM pVM = pTimer->CTXALLSUFF(pVM);  NOREF(pVM); 
     769 
    764770    switch (pTimer->enmClock) 
    765771    { 
     
    794800TMDECL(uint64_t) TMTimerFromNano(PTMTIMER pTimer, uint64_t u64NanoTS) 
    795801{ 
     802    PVM pVM = pTimer->CTXALLSUFF(pVM);  NOREF(pVM); 
     803 
    796804    switch (pTimer->enmClock) 
    797805    { 
     
    826834TMDECL(uint64_t) TMTimerFromMicro(PTMTIMER pTimer, uint64_t u64MicroTS) 
    827835{ 
     836    PVM pVM = pTimer->CTXALLSUFF(pVM);  NOREF(pVM); 
     837 
    828838    switch (pTimer->enmClock) 
    829839    { 
     
    858868TMDECL(uint64_t) TMTimerFromMilli(PTMTIMER pTimer, uint64_t u64MilliTS) 
    859869{ 
     870    PVM pVM = pTimer->CTXALLSUFF(pVM);  NOREF(pVM); 
     871 
    860872    switch (pTimer->enmClock) 
    861873    { 
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r4829 r4917  
    943943# define LOG_GROUP LOG_GROUP_EM 
    944944 
     945DECLEXPORT(void) RTCALL RTR0AssertBreakpoint(void *pvVM) 
     946{ 
     947    if (pvVM) 
     948    { 
     949        PVM pVM = (PVM)pvVM; 
     950        pVM->vmm.s.enmCallHostOperation = VMMCALLHOST_VM_R0_HYPER_ASSERTION; 
     951        pVM->vmm.s.u64CallHostArg = 0; 
     952        pVM->vmm.s.rcCallHost = VERR_INTERNAL_ERROR; 
     953        int rc = vmmR0CallHostLongJmp(&pVM->vmm.s.CallHostR0JmpBuf, VERR_INTERNAL_ERROR); 
     954        if (rc == VINF_SUCCESS) 
     955            rc = pVM->vmm.s.rcCallHost; 
     956    } 
     957} 
     958 
    945959/** Runtime assert implementation for Native Win32 Ring-0. */ 
    946960DECLEXPORT(void) RTCALL AssertMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction) 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy