VirtualBox

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


Ignore:
Timestamp:
May 5, 2010 2:05:17 PM (15 years ago)
Author:
vboxsync
Message:

Some shared paging updates

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

Legend:

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

    r29024 r29086  
    391391 * @see GMMR0RegisterSharedModule
    392392 */
    393 GMMR3DECL(int) GMMR3UnregisterSharedModule(PVM pVM, char *pszModuleName, char *pszVersion, RTGCPTR GCBaseAddr, uint32_t cbModule)
    394 {
    395     GMMUNREGISTERSHAREDMODULEREQ Req;
    396     Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC;
    397     Req.Hdr.cbReq = sizeof(Req);
    398 
    399     Req.GCBaseAddr    = GCBaseAddr;
    400     Req.cbModule      = cbModule;
    401 
    402     if (    RTStrCopy(Req.szName, sizeof(Req.szName), pszModuleName) != VINF_SUCCESS
    403         ||  RTStrCopy(Req.szVersion, sizeof(Req.szVersion), pszVersion) != VINF_SUCCESS)
    404     {
    405         return VERR_BUFFER_OVERFLOW;
    406     }
    407 
    408     return VMMR3CallR0(pVM, VMMR0_DO_GMM_UNREGISTER_SHARED_MODULE, 0, &Req.Hdr);
     393GMMR3DECL(int) GMMR3UnregisterSharedModule(PVM pVM, PGMMREGISTERSHAREDMODULEREQ pReq)
     394{
     395    pReq->Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC;
     396    pReq->Hdr.cbReq = sizeof(*pReq);
     397    return VMMR3CallR0(pVM, VMMR0_DO_GMM_UNREGISTER_SHARED_MODULE, 0, &pReq->Hdr);
    409398}
    410399
  • trunk/src/VBox/VMM/PGMSharedPage.cpp

    r29024 r29086  
    5454        unsigned cFlushedPages = 0;
    5555
    56         /** todo count copy-on-write actions in the trap handler so we don't check everything all the time! */
     56        /** todo count copy-on-write actions in the trap handler so we don't have to check everything all the time! */
    5757
    5858        /* Count the number of shared pages that were changed (copy-on-write). */
     
    124124    AssertReturn(pReq, VERR_NO_MEMORY);
    125125
    126     pReq->Hdr.u32Magic  = SUPVMMR0REQHDR_MAGIC;
    127     pReq->Hdr.cbReq     = sizeof(*pReq);
    128126    pReq->GCBaseAddr    = GCBaseAddr;
    129127    pReq->cbModule      = cbModule;
     
    146144}
    147145
     146
     147#ifdef VBOX_WITH_PAGE_SHARING
     148/**
     149 * Shared module unregistration helper (called on the way out).
     150 *
     151 * @param   pVM         The VM handle.
     152 * @param   pReq        Unregistration request info
     153 */
     154static DECLCALLBACK(void) pgmR3SharedModuleUnregisterHelper(PVM pVM, PGMMREGISTERSHAREDMODULEREQ pReq)
     155{
     156    int rc;
     157   
     158    rc = GMMR3UnregisterSharedModule(pVM, pReq);
     159    RTMemFree(pReq);
     160    return;
     161}
     162#endif
    148163
    149164/**
     
    160175{
    161176#ifdef VBOX_WITH_PAGE_SHARING
    162     return GMMR3UnregisterSharedModule(pVM, pszModuleName, pszVersion, GCBaseAddr, cbModule);
     177    PGMMUNREGISTERSHAREDMODULEREQ pReq;
     178
     179    pReq = (PGMMUNREGISTERSHAREDMODULEREQ)RTMemAllocZ(sizeof(*pReq));
     180    AssertReturn(pReq, VERR_NO_MEMORY);
     181   
     182    pReq->GCBaseAddr    = GCBaseAddr;
     183    pReq->cbModule      = cbModule;
     184
     185    if (    RTStrCopy(pReq->szName, sizeof(pReq->szName), pszModuleName) != VINF_SUCCESS
     186        ||  RTStrCopy(pReq->szVersion, sizeof(pReq->szVersion), pszVersion) != VINF_SUCCESS)
     187    {
     188        return VERR_BUFFER_OVERFLOW;
     189    }
     190    /* Queue the actual registration as we are under the IOM lock right now. Perform this operation on the way out. */
     191    return VMR3ReqCallNoWait(pVM, VMMGetCpuId(pVM), (PFNRT)pgmR3SharedModuleUnregisterHelper, 2, pVM, pReq);
    163192#else
    164193    return VERR_NOT_IMPLEMENTED;
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