VirtualBox

Changeset 2559 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 9, 2007 2:00:38 PM (18 years ago)
Author:
vboxsync
Message:

Allow ring-3 only access handlers (phys).

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

Legend:

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

    r2290 r2559  
    12051205    PPGMPHYSHANDLER pHandler = (PPGMPHYSHANDLER)pNode;
    12061206    RTGCINTPTR      offDelta = *(PRTGCINTPTR)pvUser;
    1207     Assert(pHandler->pfnHandlerGC);
    1208     pHandler->pfnHandlerGC += offDelta;
    1209     if (pHandler->pvUserGC)
    1210         pHandler->pvUserGC  += offDelta;
     1207    if (pHandler->pfnHandlerGC)
     1208        pHandler->pfnHandlerGC += offDelta;
     1209    if ((RTGCUINTPTR)pHandler->pvUserGC >= 0x10000)
     1210        pHandler->pvUserGC += offDelta;
    12111211    return 0;
    12121212}
     1213
    12131214
    12141215/**
  • trunk/src/VBox/VMM/PGMHandler.cpp

    r2297 r2559  
    101101        pszModR0 = VMMR0_MAIN_MODULE_NAME;
    102102
    103     if (    !pszModGC || !*pszModGC || !pszHandlerGC || !*pszHandlerGC
    104         ||  !pszModR0 || !*pszModR0 || !pszHandlerR0 || !*pszHandlerR0)
    105     {
    106         AssertMsgFailed(("pfnHandlerGC or/and pszModGC is missing\n"));
    107         return VERR_INVALID_PARAMETER;
    108     }
    109 
    110103    /*
    111104     * Resolve the R0 handler.
     
    113106    R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnHandlerR0 = NIL_RTR0PTR;
    114107    int rc = VINF_SUCCESS;
    115     if (HWACCMR3IsAllowed(pVM))
     108    if (pszHandlerR0 && HWACCMR3IsAllowed(pVM))
    116109        rc = PDMR3GetSymbolR0Lazy(pVM, pszModR0, pszHandlerR0, &pfnHandlerR0);
    117110    if (VBOX_SUCCESS(rc))
     
    120113         * Resolve the GC handler.
    121114         */
    122         RTGCPTR pfnHandlerGC;
    123         rc = PDMR3GetSymbolGCLazy(pVM, pszModGC, pszHandlerGC, &pfnHandlerGC);
     115        RTGCPTR pfnHandlerGC = NIL_RTGCPTR;
     116        if (pszHandlerGC)
     117            rc = PDMR3GetSymbolGCLazy(pVM, pszModGC, pszHandlerGC, &pfnHandlerGC);
    124118
    125119        if (VBOX_SUCCESS(rc))
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r2276 r2559  
    351351                                      ("Unexpected trap for physical handler: %08X (phys=%08x) HCPhys=%X uErr=%X, enum=%d\n", pvFault, GCPhys, HCPhys, uErr, pCur->enmType));
    352352
    353 #ifdef IN_GC
    354                             Assert(CTXSUFF(pCur->pfnHandler));
    355                             STAM_PROFILE_START(&pCur->Stat, h);
    356                             rc = pCur->CTXSUFF(pfnHandler)(pVM, uErr, pRegFrame, pvFault, GCPhysFault, CTXSUFF(pCur->pvUser));
    357                             STAM_PROFILE_STOP(&pCur->Stat, h);
    358 #elif IN_RING0
     353#if defined(IN_GC) || defined(ING_RING0)
    359354                            if (CTXALLSUFF(pCur->pfnHandler))
    360355                            {
     
    364359                            }
    365360                            else
     361#endif
    366362                                rc = VINF_EM_RAW_EMULATE_INSTR;
    367 #else
    368                             rc = VINF_EM_RAW_EMULATE_INSTR;
    369 #endif
    370363                            STAM_COUNTER_INC(&pVM->pgm.s.StatHandlersPhysical);
    371364                            STAM_PROFILE_STOP(&pVM->pgm.s.StatHandlers, b);
  • trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp

    r2297 r2559  
    108108            return VERR_INVALID_PARAMETER;
    109109    }
    110     if (!pfnHandlerGC)
    111     {
    112         AssertMsgFailed(("!pfnHandlerGC\n"));
    113         return VERR_INVALID_PARAMETER;
    114     }
    115110    if (    (RTGCUINTPTR)pvUserGC >= 0x10000
    116111        &&  MMHyperHC2GC(pVM, MMHyperGC2HC(pVM, pvUserGC)) != pvUserGC)
     
    119114        return VERR_INVALID_PARAMETER;
    120115    }
     116    AssertReturn(pfnHandlerR3 || pfnHandlerR0 || pfnHandlerGC, VERR_INVALID_PARAMETER);
    121117
    122118    /*
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