VirtualBox

Changeset 55900 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
May 18, 2015 10:17:35 AM (10 years ago)
Author:
vboxsync
Message:

PGM: Added a pVCpu parameter to all virtual handler callouts and also a PGMACCESSORIGIN parameter to the ring-3 one.

File:
1 edited

Legend:

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

    r55899 r55900  
    20822082 * @param   pvBuf       Where to put the bits we read.
    20832083 * @param   cb          How much to read - less or equal to a page.
    2084  */
    2085 static int pgmPhysReadHandler(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void *pvBuf, size_t cb)
     2084 * @param   enmOrigin       The origin of this call.
     2085 */
     2086static int pgmPhysReadHandler(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void *pvBuf, size_t cb, PGMACCESSORIGIN enmOrigin)
    20862087{
    20872088    /*
     
    21082109     * Deal with any physical handlers.
    21092110     */
     2111    PVMCPU pVCpu = VMMGetCpu(pVM);
    21102112#ifdef IN_RING3
    21112113    PPGMPHYSHANDLER pPhys = NULL;
     
    21742176
    21752177            STAM_PROFILE_START(&pVirt->Stat, h);
    2176             rc2 = pVirtType->CTX_SUFF(pfnHandler)(pVM, GCPtr, (void *)pvSrc, pvBuf, cb, PGMACCESSTYPE_READ,
     2178            rc2 = pVirtType->CTX_SUFF(pfnHandler)(pVM, pVCpu, GCPtr, (void *)pvSrc, pvBuf, cb, PGMACCESSTYPE_READ, enmOrigin,
    21772179                                                  pVirt->CTX_SUFF(pvUser));
    21782180            STAM_PROFILE_STOP(&pVirt->Stat, h);
     
    22542256                                || PGM_PAGE_IS_SPECIAL_ALIAS_MMIO(pPage)))
    22552257                {
    2256                     int rc = pgmPhysReadHandler(pVM, pPage, pRam->GCPhys + off, pvBuf, cb);
     2258                    int rc = pgmPhysReadHandler(pVM, pPage, pRam->GCPhys + off, pvBuf, cb, enmOrigin);
    22572259                    if (RT_FAILURE(rc))
    22582260                    {
     
    23372339 * @param   pvBuf       What to write.
    23382340 * @param   cbWrite     How much to write - less or equal to a page.
    2339  */
    2340 static int pgmPhysWriteHandler(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void const *pvBuf, size_t cbWrite)
     2341 * @param   enmOrigin       The origin of this call.
     2342 */
     2343static int pgmPhysWriteHandler(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void const *pvBuf, size_t cbWrite,
     2344                               PGMACCESSORIGIN enmOrigin)
    23412345{
    23422346    PGMPAGEMAPLOCK  PgMpLck;
     
    23512355     * the heavy usage of full page handlers in the page pool.
    23522356     */
     2357    PVMCPU pVCpu = VMMGetCpu(pVM);
    23532358    if (   !PGM_PAGE_HAS_ACTIVE_VIRTUAL_HANDLERS(pPage)
    23542359        || PGM_PAGE_IS_MMIO_OR_SPECIAL_ALIAS(pPage) /* screw virtual handlers on MMIO pages */)
     
    24612466
    24622467                    STAM_PROFILE_START(&pCur->Stat, h);
    2463                     rc = pCurType->CTX_SUFF(pfnHandler)(pVM, GCPtr, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE,
    2464                                                         pCur->CTX_SUFF(pvUser));
     2468                    rc = pCurType->CTX_SUFF(pfnHandler)(pVM, pVCpu, GCPtr, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE,
     2469                                                        enmOrigin, pCur->CTX_SUFF(pvUser));
    24652470                    STAM_PROFILE_STOP(&pCur->Stat, h);
    24662471                }
     
    26492654                                  + (GCPhys & PAGE_OFFSET_MASK);
    26502655                STAM_PROFILE_START(&pVirt->Stat, h);
    2651                 rc = pVirtType->CTX_SUFF(pfnHandler)(pVM, GCPtr, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE,
    2652                                                      pVirt->CTX_SUFF(pvUser));
     2656                rc = pVirtType->CTX_SUFF(pfnHandler)(pVM, pVCpu, GCPtr, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE,
     2657                                                     enmOrigin, pVirt->CTX_SUFF(pvUser));
    26532658                STAM_PROFILE_STOP(&pVirt->Stat, h);
    26542659                AssertLogRelMsg(rc == VINF_SUCCESS || rc == VINF_PGM_HANDLER_DO_DEFAULT, ("rc=%Rrc GCPhys=%RGp pPage=%R[pgmpage] %s\n", rc, GCPhys, pPage, pVirt->pszDesc));
     
    27042709                                  + (GCPhys & PAGE_OFFSET_MASK);
    27052710                STAM_PROFILE_START(&pVirt->Stat, h2);
    2706                 int rc2 = pVirtType->CTX_SUFF(pfnHandler)(pVM, GCPtr, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE,
    2707                                                           pVirt->CTX_SUFF(pvUser));
     2711                int rc2 = pVirtType->CTX_SUFF(pfnHandler)(pVM, pVCpu, GCPtr, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE,
     2712                                                          enmOrigin, pVirt->CTX_SUFF(pvUser));
    27082713                STAM_PROFILE_STOP(&pVirt->Stat, h2);
    27092714                if (rc2 == VINF_SUCCESS && rc == VINF_PGM_HANDLER_DO_DEFAULT)
     
    28012806                    || PGM_PAGE_IS_SPECIAL_ALIAS_MMIO(pPage))
    28022807                {
    2803                     int rc = pgmPhysWriteHandler(pVM, pPage, pRam->GCPhys + off, pvBuf, cb);
     2808                    int rc = pgmPhysWriteHandler(pVM, pPage, pRam->GCPhys + off, pvBuf, cb, enmOrigin);
    28042809                    if (RT_FAILURE(rc))
    28052810                    {
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